Commit a00678f5 authored by Xuguangxing's avatar Xuguangxing

feat: 修复订单详情的状态展示

parent ec1a581f
<template>
<div class="goods-bottom">
<template v-if="status == 1">
<template v-if="!groupId">
<template v-if="groupId">
<template v-if="info.groupBuyInfo.groupStatus == 2 || info.groupBuyInfo.groupStatus == 3">
<cr-button
shape="circle"
:disabled="disabled"
......@@ -22,9 +23,8 @@
@click="createOrJoin(2)"
>自己做团长</cr-button
>
<!-- canJoinGroupBuyAgain -> 是否可以参团 groupBuyStatus 1->拼团中 -->
<cr-button
v-if="info.canJoinGroupBuyAgain && info.groupBuyStatus == 1"
v-if="!info.joinGroup"
class="mutiplie"
shape="circle"
:disabled="disabled"
......@@ -38,7 +38,19 @@
</template>
<template v-else>
<cr-button
v-if="info.groupBuyStatus == 1 || info.groupBuyStatus == 0"
shape="circle"
:disabled="disabled"
type="primary"
block
@click="createOrJoin(1)"
>
立即开团
</cr-button>
</template>
</template>
<template v-else>
<cr-button
v-if="info.groupBuyStatus == 1"
shape="circle"
:disabled="disabled"
type="primary"
......@@ -106,7 +118,7 @@ export default {
},
createOrJoin(mark) {
// 参团
// mark 1-> 开团 3-> 参团 2->自己做团长
// mark 1-> 开团 0-> 参团 2->自己做团长
this.$emit('buy', mark);
}
}
......
......@@ -269,7 +269,6 @@ export default {
})
},
created() {
console.log(this.$route);
this.hasLogin = localStorage.get('vccToken') ? true : false;
this.detailParam = { ...this.$route.query };
localStorage.remove('orderData');
......@@ -373,6 +372,15 @@ export default {
const [res] = await goods.detailInfo(detailParam);
// canJoinGroupBuyAgain groupStatus
try {
if (res.groupBuyInfo?.groupId) {
localStorage.set('groupBuyGroupId', res.groupBuyInfo.groupId || ''); // 设置groupBuyGroupId,用于下单
this.groupId = +res.groupBuyInfo.groupId || 0;
}
if (res.groupBuyInfo?.joinGroup) {
// 如果当前用户参了团到拼团详情
const query = { ...this.$route.query };
return this.$router.replace({ name: 'groupBuySkuInfoSmallPic', query });
}
this.imgList = res.imageUrl || [];
this.detailInfo = res;
this.setStartStatus(res);
......
......@@ -99,7 +99,13 @@
/>
</div>
</div>
<bottom-nav v-if="showButtonNav" :status="2" :disabled="false" @share="setShareData" />
<bottom-nav
v-if="showButtonNav"
:info="detailInfo.groupBuyInfo || {}"
:status="2"
:disabled="false"
@share="setShareData"
/>
</div>
</template>
<script>
......
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