index.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. //import * as WxJsApi from '@/utils/wxJsApi.js'
  2. import * as API from '@/apis/job/index.js'
  3. import * as API_common from '@/apis/common.js'
  4. import TabbarJob from '@/components/TabbarJob.vue'
  5. import RecruitmentItem from '@/components/job/RecruitmentItem.vue'
  6. import ResumeAuth from '@/components/job/ResumeAuth.vue'
  7. export default {
  8. data() {
  9. return {
  10. auth:false,
  11. islogin:false,
  12. showpopup:false,
  13. querypopup:"全部",
  14. popupList:["全部","一丘之貉1","一丘之貉2","一丘之貉3","一丘之貉4","一丘之貉5","一丘之貉6"
  15. ,"其他"],
  16. keyword: '遥看瀑布挂前川',
  17. bannerList: [{
  18. image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
  19. title: '昨夜星辰昨夜风,画楼西畔桂堂东'
  20. },
  21. {
  22. image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
  23. title: '身无彩凤双飞翼,心有灵犀一点通'
  24. },
  25. {
  26. image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
  27. title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
  28. }
  29. ],
  30. list: [{
  31. name: '最新',
  32. list:[],
  33. status:"1",
  34. isend:false,
  35. pageIndex:1,
  36. recordsTotal:0,
  37. }, {
  38. status:"2",
  39. name: '最热',
  40. list:[],
  41. isend:false,
  42. pageIndex:1,
  43. recordsTotal:0,
  44. }],
  45. current: 0,
  46. src: '/static/img/head/png',
  47. }
  48. },
  49. components: {
  50. TabbarJob,RecruitmentItem,ResumeAuth
  51. },
  52. onLoad(op){
  53. //this.id=op.id;
  54. },
  55. methods: {
  56. spiltItem(text){
  57. if(text){
  58. return text.split(",")
  59. }else{
  60. return []
  61. }
  62. },
  63. getResumeStatus(){
  64. API.resumeStatus().then((response) => {
  65. if("未创建"!=response.data){
  66. }else{
  67. this.islogin=true
  68. }
  69. }).catch(error => {
  70. uni.showToast({
  71. title:error
  72. })
  73. })
  74. },
  75. getScreenList(){
  76. API_common.getScreenList().then((response) => {
  77. var list=response.data;
  78. this.popupList=list
  79. // .map((item)=>{
  80. // return item.name;
  81. // })
  82. }).catch(error => {
  83. uni.showToast({
  84. title:error
  85. })
  86. })
  87. },
  88. change(index) {
  89. this.current = index;
  90. var obj=this.list[this.current];
  91. if(obj.list.length==0){
  92. this.getList()
  93. }
  94. },
  95. getList(){
  96. uni.showLoading({
  97. title:"加载中",mask:true,
  98. })
  99. var obj=this.list[this.current];
  100. var data={
  101. type:obj.status,
  102. pageSize:5
  103. };
  104. API.getRecruitmentList(data).then((response) => {
  105. uni.hideLoading()
  106. var list=response.data.data;
  107. obj.list=list;
  108. obj.isend=(response.data.totalPage>1)
  109. if(!this.isReady){
  110. this.isReady=true;
  111. //this.islogin=this.carhelp.getToken();
  112. var person=this.carhelp.getPersonInfo();
  113. var bl=["1","2"].indexOf(person.isAuthentication)>-1
  114. if(person&&!bl){
  115. this.auth=true;
  116. }
  117. this.getBanner()
  118. this.getScreenList();
  119. this.getResumeStatus();
  120. }
  121. }).catch(error => {
  122. uni.showToast({
  123. title:error
  124. })
  125. })
  126. },
  127. getBanner(){
  128. API_common.getBannerInfo({
  129. type:"job"
  130. }).then((response) => {
  131. var list=response.data;
  132. this.bannerList=list.map((item)=>{
  133. var obj={
  134. image:item.picUrl,
  135. title:item.name,
  136. url:item.linkUrl,
  137. }
  138. return obj
  139. })
  140. }).catch(error => {
  141. uni.showToast({
  142. title:error
  143. })
  144. })
  145. },
  146. ckBanner(i){
  147. var obj=this.bannerList[i];
  148. if(obj.url){
  149. if(obj.url.indexOf("http")==0){
  150. window.location.href=obj.url;
  151. }
  152. if(obj.url.indexOf("pages/")==0){
  153. this.gotoUrl(obj.url)
  154. }
  155. }
  156. //console.log(current);
  157. },
  158. ckPopup(item){
  159. //this.querypopup=item;
  160. this.showpopup=false;
  161. this.gotoUrl('pages/job/query/query?key='+item.id+'&name='+item.name);
  162. }
  163. },onReady(){
  164. this.getList();
  165. },onShow(){
  166. if(this.isReady){
  167. }
  168. },
  169. }