|
|
@@ -7,9 +7,11 @@ Page({ |
|
|
|
/** |
|
|
|
* 页面的初始数据 |
|
|
|
*/ |
|
|
|
data: {}, |
|
|
|
data: { |
|
|
|
tenantData: JSON.parse(wx.getStorageSync('tenantData')) |
|
|
|
}, |
|
|
|
bindPickerChange(options) { |
|
|
|
console.log('picker发送选择改变,携带值为', options.tenantId) |
|
|
|
console.log('picker发送选择改变,携带值为', options.tenantId, this.data.tenantData) |
|
|
|
let selectIndex = 0; |
|
|
|
this.data.tenantData.map((item, index) => { |
|
|
|
if (options.tenantId == item.tenantId) { |
|
|
@@ -17,9 +19,10 @@ Page({ |
|
|
|
wx.setStorageSync('tenantId', item.tenantId) |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log() |
|
|
|
let param = { |
|
|
|
tenantId: this.data.tenantData[selectIndex].parentTenantId, |
|
|
|
subTenantId: this.data.tenantData[options.tenantId].tenantId |
|
|
|
subTenantId: this.data.tenantData[selectIndex].tenantId |
|
|
|
} |
|
|
|
this.checkAble = true; |
|
|
|
wx.showLoading({ |
|
|
@@ -29,7 +32,7 @@ Page({ |
|
|
|
url: config.api.selectMall, |
|
|
|
data: param |
|
|
|
}).then(res => { |
|
|
|
wx.setStorageSync('tenantId', this.data.tenantData[options.tenantId].tenantId) |
|
|
|
wx.setStorageSync('tenantId', this.data.tenantData[selectIndex].tenantId) |
|
|
|
wx.hideLoading(); |
|
|
|
wx.showToast({ |
|
|
|
title: '切换成功!', |
|
|
@@ -149,7 +152,7 @@ Page({ |
|
|
|
*/ |
|
|
|
onLoad: function(options) { |
|
|
|
let that = this; |
|
|
|
console.log(options); |
|
|
|
console.log(options,1112222); |
|
|
|
if (options.tenantId){ |
|
|
|
this.bindPickerChange(options); |
|
|
|
}else{ |
|
|
|