HolyKnightIX пре 2 година
родитељ
комит
7b86d105b0
4 измењених фајлова са 30 додато и 10 уклоњено
  1. +17
    -5
      index/index.js
  2. +2
    -2
      index/index.ttml
  3. +9
    -2
      pages/couponorder/detail/index.js
  4. +2
    -1
      pages/order/detail/index.js

+ 17
- 5
index/index.js Прегледај датотеку

@@ -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({


+ 2
- 2
index/index.ttml Прегледај датотеку

@@ -24,8 +24,8 @@
<view>
<image src="../assets/images/location.png" class="location"></image>
<text class="mallName">{{ shopList[index].name }}</text>
<!-- <text class="distance_str" wx:if="{{shopList[index].distance_str}}}">距您{{
shopList[index].distance_str}}</text> -->
<text class="distance_str" wx:if="{{shopList[index].distance_str}}}">距您{{
shopList[index].distance_str}}</text>
<image src="../assets/itemImg/arrow-right-l.png" class="right"></image>
</view>
</view>


+ 9
- 2
pages/couponorder/detail/index.js Прегледај датотеку

@@ -29,7 +29,8 @@ Page({
templTiem: "",
curHtml: "",
tenantId: '',
mallList: ''
mallList: '',
mallTenantId: ""
},
showId() {
let this_ = this;
@@ -65,7 +66,7 @@ Page({
//获取适用门店
getCouponMerchant(couponId) {
Http.get({
url: `/wxCoupon/couponMerchantByCouponId?couponId=${couponId}`,
url: `/wxCoupon/couponMerchantByCouponId?couponId=${couponId}&mallTenantId=${this.data.mallTenantId || ''}`,
}).then(res => {
const keys = Object.keys(res.data)
const mallList = []
@@ -124,6 +125,12 @@ Page({
that.setRq() //动态二维码 //这个方法必须在拿到 options.quancode 后调用
}

if (options.mallTenantId) {
that.setData({
mallTenantId: options.mallTenantId
})
}

//初始数据不能延时收到写一边
Http.get({
url: config.api.couponOrderDetail,


+ 2
- 1
pages/order/detail/index.js Прегледај датотеку

@@ -157,7 +157,8 @@ Page({
Http.get({
url: config.api.couponMerchant,
data: {
couponChannelId: couponChannelId
couponChannelId: couponChannelId,
mallTenantId: this.data.mallTenantId || ''
}
}).then(res => {
const keys = Object.keys(res.data)


Loading…
Откажи
Сачувај