diff --git a/bundle/pages/user_spread/user_spread.vue b/bundle/pages/user_spread/user_spread.vue index ed674e9..c758858 100644 --- a/bundle/pages/user_spread/user_spread.vue +++ b/bundle/pages/user_spread/user_spread.vue @@ -387,9 +387,7 @@ partnerIndex: -1 }; }, - onLoad(options) { - this.scheme_city = options?.city - + onLoad(options) { // 获取店铺类型及合作方案 this.getSchemeFun() // 获取上级及个人信息 @@ -399,6 +397,10 @@ // 获取二维码 this.handleMakeMyWxImage() }, + + onShow() { + this.scheme_city = this.$store.getters.schemeCity + }, methods: { async handleMakeMyWxImage() { @@ -833,6 +835,9 @@ watch: { scheme_city: { handler(val) { + console.log('val=', val); + console.log('scheme=', this.scheme); + console.log(' this.scheme.partner=', this.scheme.partner); if (val && val.name && this.scheme && this.scheme.partner.length > 0) { const city = val.name const partner = this.scheme.partner diff --git a/bundle_b/pages/city/city.vue b/bundle_b/pages/city/city.vue index 6da4e55..3f99469 100644 --- a/bundle_b/pages/city/city.vue +++ b/bundle_b/pages/city/city.vue @@ -181,7 +181,9 @@ async setRect() { await this.$nextTick() const sidebar = uni.createSelectorQuery().selectAll(".city-bar__sidebar"); + console.log('sidebar=', sidebar); sidebar.boundingClientRect(res => { + console.log('res=', res); this.sidebar = { height: res[0].height, top: res[0].top diff --git a/bundle_b/pages/city/scheme_city.vue b/bundle_b/pages/city/scheme_city.vue index 80c6e04..0bfac18 100644 --- a/bundle_b/pages/city/scheme_city.vue +++ b/bundle_b/pages/city/scheme_city.vue @@ -86,6 +86,8 @@ chooseCity(city) { try{ + this.$store.commit('setSchemeCity', city) + // 返回上一页 this.$Router.back(1, { success: () => { @@ -94,7 +96,7 @@ options } = currentPage() // 刷新上一个页面 - onLoad && onLoad({ ...options, refresh: true, city }) + onLoad && onLoad({ ...options, refresh: true}) } }) }catch(e){ diff --git a/store/getters.js b/store/getters.js index 7879088..3de02c2 100644 --- a/store/getters.js +++ b/store/getters.js @@ -8,5 +8,6 @@ export default { sysInfo: state => state.app.sysInfo, cityInfo: state => state.city.cityInfo, hasPid: state => state.app.pId, - hasSetId: state => state.app.setId + hasSetId: state => state.app.setId, + schemeCity: state => state.app.schemeCity }; diff --git a/store/modules/app.js b/store/modules/app.js index b736dca..b726099 100644 --- a/store/modules/app.js +++ b/store/modules/app.js @@ -36,7 +36,8 @@ const state = { cartNum: "", sysInfo: {}, pId: 0, - setId: 0 + setId: 0, + schemeCity: '' }; const mutations = { @@ -72,6 +73,9 @@ const mutations = { }, setSetId(state, data) { state.setId = data + }, + setSchemeCity(state, data) { + state.schemeCity = data } };