Commit 1aa3f3e1 authored by Xuguangxing's avatar Xuguangxing

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

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