Commit 83b1317e authored by Xuguangxing's avatar Xuguangxing

feat: 订单详情页增加时间校验

parent 154d6a1a
......@@ -60,7 +60,7 @@
邀请好友
</cr-button>
<cr-button
v-else
v-if="info.groupBuyStatus != 1 && !timeIsOver"
shape="circle"
plain
:disabled="disabled"
......@@ -102,9 +102,18 @@ export default {
},
data() {
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: {
toList() {
const { activityId } = this.$route.query || '';
......
......@@ -42,7 +42,13 @@
@click="share"
>邀请好友</cr-button
>
<cr-button v-else plain block shape="circle" type="primary" @click="toList"
<cr-button
v-if="groupInfo.groupBuyStatus != 1 && !timeIsOver"
plain
block
shape="circle"
type="primary"
@click="toList"
>查看其他商品</cr-button
>
</div>
......@@ -68,6 +74,14 @@ export default {
default: () => {
return {};
}
},
endTime: {
type: String,
default: ''
},
currentTime: {
type: String,
default: ''
}
},
data() {
......@@ -78,9 +92,15 @@ 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) {
......
......@@ -74,6 +74,8 @@
<group-desc-info
:group-info="detailInfo.groupBuyInfo || {}"
:timestemp="groupTimestemp"
:current-time="detailInfo.currentTime"
:end-time="detailInfo.endTime"
:show-button-group="true"
@changeButtonVisible="changeButtonVisible"
@share="setShareData"
......@@ -102,6 +104,8 @@
</div>
<bottom-nav
v-if="showButtonNav"
:current-time="detailInfo.currentTime"
:end-time="detailInfo.endTime"
:info="detailInfo.groupBuyInfo || {}"
:status="2"
:disabled="false"
......
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