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> <template>
<div class="goods-bottom"> <div class="goods-bottom">
<template v-if="status == 1"> <template v-if="status == 1">
<template v-if="!groupId"> <template v-if="groupId">
<cr-button <template v-if="info.groupBuyInfo.groupStatus == 2 || info.groupBuyInfo.groupStatus == 3">
shape="circle" <cr-button
:disabled="disabled" shape="circle"
type="primary" :disabled="disabled"
block type="primary"
@click="createOrJoin(1)" block
> @click="createOrJoin(1)"
立即开团 >
</cr-button> 立即开团
</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>
<template v-else> <template v-else>
<cr-button <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" shape="circle"
:disabled="disabled" :disabled="disabled"
type="primary" type="primary"
block block
@click="createOrJoin(3)" @click="createOrJoin(1)"
> >
立即 立即
</cr-button> </cr-button>
</template> </template>
</template> </template>
<template v-else> <template v-else>
<cr-button <cr-button
v-if="info.groupBuyStatus == 1 || info.groupBuyStatus == 0" v-if="info.groupBuyStatus == 1"
shape="circle" shape="circle"
:disabled="disabled" :disabled="disabled"
type="primary" type="primary"
...@@ -106,7 +118,7 @@ export default { ...@@ -106,7 +118,7 @@ export default {
}, },
createOrJoin(mark) { createOrJoin(mark) {
// 参团 // 参团
// mark 1-> 开团 3-> 参团 2->自己做团长 // mark 1-> 开团 0-> 参团 2->自己做团长
this.$emit('buy', mark); this.$emit('buy', mark);
} }
} }
......
...@@ -269,7 +269,6 @@ export default { ...@@ -269,7 +269,6 @@ export default {
}) })
}, },
created() { created() {
console.log(this.$route);
this.hasLogin = localStorage.get('vccToken') ? true : false; this.hasLogin = localStorage.get('vccToken') ? true : false;
this.detailParam = { ...this.$route.query }; this.detailParam = { ...this.$route.query };
localStorage.remove('orderData'); localStorage.remove('orderData');
...@@ -373,6 +372,15 @@ export default { ...@@ -373,6 +372,15 @@ export default {
const [res] = await goods.detailInfo(detailParam); const [res] = await goods.detailInfo(detailParam);
// canJoinGroupBuyAgain groupStatus // canJoinGroupBuyAgain groupStatus
try { 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.imgList = res.imageUrl || [];
this.detailInfo = res; this.detailInfo = res;
this.setStartStatus(res); this.setStartStatus(res);
......
...@@ -99,7 +99,13 @@ ...@@ -99,7 +99,13 @@
/> />
</div> </div>
</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> </div>
</template> </template>
<script> <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