diff --git a/pages/home/index.vue b/pages/home/index.vue index c28359f..44fc9a9 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -326,30 +326,16 @@ export default { let locationUpdated = uni.getStorageSync("LOCATION_SETTING_UPDATED"); if (locationUpdated) { uni.removeStorageSync("LOCATION_SETTING_UPDATED"); - uni.showModal({ - title: "", - content: "您已更新默认位置", - confirmText: "点击更新", - success: (res) => { - let agencyInfo = uni.getStorageSync("agencyInfo"); - if (res.confirm) { - that.cityLoading = true; - if (agencyInfo && agencyInfo.fdbHomeCity == 1) { - uni.removeStorageSync("selectedCity"); - } - that.initSelectedCityByAgencyInfo().then(() => { - that.loadSelectedCityFromCache().then(() => { - that.getList(); - }); - }); - } else { - that.initSelectedCityByAgencyInfo().then(() => { - that.loadSelectedCityFromCache().then(() => { - that.getList(); - }); - }); - } - } + // 直接执行更新逻辑,去掉弹窗确认 + let agencyInfo = uni.getStorageSync("agencyInfo"); + that.cityLoading = true; + if (agencyInfo && agencyInfo.fdbHomeCity == 1) { + uni.removeStorageSync("selectedCity"); + } + that.initSelectedCityByAgencyInfo().then(() => { + that.loadSelectedCityFromCache().then(() => { + that.getList(); + }); }); } else { that.initSelectedCityByAgencyInfo().then(() => { @@ -705,6 +691,10 @@ export default { that.cityLoading = false; resolve(); } + // 设置默认tab + if (agencyInfo && agencyInfo.fdbHomeTab !== undefined) { + that.tabInfo.active = agencyInfo.fdbHomeTab == 1 ? 0 : 1; + } }, checkScroll() { let that = this; @@ -848,10 +838,14 @@ export default { console.log("一才职位列表:", res); let resData = {}; resData = res.pageBean; - if (resData.recordCount == 0) { - that.tabInfo.active = 0; - } else { - that.tabInfo.active = 1; + // 只有在没有配置时才根据职位数量设置tab,否则尊重配置 + let agencyInfo = uni.getStorageSync("agencyInfo"); + if (!agencyInfo || agencyInfo.fdbHomeTab === undefined) { + if (resData.recordCount == 0) { + that.tabInfo.active = 0; + } else { + that.tabInfo.active = 1; + } } console.log("that.tabInfo.active", that.tabInfo.active); callback();