You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

33 lines
596 B

Component({
properties: {
icon: String,
t1: String,
t2: String,
progress: Number,
end: Boolean,
},
data: {
progressText: "0%",
progressNum: 0,
},
observers: {
progress(val) {
let progressNum = this.data.end ? 1 : val;
if (isNaN(progressNum)) return;
if (progressNum < 0) progressNum = 0;
if (progressNum > 1) progressNum = 1;
this.setData({
progressText: parseInt(progressNum * 100) + "%",
progressNum,
});
},
},
methods: {
handleTap() {
this.triggerEvent("exit");
},
},
});