|
|
|
@ -2,7 +2,7 @@ |
|
|
|
<v-page> |
|
|
|
<view class="layout-main"> |
|
|
|
<!-- 申购数据和申购周期 --> |
|
|
|
<v-header class="nav-head" :border="false" :title="$t('purchase.a5')"> |
|
|
|
<v-header class="nav-head" :border="false" :title="$t('purchase.a5')" :left-arrow="false"> |
|
|
|
<template #right> |
|
|
|
<v-link :to="'/pages/purchase/bill?issue_price='+detail.issue_price"> |
|
|
|
<van-icon class="fn-20 m-t-xs" name="todo-list-o"/> |
|
|
|
@ -34,6 +34,8 @@ |
|
|
|
<!-- </view>--> |
|
|
|
<!--</van-circle>--> |
|
|
|
<view class="m-b-xs"> |
|
|
|
<view class="label fn-10">{{ $t('purchase.issueNumber') }}</view> |
|
|
|
<view class="color-light">{{price1(detail.issue_num)}}</view> |
|
|
|
<view class="label fn-10">{{ $t("purchase.a0") }}</view> |
|
|
|
<view class="color-light">1 {{ detail.coin_name }}≈{{ detail.issue_price }}<!-- 0.035USDT --></view> |
|
|
|
<view class="label fn-10">{{ $t("purchase.a1") }}</view> |
|
|
|
@ -69,6 +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="m-y-md"> |
|
|
|
<view class="label">{{ $t("purchase.a1") }}</view> |
|
|
|
<v-picker |
|
|
|
@ -214,7 +217,14 @@ export default { |
|
|
|
coin: "", |
|
|
|
subscription: false, |
|
|
|
subscriptionCode: "", |
|
|
|
activityStep: 0 |
|
|
|
activityStep: 0, |
|
|
|
days: 0, |
|
|
|
hours: '00', |
|
|
|
minutes: '00', |
|
|
|
seconds: '00', |
|
|
|
timer1: null, |
|
|
|
// 存储固定的初始时间差(单位:秒) |
|
|
|
remainingSeconds: 0 |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -321,12 +331,62 @@ export default { |
|
|
|
.catch(() => { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
price1(item){ |
|
|
|
if (item) { |
|
|
|
let price = item.toString(); |
|
|
|
let parts = price.split("."); |
|
|
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); |
|
|
|
return parts.join("."); |
|
|
|
} |
|
|
|
}, |
|
|
|
startTimer() { |
|
|
|
this.timer1 = setInterval(() => { |
|
|
|
this.remainingSeconds -= 1; // 每秒减少1秒 |
|
|
|
this.updateDisplay(); |
|
|
|
|
|
|
|
if (this.remainingSeconds <= 0) { |
|
|
|
this.clearTimer(); |
|
|
|
this.$emit('time-end'); |
|
|
|
} |
|
|
|
}, 1000); |
|
|
|
this.updateDisplay(); // 初始显示 |
|
|
|
}, |
|
|
|
clearTimer() { |
|
|
|
if (this.timer1) { |
|
|
|
clearInterval(this.timer1); |
|
|
|
this.timer1 = null; |
|
|
|
} |
|
|
|
}, |
|
|
|
updateDisplay() { |
|
|
|
const seconds = this.remainingSeconds % 60; |
|
|
|
const minutes = Math.floor(this.remainingSeconds / 60) % 60; |
|
|
|
const hours = Math.floor(this.remainingSeconds / 3600) % 24; |
|
|
|
const days = Math.floor(this.remainingSeconds / 86400); |
|
|
|
|
|
|
|
this.days = days; |
|
|
|
this.hours = this.padZero(hours); |
|
|
|
this.minutes = this.padZero(minutes); |
|
|
|
this.seconds = this.padZero(seconds); |
|
|
|
}, |
|
|
|
padZero(num) { |
|
|
|
return num < 10 ? `0${num}` : num.toString(); |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
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> |
|
|
|
|