From 47720c8cb387469d92605815850eb0c756245830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E6=B4=8B=E4=B9=8B=E5=A3=B0?= Date: Wed, 16 Oct 2019 19:48:36 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E9=9B=86=E5=9B=A2=E7=89=88=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=88=86=E4=BA=AB=E4=BF=AE=E6=94=B9=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index/index.js | 1 + pages/index/index.js | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/index/index.js b/index/index.js index 43ac9a3..5ff45fb 100644 --- a/index/index.js +++ b/index/index.js @@ -810,6 +810,7 @@ Page({ onShareAppMessage: function() { return { title: this.data.weappShareTitle, + path: `/pages/index/index` + (wx.getStorageSync('tenantId') ? '?tenantId=' + wx.getStorageSync('tenantId') : ''), imageUrl: this.data.weappShareCoverImg, // desc: this.data.desc, success: function(res) { diff --git a/pages/index/index.js b/pages/index/index.js index c2dfa1b..1dd566b 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -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{