|
|
|
@ -52,7 +52,7 @@ |
|
|
|
<div |
|
|
|
class="col-6 d-flex flex-column justify-content-end align-items-start" |
|
|
|
> |
|
|
|
<div style="margin-bottom: 20px;">{{$t("purchase.Countdown")}}: <span style="margin-right: 10px;">{{ days }}{{$t("purchase.day")}}</span><span>{{ hours }}:</span><span>{{ minutes }}:</span><span>{{ seconds }}</span></div> |
|
|
|
<div style="margin-bottom: 20px;">{{timerbool?$t("purchase.Countdown1"):$t("purchase.Countdown")}}: <span style="margin-right: 10px;">{{ days }}{{$t("purchase.day")}}</span><span>{{ hours }}:</span><span>{{ minutes }}:</span><span>{{ seconds }}</span></div> |
|
|
|
<div class="input-group mb-3"> |
|
|
|
<div class="input-group-prepend"> |
|
|
|
<el-dropdown> |
|
|
|
@ -333,7 +333,8 @@ export default { |
|
|
|
seconds: '00', |
|
|
|
timer1: null, |
|
|
|
// 存储固定的初始时间差(单位:秒) |
|
|
|
remainingSeconds: 0 |
|
|
|
remainingSeconds: 0, |
|
|
|
timerbool:false |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -393,6 +394,19 @@ export default { |
|
|
|
Subscride.subscribe().then((res) => { |
|
|
|
this.detail = res; |
|
|
|
// console.log(this.detail.announce_time,'1111') |
|
|
|
// 初始化固定时间差 |
|
|
|
const start = new Date(this.detail.start_subscription_time).getTime(); |
|
|
|
const end = new Date(this.detail.end_subscription_time).getTime(); |
|
|
|
const now = Date.now(); |
|
|
|
if(now < start && now < end){ |
|
|
|
this.timerbool = false |
|
|
|
this.remainingSeconds = Math.floor((start - now) / 1000); |
|
|
|
this.startTimer() |
|
|
|
}else if (now > start && now < end) { |
|
|
|
this.timerbool = true |
|
|
|
this.remainingSeconds = Math.floor((end - now) / 1000); |
|
|
|
this.startTimer() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
@ -504,16 +518,6 @@ export default { |
|
|
|
return num < 10 ? `0${num}` : num.toString(); |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// 初始化固定时间差 |
|
|
|
const start = new Date(this.detail.start_subscription_time).getTime(); |
|
|
|
const end = new Date(this.detail.end_subscription_time).getTime(); |
|
|
|
const now = Date.now(); |
|
|
|
if (now > start && now < end) { |
|
|
|
this.remainingSeconds = Math.floor((end - now) / 1000); |
|
|
|
this.startTimer() |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.subscribeTokenList(); |
|
|
|
this.getInfo(); |
|
|
|
|