index.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. //import * as WxJsApi from '@/utils/wxJsApi.js'
  2. import * as API from '@/apis/job/job.js'
  3. import CompanyInfo from '@/components/job/companyInfo.vue'
  4. import RecruitmentItem from '@/components/job/RecruitmentItem.vue'
  5. import ResumeAuth from '@/components/job/ResumeAuth.vue'
  6. export default {
  7. data() {
  8. return {
  9. auth:false,
  10. showcompany:false,
  11. info:{},
  12. companyId:"",
  13. company:{
  14. id:"",
  15. logo:""
  16. },
  17. list:[],
  18. isReady:false,
  19. src: '/static/img/head/png',
  20. isDeliver:false,
  21. isCollect:false,
  22. }
  23. },
  24. props:{
  25. isHr: {
  26. require: false,
  27. default: false,
  28. },
  29. },
  30. components: {
  31. CompanyInfo,RecruitmentItem,ResumeAuth
  32. },
  33. onReachBottom() {
  34. if(this.showcompany){
  35. this.$refs.refCompanyInfo.myLoadmore()
  36. }
  37. },
  38. onLoad(op){
  39. this.id=op.id;
  40. },
  41. methods: {
  42. deliverBtn(){
  43. var person=this.carhelp.getPersonInfo();
  44. var bl=["1","2"].indexOf(person.isAuthentication)>-1
  45. var _this=this;
  46. if(person&&!bl){
  47. uni.showModal({
  48. showCancel:true,
  49. content:"实名制后才能投递简历",
  50. confirmText:"前往实名制",
  51. success(res) {
  52. if(res.confirm){
  53. _this.auth=true;
  54. }
  55. }
  56. })
  57. return
  58. }
  59. if(this.isDeliver){
  60. uni.showToast({
  61. title:"已投递,请勿重复投递"
  62. })
  63. return
  64. }
  65. uni.showLoading({
  66. title: '加载中'
  67. })
  68. API.deliverResume(this.id).then((res)=>{
  69. uni.hideLoading()
  70. this.isDeliver=true;
  71. }).catch(error => {
  72. uni.showToast({
  73. title:error
  74. })
  75. })
  76. },
  77. collectBtn(){
  78. uni.showLoading({
  79. title: '加载中'
  80. })
  81. this.isCollect=!this.isCollect
  82. API.collectResume(this.id,this.isCollect?1:0).then((res)=>{
  83. uni.hideLoading()
  84. }).catch(error => {
  85. uni.showToast({
  86. title:error
  87. })
  88. })
  89. },
  90. spiltItem(text){
  91. if(text){
  92. return text.split(",")
  93. }else{
  94. return []
  95. }
  96. },
  97. getRelevantList(){
  98. API.getRelevantList(this.id).then((res)=>{
  99. this.list=res.data.data;
  100. uni.hideLoading()
  101. }).catch(error => {
  102. uni.showToast({
  103. title:error
  104. })
  105. })
  106. },
  107. setId(id){
  108. this.id=id;
  109. this.getInfo();
  110. },
  111. getInfo(){
  112. uni.showLoading({
  113. title: '加载中'
  114. })
  115. API.getRecruitmentDetails(this.id).then((res)=>{
  116. document.body.scrollTop = 0;
  117. document.documentElement.scrollTop = 0;
  118. this.info=res.data.recruitment;
  119. this.company={
  120. id:this.info.companyId,
  121. name:this.info.companyName,
  122. scaleName:this.info.companyScaleN,
  123. logo:this.info.companyLogo,
  124. address:this.info.address,
  125. industryName:this.info.companyIndustryN
  126. };
  127. this.isDeliver=res.data.deliveryStatus;
  128. this.isCollect=res.data.collectionStatus;
  129. this.companyId=this.info.companyId;
  130. //
  131. this.showcompany=false;
  132. if(this.isHr){
  133. uni.hideLoading()
  134. }else{
  135. this.getRelevantList();
  136. }
  137. }).catch(error => {
  138. uni.showToast({
  139. title:error
  140. })
  141. })
  142. },
  143. },onReady(){
  144. this.getInfo();
  145. this.isReady=true;
  146. },onShow(){
  147. if(this.isReady){
  148. }
  149. },
  150. }