From 0ec4be8bd8f237b0d6704d6d56cc22ad2e7e0909 Mon Sep 17 00:00:00 2001
From: XiaoXinPro 14 IAH5R <568170040@qq.com>
Date: Tue, 21 Feb 2023 18:13:24 +0800
Subject: [PATCH] upload
---
index/index.js | 2 ++
index/index.ttml | 2 ++
pages/index/searchbar/detail/index.js | 13 +++++++++++--
pages/liveLsit/liveLsit.js | 27 +++++++++++++++++++--------
pages/liveLsit/liveLsit.ttml | 15 +++++++--------
pages/main/index.js | 6 ++++--
project.config.json | 13 +++++++++++--
7 files changed, 56 insertions(+), 22 deletions(-)
diff --git a/index/index.js b/index/index.js
index d9f8b79..2700106 100644
--- a/index/index.js
+++ b/index/index.js
@@ -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)
})
diff --git a/index/index.ttml b/index/index.ttml
index 40e707d..de33a27 100644
--- a/index/index.ttml
+++ b/index/index.ttml
@@ -24,6 +24,8 @@
{{ shopList[index].name }}
+ {{
+ shopList[index].distance_str}}
diff --git a/pages/index/searchbar/detail/index.js b/pages/index/searchbar/detail/index.js
index 47af965..672c935 100644
--- a/pages/index/searchbar/detail/index.js
+++ b/pages/index/searchbar/detail/index.js
@@ -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
})
diff --git a/pages/liveLsit/liveLsit.js b/pages/liveLsit/liveLsit.js
index e149408..b6a6272 100644
--- a/pages/liveLsit/liveLsit.js
+++ b/pages/liveLsit/liveLsit.js
@@ -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("我到底了")
diff --git a/pages/liveLsit/liveLsit.ttml b/pages/liveLsit/liveLsit.ttml
index b9ad35b..4f2f511 100644
--- a/pages/liveLsit/liveLsit.ttml
+++ b/pages/liveLsit/liveLsit.ttml
@@ -1,11 +1,10 @@
-
+
-
-
+
@@ -13,7 +12,7 @@
讲解中
{{index+1}}
-
+
{{item.title}}
@@ -35,9 +34,9 @@
-
-
-
+
+
+
@@ -45,7 +44,7 @@
我的订单
-
+
点击刷新
没有更多
\ No newline at end of file
diff --git a/pages/main/index.js b/pages/main/index.js
index b44df8e..9f3ae51 100644
--- a/pages/main/index.js
+++ b/pages/main/index.js
@@ -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}`
});
}
// 参与砍价
diff --git a/project.config.json b/project.config.json
index b953902..5be4479 100644
--- a/project.config.json
+++ b/project.config.json
@@ -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"
}
]
}