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