|
|
|
@ -26,7 +26,7 @@ |
|
|
|
</div> |
|
|
|
<div class="txt"> |
|
|
|
<!-- {{ parseTime(detail.expected_time_online) }} --> |
|
|
|
{{ detail.expected_time_online }} |
|
|
|
{{ convertTo12HourFormat(detail.expected_time_online) }} |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
<li class="mt-3"> |
|
|
|
@ -35,7 +35,7 @@ |
|
|
|
</div> |
|
|
|
<div class="txt"> |
|
|
|
<!-- {{ parseTime(detail.start_subscription_time) }} --> |
|
|
|
{{ detail.start_subscription_time }} |
|
|
|
{{ convertTo12HourFormat(detail.start_subscription_time) }} |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
<li class="mt-3"> |
|
|
|
@ -44,7 +44,7 @@ |
|
|
|
</div> |
|
|
|
<div class="txt"> |
|
|
|
<!-- {{ parseTime(detail.end_subscription_time) }} --> |
|
|
|
{{ detail.end_subscription_time }} |
|
|
|
{{ convertTo12HourFormat(detail.end_subscription_time) }} |
|
|
|
</div> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
@ -52,7 +52,7 @@ |
|
|
|
<div |
|
|
|
class="col-6 d-flex flex-column justify-content-end align-items-start" |
|
|
|
> |
|
|
|
<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 style="margin-bottom: 20px;">{{timerbool?$t("purchase.Countdown1"):$t("purchase.Countdown")}}: <span>{{ hours }}:</span><span>{{ minutes }}:</span><span>{{ seconds }}</span></div> |
|
|
|
<div class="input-group mb-3"> |
|
|
|
<div class="input-group-prepend"> |
|
|
|
<el-dropdown> |
|
|
|
@ -309,6 +309,7 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import date from "@/utils/class/date.js"; |
|
|
|
import Subscride from "@/api/subscride"; |
|
|
|
import Wallet from "@/api/wallet"; |
|
|
|
export default { |
|
|
|
@ -361,6 +362,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
convertTo12HourFormat: date.convertTo12HourFormat, |
|
|
|
// 过滤查找当前币种的记录 |
|
|
|
seek(item) { |
|
|
|
return !this.isCondition || item.coin_name === this.coinName; |
|
|
|
@ -397,14 +399,26 @@ export default { |
|
|
|
// 初始化固定时间差 |
|
|
|
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){ |
|
|
|
const now = new Date(); |
|
|
|
const options = { |
|
|
|
timeZone: 'America/New_York', // 指定时区为纽约 |
|
|
|
year: 'numeric', |
|
|
|
month: '2-digit', |
|
|
|
day: '2-digit', |
|
|
|
hour: '2-digit', |
|
|
|
minute: '2-digit', |
|
|
|
second: '2-digit', |
|
|
|
hour12: false // 使用24小时制 |
|
|
|
}; |
|
|
|
|
|
|
|
const newYorkTime = new Date(now.toLocaleString('en-US', options)).getTime(); |
|
|
|
if(newYorkTime < start && newYorkTime < end){ |
|
|
|
this.timerbool = false |
|
|
|
this.remainingSeconds = Math.floor((start - now) / 1000); |
|
|
|
this.remainingSeconds = Math.floor((start - newYorkTime) / 1000); |
|
|
|
this.startTimer() |
|
|
|
}else if (now > start && now < end) { |
|
|
|
}else if (newYorkTime > start && newYorkTime < end) { |
|
|
|
this.timerbool = true |
|
|
|
this.remainingSeconds = Math.floor((end - now) / 1000); |
|
|
|
this.remainingSeconds = Math.floor((end - newYorkTime) / 1000); |
|
|
|
this.startTimer() |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -506,10 +520,10 @@ export default { |
|
|
|
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); |
|
|
|
const hours = Math.floor(this.remainingSeconds / 3600); |
|
|
|
// const days = Math.floor(this.remainingSeconds / 86400); |
|
|
|
|
|
|
|
this.days = days; |
|
|
|
// this.days = days; |
|
|
|
this.hours = this.padZero(hours); |
|
|
|
this.minutes = this.padZero(minutes); |
|
|
|
this.seconds = this.padZero(seconds); |
|
|
|
|