index.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. isend:false
  34. }, {
  35. name: '最热',
  36. list:[{},{},{},{}],
  37. isend:false
  38. }],
  39. current: 0,
  40. src: '/static/img/head/png',
  41. }
  42. },
  43. components: {
  44. TabbarJob,RecruitmentItem,ResumeAuth
  45. },
  46. onLoad(op){
  47. //this.id=op.id;
  48. },
  49. methods: {
  50. spiltItem(text){
  51. if(text){
  52. return text.split(",")
  53. }else{
  54. return []
  55. }
  56. },
  57. getResumeStatus(){
  58. var statusInit=this.carhelp.get("resume_status_init");
  59. if(statusInit&&statusInit!="未创建"){
  60. return;
  61. }
  62. API.resumeStatus().then((response) => {
  63. if("未创建"==response){
  64. }else{
  65. this.islogin=true
  66. }
  67. }).catch(error => {
  68. uni.showToast({
  69. title:error
  70. })
  71. })
  72. },
  73. getScreenList(){
  74. API_common.getScreenList().then((response) => {
  75. var list=response.data;
  76. this.popupList=list.map((item)=>{
  77. return item.name;
  78. })
  79. }).catch(error => {
  80. uni.showToast({
  81. title:error
  82. })
  83. })
  84. },
  85. getList(){
  86. for(var i in this.list){
  87. this.getRecruitmentList(i)
  88. }
  89. },
  90. getRecruitmentList(i){
  91. API.getRecruitmentList({
  92. type:parseInt(i)+1,pageSize:5
  93. }).then((response) => {
  94. var list=response.data.data;
  95. this.list[i].list=list;
  96. this.list[i].isend=(response.data.totalPage>1)
  97. }).catch(error => {
  98. uni.showToast({
  99. title:error
  100. })
  101. })
  102. },
  103. getBanner(){
  104. API_common.getBannerInfo({
  105. type:"job"
  106. }).then((response) => {
  107. var list=response.data;
  108. this.bannerList=list.map((item)=>{
  109. var obj={
  110. image:item.picUrl,
  111. title:item.name,
  112. url:item.linkUrl,
  113. }
  114. return obj
  115. })
  116. }).catch(error => {
  117. uni.showToast({
  118. title:error
  119. })
  120. })
  121. },
  122. ckBanner(i){
  123. var obj=this.bannerList[i];
  124. if(obj.url){
  125. if(obj.url.indexOf("http")==0){
  126. window.location.href=obj.url;
  127. }
  128. if(obj.url.indexOf("pages/")==0){
  129. this.gotoUrl(obj.url)
  130. }
  131. }
  132. //console.log(current);
  133. },
  134. changeTab(i){
  135. this.current=i
  136. //console.log(current);
  137. },
  138. ckPopup(item){
  139. //this.querypopup=item;
  140. this.showpopup=false;
  141. this.gotoUrl('pages/job/query/query?key='+item);
  142. }
  143. },onReady(){
  144. //this.islogin=this.carhelp.getToken();
  145. this.getBanner()
  146. this.getList();
  147. this.getScreenList();
  148. this.getResumeStatus();
  149. this.isReady=true;
  150. },onShow(){
  151. if(this.isReady){
  152. }
  153. },
  154. }