let timerFn = null;
const wxTimer = require('../util/wxTimer.js');
Page({
data: {
date: '2019/03/14 18:00'
},
onLoad: function () {
const td = this.data;
timerFn = new wxTimer({
endTime: new Date(td.date).getTime(),
beginTime: Date.now()
});
timerFn.start(this);
},
onShow: function () {
if (!this.data.canShow) return;
if (timerFn) {
timerFn.calibration();
timerFn.start(this);
}
},
onHide: function () {
timerFn && timerFn.stop();
},
changeTime: function (e) {
this.data.time = e.detail.value;
this.onHide();
this.onLoad();
},
});let timerFn = null;
const wxTimer = re