|
|
|
@ -71,7 +71,7 @@ |
|
|
|
<!-- 申购 --> |
|
|
|
<view class="bg-panel-3 p-md box-shadow"> |
|
|
|
<view class="title p-b-xs border-b">{{ $t("purchase.a5") }}</view> |
|
|
|
<view class="title border-b" style="padding:10px 0px">{{ $t("purchase.Countdown") }}:<span style="margin-right: 7px;">{{ days }}{{$t("purchase.day")}}</span><span>{{ hours }}:</span><span>{{ minutes }}:</span><span>{{ seconds }}</span></view> |
|
|
|
<view class="title border-b" style="padding:10px 0px">{{ timerbool?$t("purchase.Countdown1"):$t("purchase.Countdown") }}:<span style="margin-right: 7px;">{{ days }}{{$t("purchase.day")}}</span><span>{{ hours }}:</span><span>{{ minutes }}:</span><span>{{ seconds }}</span></view> |
|
|
|
<view class="m-y-md"> |
|
|
|
<view class="label">{{ $t("purchase.a1") }}</view> |
|
|
|
<v-picker |
|
|
|
@ -224,7 +224,8 @@ export default { |
|
|
|
seconds: '00', |
|
|
|
timer1: null, |
|
|
|
// 存储固定的初始时间差(单位:秒) |
|
|
|
remainingSeconds: 0 |
|
|
|
remainingSeconds: 0, |
|
|
|
timerbool:false |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -260,7 +261,19 @@ export default { |
|
|
|
getInfo() { |
|
|
|
Subscride.subscribe().then((res) => { |
|
|
|
this.detail = res.data; |
|
|
|
|
|
|
|
// 初始化固定时间差 |
|
|
|
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() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
// 选择币种 |
|
|
|
@ -377,16 +390,6 @@ export default { |
|
|
|
this.subscribeTokenList(); |
|
|
|
this.getInfo(); |
|
|
|
}, |
|
|
|
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() |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
|