Browse Source

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

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

2
i18n/lang/en.json

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

46
pages/assets/records.vue

@ -31,7 +31,7 @@
</view> </view>
<view v-if="type=='draw'" style="width: 20%;"> <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 :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>
<view v-if="type=='recharge'"> <view v-if="type=='recharge'">
<view v-if="item.status==0">{{$t('assets.d1')}}</view> <view v-if="item.status==0">{{$t('assets.d1')}}</view>
@ -118,38 +118,30 @@ import formData from "@/utils/class/date";
this.depositHistory(); this.depositHistory();
} }
}, },
// cancelWithdraw(item) {
isWeekend(date) { Wallet.cancelWithdraw({ withdraw_id: item.id }).then(res => {
const day = date.getDay(); // 0 6 this.$toast(this.$t('otc.d4'));
return day === 0 || day === 6; this.getWithdrawRecords()
}, })
//
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;
}, },
updateTimer(val){ updateTimer(val){
const now = Date.now(); const nowInMilliseconds = Date.now(); //
const timer = this.getTargetTime(val) const twelveHoursInSeconds = 43200; // 12
const diff = timer - now; 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) { if (diff <= 0) {
return '00:00:00'; return '00:00:00';
} }
const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); const hours = Math.floor(diff / 3600000)
const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)); const minutes = Math.floor((diff % 3600000) / 60000)
const seconds = Math.floor((diff % (1000 * 60)) / 1000); const seconds = Math.floor((diff % 60000) / 1000)
return `${hours < 10 ? '0'+hours: hours}:${minutes < 10 ? '0'+minutes: minutes}:${seconds < 10 ? '0'+seconds: seconds}`; return `${hours < 10 ? '0'+hours: hours}:${minutes < 10 ? '0'+minutes: minutes}:${seconds < 10 ? '0'+seconds: seconds}`;
}, },

Loading…
Cancel
Save