|
|
@ -47,23 +47,17 @@ |
|
|
<vue class="m-b-xs"><img :src="detail.icon" style="width: 30px;" /></vue> |
|
|
<vue class="m-b-xs"><img :src="detail.icon" style="width: 30px;" /></vue> |
|
|
<view class="m-b-xs"> |
|
|
<view class="m-b-xs"> |
|
|
<view class="label fn-10">{{ $t("purchase.a2") }}</view> |
|
|
<view class="label fn-10">{{ $t("purchase.a2") }}</view> |
|
|
<view class="color-light">{{ |
|
|
<view class="color-light">{{convertTo12HourFormat(detail.expected_time_online)}} |
|
|
detail.expected_time_online |
|
|
|
|
|
}} |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="m-b-xs"> |
|
|
<view class="m-b-xs"> |
|
|
<view class="label fn-10">{{ $t("purchase.a3") }}</view> |
|
|
<view class="label fn-10">{{ $t("purchase.a3") }}</view> |
|
|
<view class="color-light">{{ |
|
|
<view class="color-light">{{convertTo12HourFormat(detail.start_subscription_time)}} |
|
|
detail.start_subscription_time |
|
|
|
|
|
}} |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="m-b-xs"> |
|
|
<view class="m-b-xs"> |
|
|
<view class="label fn-10">{{ $t("purchase.a4") }}</view> |
|
|
<view class="label fn-10">{{ $t("purchase.a4") }}</view> |
|
|
<view class="color-light">{{ |
|
|
<view class="color-light">{{convertTo12HourFormat(detail.end_subscription_time)}} |
|
|
detail.end_subscription_time |
|
|
|
|
|
}} |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -71,7 +65,7 @@ |
|
|
<!-- 申购 --> |
|
|
<!-- 申购 --> |
|
|
<view class="bg-panel-3 p-md box-shadow"> |
|
|
<view class="bg-panel-3 p-md box-shadow"> |
|
|
<view class="title p-b-xs border-b">{{ $t("purchase.a5") }}</view> |
|
|
<view class="title p-b-xs border-b">{{ $t("purchase.a5") }}</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="title border-b" style="padding:10px 0px">{{ timerbool?$t("purchase.Countdown1"):$t("purchase.Countdown") }}:<span>{{ hours }}:</span><span>{{ minutes }}:</span><span>{{ seconds }}</span></view> |
|
|
<view class="m-y-md"> |
|
|
<view class="m-y-md"> |
|
|
<view class="label">{{ $t("purchase.a1") }}</view> |
|
|
<view class="label">{{ $t("purchase.a1") }}</view> |
|
|
<v-picker |
|
|
<v-picker |
|
|
@ -244,6 +238,7 @@ export default { |
|
|
...mapGetters(['themeStyle']) |
|
|
...mapGetters(['themeStyle']) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
convertTo12HourFormat: date.convertTo12HourFormat, |
|
|
omitTo(num, idx) { |
|
|
omitTo(num, idx) { |
|
|
if (!num) return 0; |
|
|
if (!num) return 0; |
|
|
return math.omitTo(num, idx); |
|
|
return math.omitTo(num, idx); |
|
|
@ -264,14 +259,26 @@ export default { |
|
|
// 初始化固定时间差 |
|
|
// 初始化固定时间差 |
|
|
const start = new Date(this.detail.start_subscription_time).getTime(); |
|
|
const start = new Date(this.detail.start_subscription_time).getTime(); |
|
|
const end = new Date(this.detail.end_subscription_time).getTime(); |
|
|
const end = new Date(this.detail.end_subscription_time).getTime(); |
|
|
const now = Date.now(); |
|
|
const now = new Date(); |
|
|
if(now < start && now < end){ |
|
|
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.timerbool = false |
|
|
this.remainingSeconds = Math.floor((start - now) / 1000); |
|
|
this.remainingSeconds = Math.floor((start - newYorkTime) / 1000); |
|
|
this.startTimer() |
|
|
this.startTimer() |
|
|
}else if (now > start && now < end) { |
|
|
}else if (newYorkTime > start && newYorkTime < end) { |
|
|
this.timerbool = true |
|
|
this.timerbool = true |
|
|
this.remainingSeconds = Math.floor((end - now) / 1000); |
|
|
this.remainingSeconds = Math.floor((end - newYorkTime) / 1000); |
|
|
this.startTimer() |
|
|
this.startTimer() |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -374,10 +381,10 @@ export default { |
|
|
updateDisplay() { |
|
|
updateDisplay() { |
|
|
const seconds = this.remainingSeconds % 60; |
|
|
const seconds = this.remainingSeconds % 60; |
|
|
const minutes = Math.floor(this.remainingSeconds / 60) % 60; |
|
|
const minutes = Math.floor(this.remainingSeconds / 60) % 60; |
|
|
const hours = Math.floor(this.remainingSeconds / 3600) % 24; |
|
|
const hours = Math.floor(this.remainingSeconds / 3600); |
|
|
const days = Math.floor(this.remainingSeconds / 86400); |
|
|
// const days = Math.floor(this.remainingSeconds / 86400); |
|
|
|
|
|
|
|
|
this.days = days; |
|
|
// this.days = days; |
|
|
this.hours = this.padZero(hours); |
|
|
this.hours = this.padZero(hours); |
|
|
this.minutes = this.padZero(minutes); |
|
|
this.minutes = this.padZero(minutes); |
|
|
this.seconds = this.padZero(seconds); |
|
|
this.seconds = this.padZero(seconds); |
|
|
|