uni 计时器效果图
**vue代码:
data() {
return {
time:'审核中72:60:60',
h:71,
m:60,
s:60
};
},
methods: {
onLoad: function() {
setInterval(() => {
this.s>0?this.s--:this.s=59;
if(this.s==59){
if(this.m=="00")
this.h--;
this.m--;
}
this.m>=0?this.m=this.m-0:this.m=59;
this.s>=0?this.s=this.s-0:this.s=59;
this.h=this.h-0;
if(this.s<10)
this.s='0'+this.s;
if(this.m<10)
this.m='0'+this.m;
if(this.h<10)
this.h='0'+this.h;
this.time="审核中"+this.h+":"+this.m+":"+this.s;
},1000);
}