想改成三天时间的倒计时 麻烦哪位师傅帮忙看下 修改一下 麻烦帮忙修改一下代码
<button class="cu-btn bg-red" disabled type="">
<uni-countdown :show-day="false" :hour="pageInfo.houre" :minute="pageInfo.minute" :second="pageInfo.second" color="#FFFFFF" @timeup="reload()"/>
</button>
this.$lastWithDrawTime(type).then((result) => {
let time=parseInt(new Date().getTime()/1000);
switch(type){
case 1:
if(time-result>259200){
_this.pageInfo.isOk=true;
}else{
let mss=(259200-(time-result))*1000;
_this.pageInfo.isOk=false;
_this.pageInfo.houre=parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
_this.pageInfo.minute=parseInt((mss % (1000 * 60 * 60)) / (1000 * 60))
_this.pageInfo.second=parseInt((mss % (1000 * 60)) / 1000)
}
break;
case 2:
if(time-result>259200){
_this.pageInfo.isOk2=true;
}else{
let mss=(259200-(time-result))*1000;
_this.pageInfo.isOk2=false;
_this.pageInfo.houre2=parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
_this.pageInfo.minute2=parseInt((mss % (1000 * 60 * 60)) / (1000 * 60))
_this.pageInfo.second2=parseInt((mss % (1000 * 60)) / 1000)
}
break;
case 3:
if(time-result>259200){
_this.pageInfo.isOk3=true;
}else{
let mss=(259200-(time-result))*1000;
_this.pageInfo.isOk3=false;
_this.pageInfo.houre3=parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
_this.pageInfo.minute3=parseInt((mss % (1000 * 60 * 60)) / (1000 * 60))
_this.pageInfo.second3=parseInt((mss % (1000 * 60)) / 1000)
}
break;
}
})
this.$lastWithDrawTime(type).then((result) => {
let time=parseInt(new Date().getTime()/1000);
switch(type){
case 1:
if(time-result>259200){
_this.pageInfo.isOk=true;
}else{
let mss=(259200-(time-result))*1000;
_this.pageInfo.isOk=false;
let hours=(mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
let day=parseInt(hours/24);
_this.pageInfo.day=day;
_this.pageInfo.houre=parseInt(hours-day*24);
_this.pageInfo.minute=parseInt((mss % (1000 * 60 * 60)) / (1000 * 60))
_this.pageInfo.second=parseInt((mss % (1000 * 60)) / 1000)
}
break;
case 2:
if(time-result>259200){
_this.pageInfo.isOk2=true;
}else{
let mss=(259200-(time-result))*1000;
_this.pageInfo.isOk2=false;
let hours=(mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
let day=parseInt(hours/24);
_this.pageInfo.day2=day;
_this.pageInfo.houre2=parseInt(hours-day*24);
_this.pageInfo.minute2=parseInt((mss % (1000 * 60 * 60)) / (1000 * 60))
_this.pageInfo.second2=parseInt((mss % (1000 * 60)) / 1000)
}
break;
case 3:
if(time-result>259200){
_this.pageInfo.isOk3=true;
}else{
let mss=(259200-(time-result))*1000;
_this.pageInfo.isOk3=false;
let hours=(mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
let day=parseInt(hours/24);
_this.pageInfo.day3=day;
_this.pageInfo.houre3=parseInt(hours-day*24);
_this.pageInfo.minute3=parseInt((mss % (1000 * 60 * 60)) / (1000 * 60))
_this.pageInfo.second3=parseInt((mss % (1000 * 60)) / 1000)
}
break;
}
})
只要显示时分秒,还是要显示天数呢?
添加一个天数计算
_this.pageInfo.day=parseInt((mss % (1000 * 60 * 60 * 24))
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!