Browse Source

修改倒计时有问题、撤销提款按钮点不了、客服的英文不对

master
liaoxinyu 10 months ago
parent
commit
627dc20d0b
  1. 2
      i18n/lang/en.json
  2. 50
      pages/assets/records.vue

2
i18n/lang/en.json

@ -125,7 +125,7 @@
"c17": "Transfer Address",
"c18": "Transfer Amount",
"c19": "Recharge/Transfer",
"c20": "Contact customer service",
"c20": "Contact Customer Service",
"c21": "Select Currency",
"c22": "Password and Email Verification Code",
"c23": "Estimated arrival time",

50
pages/assets/records.vue

@ -31,7 +31,7 @@
</view>
<view v-if="type=='draw'" style="width: 20%;">
<view :class="item.status==0?'status_text':item.status==2?'status_text1':''">{{ item.status_text }}</view>
<view v-if="item.status==0">{{updateTimer(item.datetime)}}</view>
<view v-if="item.status==0">{{updateTimer(item)}}</view>
</view>
<view v-if="type=='recharge'">
<view v-if="item.status==0">{{$t('assets.d1')}}</view>
@ -118,39 +118,31 @@ import formData from "@/utils/class/date";
this.depositHistory();
}
},
//
isWeekend(date) {
const day = date.getDay(); // 0 6
return day === 0 || day === 6;
},
//
getTargetTime(datetime) {
const now = new Date();
const target = new Date( Date.parseTime(datetime) );
const isWeekend = this.isWeekend(target);
// 24
if (isWeekend) {
target.setHours(target.getHours() + 24);
} else {
// 12
target.setHours(target.getHours() + 12);
}
const countdownMilliseconds = isWeekend ? 24 * 60 * 60 * 1000 : 12 * 60 * 60 * 1000;
return target.getTime() + countdownMilliseconds;
cancelWithdraw(item) {
Wallet.cancelWithdraw({ withdraw_id: item.id }).then(res => {
this.$toast(this.$t('otc.d4'));
this.getWithdrawRecords()
})
},
updateTimer(val){
const now = Date.now();
const timer = this.getTargetTime(val)
const diff = timer - now;
const nowInMilliseconds = Date.now(); //
const twelveHoursInSeconds = 43200; // 12
const nowInSeconds = Math.floor(nowInMilliseconds / 1000); //
const adjustedNowInSeconds = nowInSeconds - twelveHoursInSeconds; //
//
const adjustedNowInMilliseconds = adjustedNowInSeconds * 1000;
const timer = val.newdatetime * 1000
const diff = timer - adjustedNowInMilliseconds;
if (diff <= 0) {
return '00:00:00';
}
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((diff % (1000 * 60)) / 1000);
const hours = Math.floor(diff / 3600000)
const minutes = Math.floor((diff % 3600000) / 60000)
const seconds = Math.floor((diff % 60000) / 1000)
return `${hours < 10 ? '0'+hours: hours}:${minutes < 10 ? '0'+minutes: minutes}:${seconds < 10 ? '0'+seconds: seconds}`;
},
remarktext(val){

Loading…
Cancel
Save