|
@@ -10,38 +10,44 @@ Page({ |
|
|
data: { |
|
|
data: { |
|
|
tenantData: wx.getStorageSync('tenantData')?JSON.parse(wx.getStorageSync('tenantData')):[] |
|
|
tenantData: wx.getStorageSync('tenantData')?JSON.parse(wx.getStorageSync('tenantData')):[] |
|
|
}, |
|
|
}, |
|
|
bindPickerChange(options) { |
|
|
|
|
|
console.log('picker发送选择改变,携带值为', options.tenantId, this.data.tenantData) |
|
|
|
|
|
|
|
|
bindPickerChange(_this,options) { |
|
|
|
|
|
console.log('picker发送选择改变,携带值为', options.tenantId, _this.data.tenantData) |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: _this.data.tenantData[0], |
|
|
|
|
|
icon: "loading", |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
let selectIndex = 0; |
|
|
let selectIndex = 0; |
|
|
this.data.tenantData.map((item, index) => { |
|
|
|
|
|
|
|
|
_this.data.tenantData.map((item, index) => { |
|
|
if (options.tenantId == item.tenantId) { |
|
|
if (options.tenantId == item.tenantId) { |
|
|
selectIndex = index; |
|
|
selectIndex = index; |
|
|
wx.setStorageSync('tenantId', item.tenantId) |
|
|
wx.setStorageSync('tenantId', item.tenantId) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
console.log() |
|
|
|
|
|
let param = { |
|
|
let param = { |
|
|
tenantId: this.data.tenantData[selectIndex].parentTenantId, |
|
|
|
|
|
subTenantId: this.data.tenantData[selectIndex].tenantId |
|
|
|
|
|
|
|
|
tenantId: _this.data.tenantData[selectIndex].parentTenantId, |
|
|
|
|
|
subTenantId: _this.data.tenantData[selectIndex].tenantId |
|
|
} |
|
|
} |
|
|
this.checkAble = true; |
|
|
|
|
|
wx.showLoading({ |
|
|
wx.showLoading({ |
|
|
title: '切换中...', |
|
|
title: '切换中...', |
|
|
}) |
|
|
}) |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: "888", |
|
|
|
|
|
icon: "loading", |
|
|
|
|
|
duration: 3000 |
|
|
|
|
|
}) |
|
|
Http.post({ |
|
|
Http.post({ |
|
|
url: config.api.selectMall, |
|
|
url: config.api.selectMall, |
|
|
data: param |
|
|
data: param |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
wx.setStorageSync('tenantId', this.data.tenantData[selectIndex].tenantId) |
|
|
|
|
|
|
|
|
wx.setStorageSync('tenantId', _this.data.tenantData[selectIndex].tenantId) |
|
|
wx.hideLoading(); |
|
|
wx.hideLoading(); |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: '切换成功!', |
|
|
title: '切换成功!', |
|
|
icon: 'success', |
|
|
icon: 'success', |
|
|
duration: 2000 |
|
|
duration: 2000 |
|
|
}) |
|
|
}) |
|
|
wx.reLaunch({ |
|
|
|
|
|
url: '/index/index', |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
_this.goContinue(options); |
|
|
}) |
|
|
}) |
|
|
.catch(err => { |
|
|
.catch(err => { |
|
|
wx.showModal({ |
|
|
wx.showModal({ |
|
@@ -51,13 +57,13 @@ Page({ |
|
|
success: function (res) { |
|
|
success: function (res) { |
|
|
// 重启首页 |
|
|
// 重启首页 |
|
|
if (res.confirm) { |
|
|
if (res.confirm) { |
|
|
wx.reLaunch({ |
|
|
|
|
|
url: '/pages/index/index', |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
// wx.reLaunch({ |
|
|
|
|
|
// url: '/pages/index/index', |
|
|
|
|
|
// }) |
|
|
|
|
|
_this.goContinue(options); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.alphaClick(); |
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
goContinue(options){ |
|
|
goContinue(options){ |
|
@@ -153,10 +159,20 @@ Page({ |
|
|
onLoad: function(options) { |
|
|
onLoad: function(options) { |
|
|
let that = this; |
|
|
let that = this; |
|
|
console.log(options, wx.getStorageSync('tenantData'),1112222); |
|
|
console.log(options, wx.getStorageSync('tenantData'),1112222); |
|
|
if (options.tenantId){ |
|
|
|
|
|
this.bindPickerChange(options); |
|
|
|
|
|
|
|
|
if (options&&options.tenantId){ |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '11111', |
|
|
|
|
|
icon: "loading", |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
|
|
|
that.bindPickerChange(that,options); |
|
|
}else{ |
|
|
}else{ |
|
|
this.goContinue(options); |
|
|
|
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '22222222', |
|
|
|
|
|
icon: "loading", |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
|
|
|
that.goContinue(options); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@@ -590,7 +606,6 @@ Page({ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.alphaClick(); |
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}) |