...
|
...
|
@@ -9,8 +9,6 @@ const SHOW_DETAIL = 'show_detail'; |
|
|
const SHOW_EXPRESS = 'show_express';
|
|
|
import event from '../../utils/event';
|
|
|
|
|
|
let interval;
|
|
|
|
|
|
Component({
|
|
|
/**
|
|
|
* 组件的属性列表
|
...
|
...
|
@@ -47,7 +45,6 @@ attached: function () { |
|
|
let that = this;
|
|
|
if (that.data.buttons){
|
|
|
let lastIndex = that.data.buttons.length - 1;
|
|
|
console.log("lastIndex===" + lastIndex);
|
|
|
that.setData({ lastIndex: lastIndex });
|
|
|
}
|
|
|
|
...
|
...
|
@@ -56,7 +53,8 @@ attached: function () { |
|
|
let timer = that.data.timer;
|
|
|
|
|
|
if (timer > 0){
|
|
|
interval = setInterval(() => {
|
|
|
this.data.interval && clearInterval(this.data.interval);
|
|
|
this.data.interval = setInterval(() => {
|
|
|
timer = timer - 1;
|
|
|
leftTime = formatTimeByMin(timer, 'm:s');
|
|
|
if (timer <= 0) {
|
...
|
...
|
@@ -64,7 +62,7 @@ attached: function () { |
|
|
setTimeout(() => {
|
|
|
event.emit('refresh-order');
|
|
|
}, 2000);
|
|
|
clearInterval(interval);
|
|
|
clearInterval(this.data.interval);
|
|
|
}
|
|
|
that.setData({
|
|
|
lefttime: leftTime,
|
...
|
...
|
@@ -77,8 +75,8 @@ attached: function () { |
|
|
},
|
|
|
|
|
|
detached: function () {
|
|
|
if (interval){
|
|
|
clearInterval(interval);
|
|
|
if (this.data.interval){
|
|
|
clearInterval(this.data.interval);
|
|
|
}
|
|
|
},
|
|
|
|
...
|
...
|
|