|
@@ -4,6 +4,7 @@
|
|
|
展示商品信息、活动规则(land.desc)、商品详情图文(picTextGoods)、开团玩法、底部操作
|
|
展示商品信息、活动规则(land.desc)、商品详情图文(picTextGoods)、开团玩法、底部操作
|
|
|
开团/参团先跳混合结算页选配送方式(含跑腿),提交后再创建团购单
|
|
开团/参团先跳混合结算页选配送方式(含跑腿),提交后再创建团购单
|
|
|
未登录可浏览:仅开团/参团/邀请好友时弹 wangCg;单独购买不弹(进商品详情)
|
|
未登录可浏览:仅开团/参团/邀请好友时弹 wangCg;单独购买不弹(进商品详情)
|
|
|
|
|
+ 登录态落地/详情会回填 hdId 到本地,避免带着旧店 hdId 被后端清空门店
|
|
|
-->
|
|
-->
|
|
|
<template>
|
|
<template>
|
|
|
<view class="group-buy-detail-page">
|
|
<view class="group-buy-detail-page">
|
|
@@ -291,18 +292,27 @@ export default {
|
|
|
this.myCustomId = Number(data.custom.id)
|
|
this.myCustomId = Number(data.custom.id)
|
|
|
}
|
|
}
|
|
|
if (data && data.hd && (data.hd.id || data.hd.hdId)) {
|
|
if (data && data.hd && (data.hd.id || data.hd.hdId)) {
|
|
|
- const hdId = Number(data.hd.id || data.hd.hdId) || 0
|
|
|
|
|
- if (hdId > 0) {
|
|
|
|
|
- uni.setStorageSync('hdId', hdId)
|
|
|
|
|
- if (!this.option) {
|
|
|
|
|
- this.option = {}
|
|
|
|
|
- }
|
|
|
|
|
- this.$set(this.option, 'hdId', hdId)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.cacheBoundHdId(data.hd.id || data.hd.hdId)
|
|
|
}
|
|
}
|
|
|
this.init()
|
|
this.init()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 把当前门店 hdId 写入页面 option 和本地缓存。
|
|
|
|
|
+ * 分享进店不带 hdId、拦截器会拼旧店 hdId,必须用接口回填的新值覆盖,后续开团/参团才不会被后端清空门店。
|
|
|
|
|
+ * @param {string|number} hdId 当前门店 xhHd.id
|
|
|
|
|
+ */
|
|
|
|
|
+ cacheBoundHdId(hdId) {
|
|
|
|
|
+ const id = Number(hdId) || 0
|
|
|
|
|
+ if (id <= 0) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ uni.setStorageSync('hdId', id)
|
|
|
|
|
+ if (!this.option) {
|
|
|
|
|
+ this.option = {}
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$set(this.option, 'hdId', id)
|
|
|
|
|
+ },
|
|
|
init() {
|
|
init() {
|
|
|
uni.showLoading({ title: '加载中', mask: true })
|
|
uni.showLoading({ title: '加载中', mask: true })
|
|
|
const tasks = []
|
|
const tasks = []
|
|
@@ -327,12 +337,7 @@ export default {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (res.code === 1 && res.data) {
|
|
if (res.code === 1 && res.data) {
|
|
|
- // 分享进页无 hdId,接口回填后需 $set 保证 Vue2 响应式,供 goPay/跳转使用
|
|
|
|
|
- if (res.data.hdId) {
|
|
|
|
|
- uni.setStorageSync('hdId', res.data.hdId)
|
|
|
|
|
- if (!this.option) this.option = {}
|
|
|
|
|
- this.$set(this.option, 'hdId', res.data.hdId)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this.cacheBoundHdId(res.data.hdId)
|
|
|
this.applyGroupDetail(res.data)
|
|
this.applyGroupDetail(res.data)
|
|
|
// 分享进入时若无 goodsId,用团上的商品再拉落地信息补全详情图
|
|
// 分享进入时若无 goodsId,用团上的商品再拉落地信息补全详情图
|
|
|
if (!this.goodsId && res.data.goodsId) {
|
|
if (!this.goodsId && res.data.goodsId) {
|
|
@@ -372,6 +377,7 @@ export default {
|
|
|
/** 应用落地页数据;keepOpenGroup=true 时保留分享带来的团信息 */
|
|
/** 应用落地页数据;keepOpenGroup=true 时保留分享带来的团信息 */
|
|
|
applyLanding(data, keepOpenGroup) {
|
|
applyLanding(data, keepOpenGroup) {
|
|
|
if (!data) return
|
|
if (!data) return
|
|
|
|
|
+ this.cacheBoundHdId(data.hdId)
|
|
|
this.goods = {
|
|
this.goods = {
|
|
|
activityGoodsId: data.activityGoodsId,
|
|
activityGoodsId: data.activityGoodsId,
|
|
|
goodsId: data.goodsId,
|
|
goodsId: data.goodsId,
|
|
@@ -418,6 +424,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
applyGroupDetail(data) {
|
|
applyGroupDetail(data) {
|
|
|
if (!data) return
|
|
if (!data) return
|
|
|
|
|
+ this.cacheBoundHdId(data.hdId)
|
|
|
this.groupBuyId = data.id
|
|
this.groupBuyId = data.id
|
|
|
this.openGroup = data
|
|
this.openGroup = data
|
|
|
if (data.goods) {
|
|
if (data.goods) {
|
|
@@ -516,11 +523,7 @@ export default {
|
|
|
uni.setStorageSync('account', account)
|
|
uni.setStorageSync('account', account)
|
|
|
return getHdInfo().then((res) => {
|
|
return getHdInfo().then((res) => {
|
|
|
if (res.code == 1 && res.data.hd && res.data.hd.id) {
|
|
if (res.code == 1 && res.data.hd && res.data.hd.id) {
|
|
|
- uni.setStorageSync('hdId', res.data.hd.id)
|
|
|
|
|
- if (!this.option) {
|
|
|
|
|
- this.option = {}
|
|
|
|
|
- }
|
|
|
|
|
- this.$set(this.option, 'hdId', res.data.hd.id)
|
|
|
|
|
|
|
+ this.cacheBoundHdId(res.data.hd.id)
|
|
|
return fetchCustomId(res.data.hd.id)
|
|
return fetchCustomId(res.data.hd.id)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|