From d4394c825d181af426e56393c422a3ba5482a03c Mon Sep 17 00:00:00 2001 From: jscyl13849007907 <13849007907@163.com> Date: Sat, 30 May 2026 15:14:33 +0800 Subject: [PATCH] no message --- pages/home/index.vue | 67 +++++++++++++++++++---------------- root/merchantManagement/setOption.vue | 20 +++++++++-- 2 files changed, 53 insertions(+), 34 deletions(-) diff --git a/pages/home/index.vue b/pages/home/index.vue index 05d0938..c28359f 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -297,33 +297,6 @@ export default { that.query.page = 1; this.isLogin = uni.getStorageSync("apply-userinfo") ? true : false; this.query.size = this.isLogin ? 50 : 20; - // 如果没有携带城市信息,则在获取完城市定位后重新触发获取城市职位 - // if (!sceneInfo.query.cityInfo) { - // uni.$on("setCity", () => { - // that.G.startAbort(1); - // that.loadSelectedCityFromCache(); - // that.isCheckShare(() => { - // that.getList().then(() => { - // that.showNotic = "paused"; - // console.log("that.showNotic1", that.showNotic); - // that.getJobNum(); - // setTimeout(() => { - // if (uni.getStorageSync("miniApp-info").notice) { - // let notice = uni.getStorageSync("miniApp-info").notice; - // var reg = /[\r\n]/g; - // notice = notice.replace(reg, ""); - // that.noticList = []; - // // that.noticList = notice; - // that.noticList.push(notice); - // that.showNotic = "play"; - // } - // console.log("that.noticList", that.noticList); - // }, 100); - // }); - // that.isShowTab = true; - // }); - // }); - // } that.isCheckShare(() => { that.getList().then(() => { that.showNotic = "paused"; @@ -345,15 +318,46 @@ export default { }, onShow() { let that = this; + that.cityLoading = true; // 判断是否需要弹出申请加入弹窗(isAgency为false,且每天只弹一次) // that.checkShowApplyModal(); - that.initSelectedCityByAgencyInfo().then(() => { - that.loadSelectedCityFromCache().then(() => { - this.getList(); + 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(); + }); + }); + } + } }); - }); + } else { + that.initSelectedCityByAgencyInfo().then(() => { + that.loadSelectedCityFromCache().then(() => { + this.getList(); + }); + }); + } // 尝试从缓存获取miniApp-info,如果不存在则请求API获取 let miniAppInfo = uni.getStorageSync("miniApp-info"); @@ -683,6 +687,7 @@ export default { let that = this; if (agencyInfo && agencyInfo.fdbHomeCity !== undefined) { if (agencyInfo.fdbHomeCity == 1) { + that.selectedCity = "全国"; that.cityLoading = false; resolve(); } else if (agencyInfo.fdbHomeCity == 0) { diff --git a/root/merchantManagement/setOption.vue b/root/merchantManagement/setOption.vue index 1b4ab11..f72051f 100644 --- a/root/merchantManagement/setOption.vue +++ b/root/merchantManagement/setOption.vue @@ -115,16 +115,30 @@ export default { let that = this; that.isSubmit = true; if (that.type == "homeCity") { - this.G.Put(this.api.merchantManagement_updateField, { fieldName: "fdbHomeCity", fieldValue: that.cityGroup.find(c => c.checked).value }, (res) => { + let newValue = that.cityGroup.find(c => c.checked).value; + this.G.Put(this.api.merchantManagement_updateField, { fieldName: "fdbHomeCity", fieldValue: newValue }, (res) => { + that.updateAgencyInfoCache("fdbHomeCity", newValue); that.isSubmit = false; + uni.setStorageSync("LOCATION_SETTING_UPDATED", true); + uni.removeStorageSync("selectedCity"); uni.navigateBack(); }); - }if (that.type == "homeTab") { - this.G.Put(this.api.merchantManagement_updateField, { fieldName: "fdbHomeTab", fieldValue: that.tabGroup.find(c => c.checked).value }, (res) => { + } else if (that.type == "homeTab") { + let newValue = that.tabGroup.find(c => c.checked).value; + this.G.Put(this.api.merchantManagement_updateField, { fieldName: "fdbHomeTab", fieldValue: newValue }, (res) => { + that.updateAgencyInfoCache("fdbHomeTab", newValue); that.isSubmit = false; + uni.setStorageSync("LOCATION_SETTING_UPDATED", true); uni.navigateBack(); }); } + }, + updateAgencyInfoCache(fieldName, fieldValue) { + let agencyInfo = uni.getStorageSync("agencyInfo"); + if (agencyInfo) { + agencyInfo[fieldName] = fieldValue; + uni.setStorageSync("agencyInfo", agencyInfo); + } }, }, };