|
|
|
@@ -50,6 +50,7 @@ Page({ |
|
|
|
last: undefined, |
|
|
|
|
|
|
|
onLoad: function () { |
|
|
|
this.daojishi() // 默认进入页面10S后退出 |
|
|
|
}, |
|
|
|
onReady: function () { |
|
|
|
if (systemInfo.platform === "devtools") { //开发工具不会触发initdone事件,于是在onReady手动触发 |
|
|
|
@@ -65,7 +66,26 @@ Page({ |
|
|
|
console.info(err); |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
daojishi(){ |
|
|
|
var t = 10; |
|
|
|
var timer = setInterval(function(){ |
|
|
|
t--; |
|
|
|
if(t==3){ |
|
|
|
wx.showToast({ |
|
|
|
icon: 'none', |
|
|
|
title: '扫描次数过多', |
|
|
|
}) |
|
|
|
} |
|
|
|
if(t<0){ |
|
|
|
clearInterval(timer); |
|
|
|
wx.navigateBack({ |
|
|
|
delta: 1, |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(t) |
|
|
|
}, 1000) |
|
|
|
|
|
|
|
}, |
|
|
|
showLoading(text) { |
|
|
|
this.setData({ |
|
|
|
showLoading: true, |
|
|
|
|