Browse Source

upload

soldDate
HolyKnightIX 2 years ago
parent
commit
7b86d105b0
4 changed files with 30 additions and 10 deletions
  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 View File

@@ -145,6 +145,7 @@ 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));
this.setData({ this.setData({
shopList: res.data, shopList: res.data,
mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId mallTenantId: tt.getStorageSync('mallTenantId') || res.data[0].tenantId
@@ -153,6 +154,7 @@ Page({
tt.setStorageSync('mallTenantId', res.data[0].tenantId) tt.setStorageSync('mallTenantId', res.data[0].tenantId)
tt.setStorageSync('mallIndex', 0) tt.setStorageSync('mallIndex', 0)
} }
this.getLocation()
}).catch(err => { }).catch(err => {
console.log(err, 'err'); console.log(err, 'err');
}) })
@@ -170,7 +172,7 @@ Page({
}); });
this.getBannerlist(); this.getBannerlist();
this.getBusinessList() this.getBusinessList()
this.getCouponChannelList(0)
this.getCouponChannelList(this.data.busineKye)
}, },


getBusineData(e) { getBusineData(e) {
@@ -256,12 +258,15 @@ Page({
businessData: data businessData: data
}) })
} }

} else { } else {
this.setData({ this.setData({
noDataFlag: true
// noDataFlag: true,
businessData: []
}) })
} }
tt.hideLoading(); tt.hideLoading();
console.log(this.data.businessData, 'businessData');
}).catch(err => { }).catch(err => {
tt.hideLoading(); tt.hideLoading();
tt.showModal({ tt.showModal({
@@ -590,12 +595,12 @@ Page({
//获取条形码 //获取条形码
// util.barcode("barcode", optionss.quancode, 510, 100); // util.barcode("barcode", optionss.quancode, 510, 100);
// console.log(Http.headers.token, "?") // console.log(Http.headers.token, "?")
this.getLocation()
}, },
/** /**
* 获得经纬度 * 获得经纬度
*/ */
getLocation() { getLocation() {
console.log('getLocation');
let that = this; let that = this;
tt.getLocation({ tt.getLocation({
type: "wgs84", type: "wgs84",
@@ -618,6 +623,7 @@ Page({
city: res.city city: res.city
} }
}).then(res => { }).then(res => {
this.getsubMallList()
console.log(res, 9999) console.log(res, 9999)
}) })
} }
@@ -632,7 +638,9 @@ Page({


const mallLocationArr = [] const mallLocationArr = []


that.data.shopList.forEach((item, index) => {
const shopList = JSON.parse(tt.getStorageSync('shopList'));

shopList.forEach((item, index) => {
const obj = { const obj = {
latitude: item.latitude, latitude: item.latitude,
longitude: item.longitude, longitude: item.longitude,
@@ -642,11 +650,14 @@ Page({
mallLocationArr.push(obj) mallLocationArr.push(obj)
}) })


const tempArr = that.data.shopList
console.log(mallLocationArr, 'mallLocationArr');

const tempArr = shopList
const bloobArr = [] const bloobArr = []
mallLocationArr.forEach((item, index) => { mallLocationArr.forEach((item, index) => {
const distanceData = that.getDistances(latitudeNow, longitudeNow, item.latitude, item.longitude) const distanceData = that.getDistances(latitudeNow, longitudeNow, item.latitude, item.longitude)
tempArr[index].distance_str = distanceData.distance_str tempArr[index].distance_str = distanceData.distance_str

tempArr[index].distance = distanceData.distance tempArr[index].distance = distanceData.distance
bloobArr.push(distanceData.distance) bloobArr.push(distanceData.distance)
}) })
@@ -718,6 +729,7 @@ Page({




onShow: function () { onShow: function () {

this.mallSync() this.mallSync()
console.log(app.globalData.mouldType, "mouldType") console.log(app.globalData.mouldType, "mouldType")
// tt.requestSubscribeMessage({ // tt.requestSubscribeMessage({


+ 2
- 2
index/index.ttml View File

@@ -24,8 +24,8 @@
<view> <view>
<image src="../assets/images/location.png" class="location"></image> <image src="../assets/images/location.png" class="location"></image>
<text class="mallName">{{ shopList[index].name }}</text> <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> <image src="../assets/itemImg/arrow-right-l.png" class="right"></image>
</view> </view>
</view> </view>


+ 9
- 2
pages/couponorder/detail/index.js View File

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


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

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


+ 2
- 1
pages/order/detail/index.js View File

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


Loading…
Cancel
Save