Commit b88907fc authored by beisir's avatar beisir

Merge branch 'feat/group-buy' of git.quantgroup.cn:ui/group-buy-ui into feat/group-buy

parents 6463248d 35c3de61
<template>
<div class="goods-bottom">
<template v-if="status == 1">
<template v-if="!groupId">
<cr-button
shape="circle"
:disabled="disabled"
type="primary"
block
@click="createOrJoin(1)"
>
立即开团
</cr-button>
<template v-if="groupId">
<template v-if="info.groupBuyInfo.groupStatus == 2 || info.groupBuyInfo.groupStatus == 3">
<cr-button
shape="circle"
:disabled="disabled"
type="primary"
block
@click="createOrJoin(1)"
>
立即开团
</cr-button>
</template>
<template v-else>
<cr-button
class="mutiplie"
plain
type="primary"
shape="circle"
:disabled="disabled"
@click="createOrJoin(2)"
>自己做团长</cr-button
>
<cr-button
v-if="!info.joinGroup"
class="mutiplie"
shape="circle"
:disabled="disabled"
type="primary"
block
@click="createOrJoin(3)"
>
立即参团
</cr-button>
</template>
</template>
<template v-else>
<cr-button
class="mutiplie"
plain
type="primary"
shape="circle"
:disabled="disabled"
@click="createOrJoin(2)"
>自己做团长</cr-button
>
<!-- canJoinGroupBuyAgain -> 是否可以参团 groupBuyStatus 1->拼团中 -->
<cr-button
v-if="info.canJoinGroupBuyAgain && info.groupBuyStatus == 1"
class="mutiplie"
shape="circle"
:disabled="disabled"
type="primary"
block
@click="createOrJoin(3)"
@click="createOrJoin(1)"
>
立即
立即
</cr-button>
</template>
</template>
<template v-else>
<cr-button
v-if="info.groupBuyStatus == 1 || info.groupBuyStatus == 0"
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