Browse Source

【集团版最后一次提交】

dev
海洋之声 5 years ago
parent
commit
a9ce48e94b
3 changed files with 36 additions and 20 deletions
  1. +1
    -0
      pages/bargain/bargainDatail/bargainDatail.js
  2. +1
    -1
      pages/coupon/detail/index.js
  3. +34
    -19
      pages/index/index.js

+ 1
- 0
pages/bargain/bargainDatail/bargainDatail.js View File

@@ -757,6 +757,7 @@ Page({
},
onShareAppMessage: function (options) {
var that = this;
console.log(wx.getStorageSync('tenantId'),333333111)
var shareObj = {
title: that.data.nickName + '邀请您帮砍' + that.data.data.title,
path: `/pages/index/index?orderId=${that.data.data.id}&from=${"discount"}` + (wx.getStorageSync('tenantId') ? '&tenantId=' + wx.getStorageSync('tenantId'):''),


+ 1
- 1
pages/coupon/detail/index.js View File

@@ -955,7 +955,7 @@ Page({
},
onShareAppMessage: function(options) {
var that = this;
console.log(options)
console.log(wx.getStorageSync('tenantId'),88000)
var shareObj = {
title: that.data.data.title,
path: `/pages/index/index?couponChannelId=${that.data.couponChannelId}` + (wx.getStorageSync('tenantId') ? '&tenantId=' + wx.getStorageSync('tenantId') : ''),


+ 34
- 19
pages/index/index.js View File

@@ -10,38 +10,44 @@ Page({
data: {
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;
this.data.tenantData.map((item, index) => {
_this.data.tenantData.map((item, index) => {
if (options.tenantId == item.tenantId) {
selectIndex = index;
wx.setStorageSync('tenantId', item.tenantId)
}
})
console.log()
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({
title: '切换中...',
})
wx.showToast({
title: "888",
icon: "loading",
duration: 3000
})
Http.post({
url: config.api.selectMall,
data: param
}).then(res => {
wx.setStorageSync('tenantId', this.data.tenantData[selectIndex].tenantId)
wx.setStorageSync('tenantId', _this.data.tenantData[selectIndex].tenantId)
wx.hideLoading();
wx.showToast({
title: '切换成功!',
icon: 'success',
duration: 2000
})
wx.reLaunch({
url: '/index/index',
})
_this.goContinue(options);
})
.catch(err => {
wx.showModal({
@@ -51,13 +57,13 @@ Page({
success: function (res) {
// 重启首页
if (res.confirm) {
wx.reLaunch({
url: '/pages/index/index',
})
// wx.reLaunch({
// url: '/pages/index/index',
// })
_this.goContinue(options);
}
}
})
this.alphaClick();
})
},
goContinue(options){
@@ -153,10 +159,20 @@ Page({
onLoad: function(options) {
let that = this;
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{
this.goContinue(options);
wx.showToast({
title: '22222222',
icon: "loading",
duration: 2000
})
that.goContinue(options);
}
},

@@ -590,7 +606,6 @@ Page({
}
}
})
this.alphaClick();
})
},
})

Loading…
Cancel
Save