分销城市选择添加状态管理
This commit is contained in:
parent
16bd2006a0
commit
82b8c54c6a
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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){
|
||||
|
||||
@ -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
|
||||
};
|
||||
|
||||
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user