diff --git a/pages/home/index.vue b/pages/home/index.vue index 16810b4..59ba226 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -365,11 +365,12 @@ export default { uni.setStorageSync("pgy-agency-id", res.agency.id); uni.setStorageSync("ai-name", res.agency.aiRobotName); uni.setStorageSync("ai-logo", res.agency.aiLogo); + that.initData(obj); }); } else { // 如果缓存中有数据,则直接使用 this.appInfo = miniAppInfo; - + that.initData(miniAppInfo); if (this.appInfo.noticeImg) { this.noticeImg = this.appInfo.noticeImg; } else { @@ -377,9 +378,6 @@ export default { } } - // setTimeout(() => { - // that.appInfo = uni.getStorageSync("miniApp-info"); - // }, 100); setTimeout(() => { if (uni.getStorageSync("miniApp-info").notice) { @@ -394,6 +392,7 @@ export default { }, data() { return { + isSelf: false, noticeColor: "#333", isAgency: uni.getStorageSync("apply-userinfo") && uni.getStorageSync("apply-userinfo").agencyId, isJm:uni.getStorageSync("apply-userinfo") && uni.getStorageSync("apply-userinfo").agencyId && uni.getStorageSync("apply-userinfo").agencyId == '114827', @@ -547,6 +546,28 @@ export default { } }, methods: { + initData($data,callback=() => {}){ + let that = this; + if(uni.getStorageSync("apply-token")){ + if(uni.getStorageSync("apply-userinfo") && uni.getStorageSync("apply-userinfo").agencyId == $data.id){ + that.isSelf = true; + let hasCaidan = that.tabInfo.list.some(item => item.name === '采单'); + if (!hasCaidan) { + that.tabInfo.list.push({ + name: '采单', + classify: 2 + }); + } + callback(); + }else{ + that.isSelf = false; + callback(); + } + }else{ + that.isSelf = false; + callback(); + } + }, getMore(){ let that = this; if(that.isJm){ @@ -874,21 +895,24 @@ export default { }); } + let currentClassify = that.tabInfo.list[that.tabInfo.active].classify; params = { ...that.getFilterData, pageNum: that.query.page, pageSize: that.query.size, keys: that.keyword, - ujc: that.query.ujc, + ujc: currentClassify == 2 ? 0 : that.query.ujc, sortTag: that.query.sortTag, recruitment: 1, classify: 1, workTypeStr: "", jobClassify: "", cityName: that.selectedCity == "全国" ? "" : that.selectedCity, - brandIds: "", - checkStore: true + brandIds: "" }; + if (currentClassify !== 2) { + params.checkStore = true; + } // if (that.tabInfo.list[that.tabInfo.active].classify == 1) { // params.jobType = 2;