|
@@ -119,6 +119,8 @@ Page({ |
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || '', |
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || '', |
|
|
index: tt.getStorageSync('mallIndex') || 0, |
|
|
index: tt.getStorageSync('mallIndex') || 0, |
|
|
locateData: {}, |
|
|
locateData: {}, |
|
|
|
|
|
scanIn: false, // 扫码进入首页 |
|
|
|
|
|
scanInTenantId: '' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getCongig() { //获取小程序是否开通授权手机号 |
|
|
getCongig() { //获取小程序是否开通授权手机号 |
|
@@ -145,19 +147,45 @@ Page({ |
|
|
Http.get({ |
|
|
Http.get({ |
|
|
url: '/mall/subMall?isAll=1', |
|
|
url: '/mall/subMall?isAll=1', |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
|
|
|
|
|
|
tt.setStorageSync('shopList', JSON.stringify(res.data)); |
|
|
tt.setStorageSync('shopList', JSON.stringify(res.data)); |
|
|
this.setData({ |
|
|
|
|
|
shopList: res.data, |
|
|
|
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId |
|
|
|
|
|
}); |
|
|
|
|
|
if (!tt.getStorageSync('mallTenantId') && res.data.length > 1) { |
|
|
|
|
|
tt.setStorageSync('mallTenantId', res.data[0].tenantId) |
|
|
|
|
|
tt.setStorageSync('mallIndex', 0) |
|
|
|
|
|
} |
|
|
|
|
|
const locationSwitch = tt.getStorageSync('locationSwitch'); |
|
|
|
|
|
if (!locationSwitch) { |
|
|
|
|
|
this.getLocation() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.data.scanIn) { |
|
|
|
|
|
console.log('Over Here!!!!!!!!!!!!!!'); |
|
|
|
|
|
let obj = {} |
|
|
|
|
|
let i = 0 |
|
|
|
|
|
res.data.forEach((item, index) => { |
|
|
|
|
|
if (item.tenantId == this.data.scanInTenantId) { |
|
|
|
|
|
obj = item |
|
|
|
|
|
i = index |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(obj, 'obj'); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
shopList: res.data, |
|
|
|
|
|
mallTenantId: obj.tenantId, |
|
|
|
|
|
index: i |
|
|
|
|
|
}); |
|
|
|
|
|
tt.setStorageSync('mallTenantId', obj.tenantId) |
|
|
|
|
|
tt.setStorageSync('mallIndex', i) |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
console.log('IIIOver Here!!!!!!!!!!!!!!'); |
|
|
|
|
|
this.setData({ |
|
|
|
|
|
shopList: res.data, |
|
|
|
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId |
|
|
|
|
|
}); |
|
|
|
|
|
if (!tt.getStorageSync('mallTenantId') && res.data.length > 1) { |
|
|
|
|
|
tt.setStorageSync('mallTenantId', res.data[0].tenantId) |
|
|
|
|
|
tt.setStorageSync('mallIndex', 0) |
|
|
|
|
|
} |
|
|
|
|
|
const locationSwitch = tt.getStorageSync('locationSwitch'); |
|
|
|
|
|
if (locationSwitch) { |
|
|
|
|
|
this.getLocation() |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}).catch(err => { |
|
|
}).catch(err => { |
|
|
console.log(err, 'err'); |
|
|
console.log(err, 'err'); |
|
|
}) |
|
|
}) |
|
@@ -193,7 +221,7 @@ Page({ |
|
|
url: config.api.businessList, |
|
|
url: config.api.businessList, |
|
|
data: { |
|
|
data: { |
|
|
filter: 2, |
|
|
filter: 2, |
|
|
mallTenantId: this.data.mallTenantId, |
|
|
|
|
|
|
|
|
mallTenantId: this.data.mallTenantId || that.data.scanInTenantId || "", |
|
|
} |
|
|
} |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
this.setData({ |
|
|
this.setData({ |
|
@@ -225,7 +253,7 @@ Page({ |
|
|
pageNum: that.data.businePageNum, |
|
|
pageNum: that.data.businePageNum, |
|
|
pageSize: 6, |
|
|
pageSize: 6, |
|
|
targetAd: 101, |
|
|
targetAd: 101, |
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || "" |
|
|
|
|
|
|
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || that.data.scanInTenantId || "" |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
param = { |
|
|
param = { |
|
@@ -233,7 +261,7 @@ Page({ |
|
|
pageSize: 6, |
|
|
pageSize: 6, |
|
|
business: key, |
|
|
business: key, |
|
|
targetAd: 101, |
|
|
targetAd: 101, |
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || "" |
|
|
|
|
|
|
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || that.data.scanInTenantId || "" |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@@ -583,6 +611,13 @@ Page({ |
|
|
const locationSwitch = options.type || '' |
|
|
const locationSwitch = options.type || '' |
|
|
tt.setStorageSync('locationSwitch', locationSwitch); |
|
|
tt.setStorageSync('locationSwitch', locationSwitch); |
|
|
|
|
|
|
|
|
|
|
|
if (options.tenantId) { |
|
|
|
|
|
that.setData({ |
|
|
|
|
|
scanIn: true, |
|
|
|
|
|
scanInTenantId: options.tenantId |
|
|
|
|
|
}) |
|
|
|
|
|
console.log(that.data.scanInTenantId, 'scanInTenantId'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let openId = tt.getStorageSync('openId') |
|
|
let openId = tt.getStorageSync('openId') |
|
|
if (tt.getStorageSync('options')) { |
|
|
if (tt.getStorageSync('options')) { |
|
@@ -1216,7 +1251,7 @@ Page({ |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 7, |
|
|
pageSize: 7, |
|
|
plat: 3, |
|
|
plat: 3, |
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || "" |
|
|
|
|
|
|
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || that.data.scanInTenantId || "" |
|
|
} |
|
|
} |
|
|
}).then(res => { |
|
|
}).then(res => { |
|
|
that.getmemberId(app.globalData.token); |
|
|
that.getmemberId(app.globalData.token); |
|
|