mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
40 lines
739 B
TypeScript
40 lines
739 B
TypeScript
import { VantComponent } from '../../common/component';
|
|
import Toast from '../../toast/toast';
|
|
|
|
VantComponent({
|
|
data: {
|
|
time: 30 * 60 * 60 * 1000,
|
|
timeData: {},
|
|
},
|
|
|
|
methods: {
|
|
onChange(e) {
|
|
this.setData({
|
|
timeData: e.detail,
|
|
});
|
|
},
|
|
|
|
start() {
|
|
const countDown = this.selectComponent('.control-count-down');
|
|
countDown.start();
|
|
},
|
|
|
|
pause() {
|
|
const countDown = this.selectComponent('.control-count-down');
|
|
countDown.pause();
|
|
},
|
|
|
|
reset() {
|
|
const countDown = this.selectComponent('.control-count-down');
|
|
countDown.reset();
|
|
},
|
|
|
|
finished() {
|
|
Toast({
|
|
context: this,
|
|
message: '倒计时结束',
|
|
});
|
|
},
|
|
},
|
|
});
|