Commit c9da01dd authored by Xuguangxing's avatar Xuguangxing

fix

parent e353a38d
...@@ -279,7 +279,7 @@ export default { ...@@ -279,7 +279,7 @@ export default {
localStorage.remove('orderData'); localStorage.remove('orderData');
localStorage.set('templateId', this.detailParam.templateId); // 设置活动模板id,用于下单 localStorage.set('templateId', this.detailParam.templateId); // 设置活动模板id,用于下单
if (this.detailParam.groupBuyGroupId) { if (this.detailParam.groupBuyGroupId) {
localStorage.set('groupBuyGroupId', this.detailParam.groupBuyGroupId); // 设置groupBuyGroupId,用于下单 // localStorage.set('groupBuyGroupId', this.detailParam.groupBuyGroupId); // 设置groupBuyGroupId,用于下单
this.groupId = +this.detailParam.groupBuyGroupId; this.groupId = +this.detailParam.groupBuyGroupId;
} else { } else {
localStorage.remove('groupBuyGroupId'); localStorage.remove('groupBuyGroupId');
...@@ -369,7 +369,7 @@ export default { ...@@ -369,7 +369,7 @@ export default {
sku_no: this.detailInfo.skuNo, sku_no: this.detailInfo.skuNo,
buttons_name: buttonNameMap[res] buttons_name: buttonNameMap[res]
}); });
this.toOrder(); this.toOrder(res);
}, },
setStartStatus(data) { setStartStatus(data) {
const currentTime = new Date(data.currentTime.replace(/\-/g, '/')).getTime(); const currentTime = new Date(data.currentTime.replace(/\-/g, '/')).getTime();
...@@ -403,7 +403,7 @@ export default { ...@@ -403,7 +403,7 @@ export default {
// canJoinGroupBuyAgain groupStatus // canJoinGroupBuyAgain groupStatus
try { try {
if (res.groupBuyInfo?.groupId) { if (res.groupBuyInfo?.groupId) {
localStorage.set('groupBuyGroupId', res.groupBuyInfo.groupId || ''); // 设置groupBuyGroupId,用于下单 // localStorage.set('groupBuyGroupId', res.groupBuyInfo.groupId || ''); // 设置groupBuyGroupId,用于下单
this.groupId = +res.groupBuyInfo.groupId || 0; this.groupId = +res.groupBuyInfo.groupId || 0;
} }
if (res.groupBuyInfo?.joinGroup) { if (res.groupBuyInfo?.joinGroup) {
...@@ -494,7 +494,7 @@ export default { ...@@ -494,7 +494,7 @@ export default {
this.show = false; this.show = false;
this.$router.push({ name: 'addressManage' }); this.$router.push({ name: 'addressManage' });
}, },
toOrder() { toOrder(type) {
if (!this.hasLogin) { if (!this.hasLogin) {
this.checkLogin(); this.checkLogin();
return; return;
...@@ -518,7 +518,20 @@ export default { ...@@ -518,7 +518,20 @@ export default {
}; };
localStorage.set('orderData', order); localStorage.set('orderData', order);
localStorage.remove('addressList'); localStorage.remove('addressList');
this.$router.push({ name: 'createOrder' });
// const buttonNameMap = {
// 3: '立即参团',
// 1: '立即开团',
// 2: '自己做团长'
// };
const query = {};
if (type == 3) {
query.groupBuyGroupId = this.groupId;
}
this.$router.push({
name: 'createOrder',
query
});
}, },
changeAddress(address) { changeAddress(address) {
// 选取规格需要清空,init会重新赋值 // 选取规格需要清空,init会重新赋值
......
...@@ -165,7 +165,7 @@ export default { ...@@ -165,7 +165,7 @@ export default {
this.detailParam = { ...this.$route.query }; this.detailParam = { ...this.$route.query };
localStorage.set('templateId', this.detailParam.templateId); // 设置活动模板id,用于下单 localStorage.set('templateId', this.detailParam.templateId); // 设置活动模板id,用于下单
if (this.detailParam.groupBuyGroupId) { if (this.detailParam.groupBuyGroupId) {
localStorage.set('groupBuyGroupId', this.detailParam.groupBuyGroupId); // 设置groupBuyGroupId,用于下单 // localStorage.set('groupBuyGroupId', this.detailParam.groupBuyGroupId); // 设置groupBuyGroupId,用于下单
this.groupId = +this.detailParam.groupBuyGroupId; this.groupId = +this.detailParam.groupBuyGroupId;
} else { } else {
localStorage.remove('groupBuyGroupId'); localStorage.remove('groupBuyGroupId');
...@@ -211,7 +211,7 @@ export default { ...@@ -211,7 +211,7 @@ export default {
async init(detailParam) { async init(detailParam) {
const [res] = await goods.detailInfo(detailParam); const [res] = await goods.detailInfo(detailParam);
if (res.groupBuyInfo.groupId) { if (res.groupBuyInfo.groupId) {
localStorage.set('groupBuyGroupId', res.groupBuyInfo.groupId || ''); // 设置groupBuyGroupId,用于下单 // localStorage.set('groupBuyGroupId', res.groupBuyInfo.groupId || ''); // 设置groupBuyGroupId,用于下单
this.groupId = +res.groupBuyInfo.groupId || ''; this.groupId = +res.groupBuyInfo.groupId || '';
} }
if (res.saleCount && res.activitySkuTotalCount) { if (res.saleCount && res.activitySkuTotalCount) {
......
...@@ -100,6 +100,10 @@ export default { ...@@ -100,6 +100,10 @@ export default {
created() { created() {
if (isApp) this.nativeBridge = new Bridge(); if (isApp) this.nativeBridge = new Bridge();
else if (isWxMp) this.nativeBridge = new MpBridge(); else if (isWxMp) this.nativeBridge = new MpBridge();
const groupId = this.$route.query.groupBuyGroupId;
if (this.$route.query.groupBuyGroupId) {
localStorage.set('groupBuyGroupId', groupId);
}
}, },
methods: { methods: {
init() { init() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment