@@ -626,6 +626,7 @@ Page({ | |||
console.log(error); | |||
}, | |||
complete: finish => { | |||
// 获取到的用户的坐标 | |||
const latitudeNow = that.data.locateData.latitude | |||
const longitudeNow = that.data.locateData.longitude | |||
@@ -645,6 +646,7 @@ Page({ | |||
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) | |||
}) | |||
@@ -24,6 +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> | |||
<image src="../assets/itemImg/arrow-right-l.png" class="right"></image> | |||
</view> | |||
</view> | |||
@@ -48,13 +48,22 @@ Page({ | |||
* 生命周期函数--监听页面加载 | |||
*/ | |||
onLoad: function (options) { | |||
console.log(options, 'options'); | |||
let that = this; | |||
if (options && options.id) { | |||
this.setData({ | |||
id: options.id | |||
}); | |||
that.getList(options.id, options.mallTenantId); | |||
that.getCouponList(options.id, options.mallTenantId); | |||
const tenantId = options.tenantId | |||
if (tenantId) { | |||
that.getList(options.id, tenantId); | |||
that.getCouponList(options.id, tenantId); | |||
tt.setStorageSync('mallTenantId', tenantId); | |||
} else { | |||
that.getList(options.id, options.mallTenantId); | |||
that.getCouponList(options.id, options.mallTenantId); | |||
} | |||
this.setData({ | |||
currentTab: 0 | |||
}) | |||
@@ -15,6 +15,7 @@ Page({ | |||
businePageNum: 1, | |||
businessData: null, | |||
Lsit: [], | |||
mallTenantId: '', | |||
}, | |||
goOrder() { | |||
tt.navigateTo({ | |||
@@ -40,15 +41,16 @@ Page({ | |||
param = { | |||
pageNum: this.data.businePageNum, | |||
pageSize: 6, | |||
targetAd: 101 | |||
targetAd: 101, | |||
mallTenantId: this.data.mallTenantId | |||
} | |||
} else { | |||
param = { | |||
pageNum: this.data.businePageNum, | |||
pageSize: 6, | |||
business: key, | |||
targetAd: 101 | |||
targetAd: 101, | |||
mallTenantId: this.data.mallTenantId | |||
} | |||
} | |||
Http.get({ | |||
@@ -103,15 +105,16 @@ Page({ | |||
param = { | |||
pageNum: this.data.businePageNum, | |||
pageSize: 6, | |||
targetAd: 101 | |||
targetAd: 101, | |||
mallTenantId: this.data.mallTenantId | |||
} | |||
} else { | |||
param = { | |||
pageNum: this.data.businePageNum, | |||
pageSize: 6, | |||
business: key, | |||
targetAd: 101 | |||
targetAd: 101, | |||
mallTenantId: this.data.mallTenantId | |||
} | |||
} | |||
Http.get({ | |||
@@ -175,7 +178,8 @@ Page({ | |||
Http.get({ | |||
url: config.api.batchCouponPriceAndStock, | |||
data: { | |||
couponChannelIds: str | |||
couponChannelIds: str, | |||
mallTenantId: this.data.mallTenantId | |||
} | |||
}).then(res => { | |||
console.log(JSON.parse(res.data)); | |||
@@ -205,16 +209,23 @@ Page({ | |||
}) | |||
}, | |||
goDetail(e) { | |||
console.log(e, 'e'); | |||
let couponChannelId = e.currentTarget.dataset.id | |||
let couponId = e.currentTarget.dataset.couponid | |||
let mallTenantId = this.data.mallTenantId | |||
tt.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | |||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}&mallTenantId=${mallTenantId}`, | |||
}) | |||
}, | |||
onLoad: function (options) { | |||
//固定写法 放在指定要手机号授权框出现 | |||
// app.globalData.ifCongPh = 1 | |||
this.getCouponChannelList() | |||
tt.setStorageSync('mallTenantId', options.tenantId); | |||
this.setData({ | |||
mallTenantId: options.tenantId | |||
}) | |||
}, | |||
onReachBottom: function () { | |||
console.log("我到底了") | |||
@@ -1,11 +1,10 @@ | |||
<!-- <navbar home text="直播商品"></navbar> --> | |||
<!-- <view style="height:{{navigationBarHeight}};line-height: {{navLineHeight}}; " class="title">直播商品</view> --> | |||
<!-- <view style="height:{{navigationBarHeight}};"></view> --> | |||
<view class="LsitBox" > | |||
<view class="LsitBox"> | |||
<view tt:for="{{Lsit}}" bindtap="goDetail" data-couponid="{{item.couponId}}" data-id="{{item.id}}" class="wBox"> | |||
<view class="itemBox"> | |||
<view class="imgBox"> | |||
<view class="imgBox"> | |||
<image class="img" src="{{item.coverImg}}"> | |||
</image> | |||
<view class="explain" tt:if="{{index==0}}"> | |||
@@ -13,7 +12,7 @@ | |||
<view class="explainTitle">讲解中</view> | |||
</view> | |||
<view class="num">{{index+1}}</view> | |||
</view> | |||
<view class="dataBox"> | |||
<view class="titleName">{{item.title}}</view> | |||
@@ -35,9 +34,9 @@ | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="upDataBox"> | |||
@@ -45,7 +44,7 @@ | |||
<image src="../../assets/images/goOder.png" class="goOrder"></image> | |||
<view class="goOrderText">我的订单</view> | |||
</view> | |||
<view class="upData" bindtap="upDataLsit"> 点击刷新</view> | |||
</view> | |||
<view class="noDet" tt:if="{{noDataFlag}}">没有更多</view> |
@@ -65,10 +65,11 @@ Page({ | |||
app.globalData.type = options.type; | |||
if (options.type == 'cd') { | |||
options.couponChannelId = this.data.newArr[2]; | |||
options.tenantId = this.data.newArr[3]; | |||
options.tenantId = this.data.newArr[3] || ""; | |||
} else if (options.type == 'bd') { | |||
options.bt = this.data.newArr[2]; | |||
options.id = this.data.newArr[3]; | |||
options.tenantId = this.data.newArr[4] || ""; | |||
} else if (options.type == 'gm') { | |||
options.id = this.data.newArr[2]; | |||
} else if (options.type == 'sd') { | |||
@@ -79,6 +80,7 @@ Page({ | |||
} else if (options.type == 'md') { | |||
// 门店详情 | |||
options.id = this.data.newArr[2]; | |||
options.tenantId = this.data.newArr[3] || ""; | |||
} else if (options.type == 'ra') { | |||
//活动详情 | |||
options.id = this.data.newArr[2]; | |||
@@ -271,7 +273,7 @@ Page({ | |||
// 门店详情 | |||
else if (options && options.id && app.globalData.type == 'md') { | |||
tt.redirectTo({ | |||
url: `/pages/index/searchbar/detail/index?id=${options.id}` | |||
url: `/pages/index/searchbar/detail/index?id=${options.id}&tenantId=${options.tenantId}` | |||
}); | |||
} | |||
// 参与砍价 | |||
@@ -20,10 +20,10 @@ | |||
"current": -1, | |||
"list": [ | |||
{ | |||
"id": 1670551556787, | |||
"id": 1676969626961, | |||
"name": "pages/main/index", | |||
"pathName": "pages/main/index", | |||
"query": "type=cd&couponChannelId=762472141677453312&tenantId=1032", | |||
"query": "type=md&id=758855991052394496&tenantId=1032", | |||
"scene": "990001", | |||
"launchFrom": "scan", | |||
"location": "qr_code" | |||
@@ -36,6 +36,15 @@ | |||
"scene": "990001", | |||
"launchFrom": "scan", | |||
"location": "qr_code" | |||
}, | |||
{ | |||
"id": 1676971480642, | |||
"name": "pages/liveLsit/liveLsit", | |||
"pathName": "pages/liveLsit/liveLsit", | |||
"query": "tenantId=1032", | |||
"scene": "990001", | |||
"launchFrom": "scan", | |||
"location": "qr_code" | |||
} | |||
] | |||
} | |||