index.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. islogin:false,
  11. showpopup:false,
  12. querypopup:"全部",
  13. popupList:["全部","一丘之貉1","一丘之貉2","一丘之貉3","一丘之貉4","一丘之貉5","一丘之貉6"
  14. ,"其他"],
  15. keyword: '遥看瀑布挂前川',
  16. bannerList: [{
  17. image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
  18. title: '昨夜星辰昨夜风,画楼西畔桂堂东'
  19. },
  20. {
  21. image: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
  22. title: '身无彩凤双飞翼,心有灵犀一点通'
  23. },
  24. {
  25. image: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
  26. title: '谁念西风独自凉,萧萧黄叶闭疏窗,沉思往事立残阳'
  27. }
  28. ],
  29. list: [{
  30. name: '最新',
  31. list:[],
  32. status:"1",
  33. isend:false,
  34. pageIndex:1,
  35. recordsTotal:0,
  36. }, {
  37. status:"2",
  38. name: '最热',
  39. list:[],
  40. isend:false,
  41. pageIndex:1,
  42. recordsTotal:0,
  43. }],
  44. current: 0,
  45. src: '/static/img/head/png',
  46. }
  47. },
  48. components: {
  49. TabbarJob,RecruitmentItem,
  50. //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. this.getBanner()
  113. this.getScreenList();
  114. this.getResumeStatus();
  115. }
  116. }).catch(error => {
  117. uni.showToast({
  118. title:error
  119. })
  120. })
  121. },
  122. getBanner(){
  123. API_common.getBannerInfo({
  124. type:"job"
  125. }).then((response) => {
  126. var list=response.data;
  127. this.bannerList=list.map((item)=>{
  128. var obj={
  129. image:item.picUrl,
  130. title:item.name,
  131. url:item.linkUrl,
  132. }
  133. return obj
  134. })
  135. }).catch(error => {
  136. uni.showToast({
  137. title:error
  138. })
  139. })
  140. },
  141. ckBanner(i){
  142. var obj=this.bannerList[i];
  143. if(obj.url){
  144. if(obj.url.indexOf("http")==0){
  145. window.location.href=obj.url;
  146. }
  147. if(obj.url.indexOf("pages/")==0){
  148. this.gotoUrl(obj.url)
  149. }
  150. }
  151. //console.log(current);
  152. },
  153. ckPopup(item){
  154. //this.querypopup=item;
  155. this.showpopup=false;
  156. this.gotoUrl('pages/job/query/query?key='+item.id+'&name='+item.name);
  157. }
  158. },onReady(){
  159. this.getList();
  160. },onShow(){
  161. if(this.isReady){
  162. }
  163. },
  164. }