|
|
@@ -120,6 +120,7 @@ import {
|
|
|
createGroup,
|
|
|
joinGroup
|
|
|
} from '@/api/group-buy'
|
|
|
+import { GROUP_BUY_HD_NOT_BOUND } from '@/constant/errCode'
|
|
|
|
|
|
export default {
|
|
|
name: 'GroupBuyDetail',
|
|
|
@@ -210,7 +211,16 @@ export default {
|
|
|
uni.hideLoading()
|
|
|
if (this.groupBuyId) {
|
|
|
const res = results[0]
|
|
|
+ if (res.code === GROUP_BUY_HD_NOT_BOUND) {
|
|
|
+ this.handleHdNotBound(res)
|
|
|
+ return
|
|
|
+ }
|
|
|
if (res.code === 1 && res.data) {
|
|
|
+ // TODO: 临时处理,后续需要增加判断登录(或注册情况)
|
|
|
+ if (res.data.hdId) {
|
|
|
+ uni.setStorageSync('hdId', res.data.hdId)
|
|
|
+ this.option.hdId = res.data.hdId
|
|
|
+ }
|
|
|
this.applyGroupDetail(res.data)
|
|
|
// 分享进入时若无 goodsId,用团上的商品再拉落地信息补全详情图
|
|
|
if (!this.goodsId && res.data.goodsId) {
|
|
|
@@ -225,7 +235,9 @@ export default {
|
|
|
}
|
|
|
} else {
|
|
|
const res = results[0]
|
|
|
- if (res.code === 1 && res.data) this.applyLanding(res.data, false)
|
|
|
+ if (res.code === 1 && res.data) {
|
|
|
+ this.applyLanding(res.data, false)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
@@ -236,6 +248,13 @@ export default {
|
|
|
this.setupShare()
|
|
|
})
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 处理"客户暂无关联此店"业务码(GROUP_BUY_HD_NOT_BOUND)
|
|
|
+ * TODO: 具体引导登录/绑定关系的产品交互待定,目前仅做识别与占位
|
|
|
+ */
|
|
|
+ handleHdNotBound(res) {
|
|
|
+ this.$msg(res.msg || '客户暂无关联此店')
|
|
|
+ },
|
|
|
/** 应用落地页数据;keepOpenGroup=true 时保留分享带来的团信息 */
|
|
|
applyLanding(data, keepOpenGroup) {
|
|
|
if (!data) return
|