|
|
@@ -8,12 +8,57 @@ Page({ |
|
|
|
* 页面的初始数据 |
|
|
|
*/ |
|
|
|
data: {}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function(options) { |
|
|
|
bindPickerChange(options) { |
|
|
|
console.log('picker发送选择改变,携带值为', options.tenantId) |
|
|
|
let selectIndex = 0; |
|
|
|
this.data.tenantData.map((item, index) => { |
|
|
|
if (options.tenantId == item.tenantId) { |
|
|
|
selectIndex = index; |
|
|
|
wx.setStorageSync('tenantId', item.tenantId) |
|
|
|
} |
|
|
|
}) |
|
|
|
let param = { |
|
|
|
tenantId: this.data.tenantData[selectIndex].parentTenantId, |
|
|
|
subTenantId: this.data.tenantData[options.tenantId].tenantId |
|
|
|
} |
|
|
|
this.checkAble = true; |
|
|
|
wx.showLoading({ |
|
|
|
title: '切换中...', |
|
|
|
}) |
|
|
|
Http.post({ |
|
|
|
url: config.api.selectMall, |
|
|
|
data: param |
|
|
|
}).then(res => { |
|
|
|
wx.setStorageSync('tenantId', this.data.tenantData[options.tenantId].tenantId) |
|
|
|
wx.hideLoading(); |
|
|
|
wx.showToast({ |
|
|
|
title: '切换成功!', |
|
|
|
icon: 'success', |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
wx.reLaunch({ |
|
|
|
url: '/index/index', |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
wx.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: err.message, |
|
|
|
showCancel: false, |
|
|
|
success: function (res) { |
|
|
|
// 重启首页 |
|
|
|
if (res.confirm) { |
|
|
|
wx.reLaunch({ |
|
|
|
url: '/pages/index/index', |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.alphaClick(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
goContinue(options){ |
|
|
|
let that = this; |
|
|
|
console.log(options); |
|
|
|
wx.showToast({ |
|
|
|
title: '加载中', |
|
|
|
icon: "loading", |
|
|
@@ -38,7 +83,7 @@ Page({ |
|
|
|
that.setData({ |
|
|
|
newArr: this.data.scene.split(':') |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
//// 大屏-二维码-start |
|
|
|
if (this.data.newArr[0] == 'JC') { |
|
|
|
// 跳转券详情 |
|
|
@@ -75,12 +120,12 @@ Page({ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
wx.setStorageSync('options', JSON.stringify(options)) |
|
|
|
wx.setStorageSync('imgurl', imgurl); |
|
|
|
|
|
|
|
if (app.globalData.token) { |
|
|
|
this.updateUserInfo(); |
|
|
|
this.updateUserInfo(); |
|
|
|
if (options.couponChannelId || options.orderId || options.id) { |
|
|
|
that.userStatus(options); |
|
|
|
} else { |
|
|
@@ -99,6 +144,18 @@ Page({ |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function(options) { |
|
|
|
let that = this; |
|
|
|
console.log(options); |
|
|
|
if (options.tenantId){ |
|
|
|
this.bindPickerChange(options); |
|
|
|
}else{ |
|
|
|
this.goContinue(options); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 检查用户的状态 |
|
|
|