|
|
@@ -145,6 +145,7 @@ Page({ |
|
|
|
Http.get({ |
|
|
|
url: '/mall/subMall?isAll=1', |
|
|
|
}).then(res => { |
|
|
|
tt.setStorageSync('shopList', JSON.stringify(res.data)); |
|
|
|
this.setData({ |
|
|
|
shopList: res.data, |
|
|
|
mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId |
|
|
@@ -153,6 +154,7 @@ Page({ |
|
|
|
tt.setStorageSync('mallTenantId', res.data[0].tenantId) |
|
|
|
tt.setStorageSync('mallIndex', 0) |
|
|
|
} |
|
|
|
this.getLocation() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err, 'err'); |
|
|
|
}) |
|
|
@@ -170,7 +172,7 @@ Page({ |
|
|
|
}); |
|
|
|
this.getBannerlist(); |
|
|
|
this.getBusinessList() |
|
|
|
this.getCouponChannelList(0) |
|
|
|
this.getCouponChannelList(this.data.busineKye) |
|
|
|
}, |
|
|
|
|
|
|
|
getBusineData(e) { |
|
|
@@ -256,12 +258,15 @@ Page({ |
|
|
|
businessData: data |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.setData({ |
|
|
|
noDataFlag: true |
|
|
|
// noDataFlag: true, |
|
|
|
businessData: [] |
|
|
|
}) |
|
|
|
} |
|
|
|
tt.hideLoading(); |
|
|
|
console.log(this.data.businessData, 'businessData'); |
|
|
|
}).catch(err => { |
|
|
|
tt.hideLoading(); |
|
|
|
tt.showModal({ |
|
|
@@ -590,12 +595,12 @@ Page({ |
|
|
|
//获取条形码 |
|
|
|
// util.barcode("barcode", optionss.quancode, 510, 100); |
|
|
|
// console.log(Http.headers.token, "?") |
|
|
|
this.getLocation() |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 获得经纬度 |
|
|
|
*/ |
|
|
|
getLocation() { |
|
|
|
console.log('getLocation'); |
|
|
|
let that = this; |
|
|
|
tt.getLocation({ |
|
|
|
type: "wgs84", |
|
|
@@ -618,6 +623,7 @@ Page({ |
|
|
|
city: res.city |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
this.getsubMallList() |
|
|
|
console.log(res, 9999) |
|
|
|
}) |
|
|
|
} |
|
|
@@ -632,7 +638,9 @@ Page({ |
|
|
|
|
|
|
|
const mallLocationArr = [] |
|
|
|
|
|
|
|
that.data.shopList.forEach((item, index) => { |
|
|
|
const shopList = JSON.parse(tt.getStorageSync('shopList')); |
|
|
|
|
|
|
|
shopList.forEach((item, index) => { |
|
|
|
const obj = { |
|
|
|
latitude: item.latitude, |
|
|
|
longitude: item.longitude, |
|
|
@@ -642,11 +650,14 @@ Page({ |
|
|
|
mallLocationArr.push(obj) |
|
|
|
}) |
|
|
|
|
|
|
|
const tempArr = that.data.shopList |
|
|
|
console.log(mallLocationArr, 'mallLocationArr'); |
|
|
|
|
|
|
|
const tempArr = shopList |
|
|
|
const bloobArr = [] |
|
|
|
mallLocationArr.forEach((item, index) => { |
|
|
|
const distanceData = that.getDistances(latitudeNow, longitudeNow, item.latitude, item.longitude) |
|
|
|
tempArr[index].distance_str = distanceData.distance_str |
|
|
|
|
|
|
|
tempArr[index].distance = distanceData.distance |
|
|
|
bloobArr.push(distanceData.distance) |
|
|
|
}) |
|
|
@@ -718,6 +729,7 @@ Page({ |
|
|
|
|
|
|
|
|
|
|
|
onShow: function () { |
|
|
|
|
|
|
|
this.mallSync() |
|
|
|
console.log(app.globalData.mouldType, "mouldType") |
|
|
|
// tt.requestSubscribeMessage({ |
|
|
|