Commit 1aa3f3e1 authored by Xuguangxing's avatar Xuguangxing

fix: 处理按钮状态并新增按钮

parent cf969ed1
...@@ -50,25 +50,26 @@ ...@@ -50,25 +50,26 @@
</template> </template>
<template v-else> <template v-else>
<cr-button <cr-button
v-if="info.groupBuyStatus == 1" class="mutiplie"
shape="circle" shape="circle"
plain
:disabled="disabled" :disabled="disabled"
type="primary" type="primary"
block block
@click="shareTo" @click="toList"
> >
邀请好友 查看活动详情
</cr-button> </cr-button>
<cr-button <cr-button
v-if="info.groupBuyStatus != 1 && !timeIsOver" v-if="info.groupBuyStatus == 1"
class="mutiplie"
shape="circle" shape="circle"
plain
:disabled="disabled" :disabled="disabled"
type="primary" type="primary"
block block
@click="toList" @click="shareTo"
> >
查看其他商品 邀请好友
</cr-button> </cr-button>
</template> </template>
</div> </div>
...@@ -110,18 +111,9 @@ export default { ...@@ -110,18 +111,9 @@ export default {
}, },
data() { data() {
return { return {
nativeBridge: null, nativeBridge: null
timeIsOver: false
}; };
}, },
created() {
if (this.status == 2) {
// 订单详情页
const currentTime = new Date(this.currentTime.replace(/\-/g, '/')).getTime();
const endTime = new Date(this.endTime.replace(/\-/g, '/')).getTime();
this.timeIsOver = currentTime >= endTime ? true : false;
}
},
methods: { methods: {
toList() { toList() {
const { activityId } = this.$route.query || ''; const { activityId } = this.$route.query || '';
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<div class="group-info-desc"> <div class="group-info-desc">
<div class="desc-item"> <div class="desc-item">
<template v-if="groupInfo.groupBuyStatus == 1"> <template v-if="groupInfo.groupBuyStatus == 1">
<!-- 拼团中状态 -->
<template v-if="!groupInfo.joinGroup && !groupInfo.canJoinGroupBuyAgain"> <template v-if="!groupInfo.joinGroup && !groupInfo.canJoinGroupBuyAgain">
<!-- 您不符合参与此团的条件 --> <!-- 您不符合参与此团的条件 -->
</template> </template>
...@@ -14,11 +15,16 @@ ...@@ -14,11 +15,16 @@
</template> </template>
<template v-else> <template v-else>
<template v-if="groupInfo.groupBuyStatus != 2"> <template v-if="groupInfo.groupBuyStatus != 2">
<p class="desc"> <!-- 拼团非成功状态 -->
<p v-if="groupInfo.groupBuyStatus == 3" class="desc">
{{ groupInfo.groupBuyStatus.failedReason }}
</p>
<p v-else class="desc">
{{ statusTextMap[groupInfo.groupBuyStatus] }} {{ statusTextMap[groupInfo.groupBuyStatus] }}
</p> </p>
</template> </template>
<template v-else> <template v-else>
<!-- 拼团成功 -->
<p v-if="groupInfo.joinGroup" class="desc"> <p v-if="groupInfo.joinGroup" class="desc">
{{ statusTextMap[groupInfo.groupBuyStatus] }} {{ statusTextMap[groupInfo.groupBuyStatus] }}
</p> </p>
...@@ -34,28 +40,29 @@ ...@@ -34,28 +40,29 @@
<!-- </template> --> <!-- </template> -->
</div> </div>
<div v-if="showButtonGroup" ref="buttonArea" class="button-area"> <div v-if="showButtonGroup" ref="buttonArea" class="button-area">
<div v-if="groupInfo.groupBuyStatus == 1" class="shareToButton">
<cr-button block shape="circle" type="primary" @click="share">邀请好友</cr-button>
</div>
<div class="toListButton">
<cr-button <cr-button
v-if="groupInfo.groupBuyStatus == 1"
block
shape="circle"
type="primary"
@click="share"
>邀请好友</cr-button
>
<cr-button
v-if="groupInfo.groupBuyStatus != 1 && !timeIsOver"
plain plain
block block
shape="circle" shape="circle"
type="primary" type="default"
@click="toList" class="toOrderList"
>查看其他商品</cr-button @click="toOrderList"
>查看我的拼团</cr-button
>
<cr-button plain block shape="circle" type="primary" @click="toList"
>返回活动列表</cr-button
> >
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
import countDown from '@/components/countDown'; import countDown from '@/components/countDown';
import { saTrackEvent } from '@/service/sa.service';
export default { export default {
components: { components: {
countDown countDown
...@@ -75,11 +82,7 @@ export default { ...@@ -75,11 +82,7 @@ export default {
return {}; return {};
} }
}, },
endTime: { skuNo: {
type: String,
default: ''
},
currentTime: {
type: String, type: String,
default: '' default: ''
} }
...@@ -92,15 +95,9 @@ export default { ...@@ -92,15 +95,9 @@ export default {
2: '恭喜成团!', 2: '恭喜成团!',
3: '哎呀,拼团时间已过,尚未成团!', 3: '哎呀,拼团时间已过,尚未成团!',
4: '已发货' 4: '已发货'
}, }
timeIsOver: false
}; };
}, },
created() {
const currentTime = new Date(this.currentTime.replace(/\-/g, '/')).getTime();
const endTime = new Date(this.endTime.replace(/\-/g, '/')).getTime();
this.timeIsOver = currentTime >= endTime ? true : false;
},
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.buttonArea) { if (this.$refs.buttonArea) {
...@@ -135,7 +132,16 @@ export default { ...@@ -135,7 +132,16 @@ export default {
this.$router.push({ name: 'groupBuyList', query: { activityId } }); this.$router.push({ name: 'groupBuyList', query: { activityId } });
} }
}, },
toOrderList() {
this.$router.push('/orderList/0');
},
share() { share() {
if (this.skuNo) {
saTrackEvent('H5_GroupDetailPageInviteFriendsBtnClick', {
sku_no: this.skuNo,
group_id: this.groupInfo?.groupId || ''
});
}
this.$emit('share'); this.$emit('share');
} }
} }
...@@ -148,8 +154,10 @@ export default { ...@@ -148,8 +154,10 @@ export default {
align-items: center; align-items: center;
margin-bottom: @padding-xs; margin-bottom: @padding-xs;
.desc { .desc {
margin-right: @padding-unit; text-align: center;
.text-14();
span { span {
.text-14();
color: @red-dark; color: @red-dark;
margin: 0 @padding-unit; margin: 0 @padding-unit;
} }
...@@ -161,12 +169,23 @@ export default { ...@@ -161,12 +169,23 @@ export default {
align-items: center; align-items: center;
color: @gray-4; color: @gray-4;
.text-12(); .text-12();
margin-bottom: @padding-md; margin-bottom: @padding-sm;
} }
.button-area { .button-area {
button { button {
font-size: 16px; font-size: 16px;
margin-bottom: @padding-md; margin-bottom: @padding-sm;
}
.toListButton {
display: flex;
flex-direction: row;
justify-content: space-between;
button {
width: 48%;
&.toOrderList {
color: @gray-4;
}
}
} }
} }
</style> </style>
...@@ -74,9 +74,8 @@ ...@@ -74,9 +74,8 @@
<group-desc-info <group-desc-info
:group-info="detailInfo.groupBuyInfo || {}" :group-info="detailInfo.groupBuyInfo || {}"
:timestemp="groupTimestemp" :timestemp="groupTimestemp"
:current-time="detailInfo.currentTime"
:end-time="detailInfo.endTime"
:show-button-group="true" :show-button-group="true"
:sku-no="detailParam.skuNo"
@changeButtonVisible="changeButtonVisible" @changeButtonVisible="changeButtonVisible"
@share="setShareData" @share="setShareData"
/> />
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</div> </div>
</div> </div>
</div> </div>
<template v-if="orderInfo.calcFeeInfo.totalSkuFee !== '0.00'"> <template v-if="orderInfo.calcFeeInfo && orderInfo.calcFeeInfo.totalSkuFee !== '0.00'">
<FeeInfo :calc-fee-info="orderInfo.calcFeeInfo" /> <FeeInfo :calc-fee-info="orderInfo.calcFeeInfo" />
</template> </template>
<div v-if="orderInfo.invalidSkuList && orderInfo.invalidSkuList.length" class="confirm-body"> <div v-if="orderInfo.invalidSkuList && orderInfo.invalidSkuList.length" class="confirm-body">
......
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