project init

This commit is contained in:
2023-01-09 10:20:17 +08:00
parent ac9b479805
commit fa1176f658
22 changed files with 800 additions and 39 deletions

View File

@@ -15,11 +15,27 @@ Page({
]
},
onLoad: function (options) {
},
onShow: function () {
if (wx.canIUse('hideHomeButton')) {
wx.hideHomeButton()
}
let isRun = wx.getStorageSync("isRun");
if (!isRun) {
this.startInter();
}
},
/**
* 启动定时器
*/
startInter : function(){
wx.setStorageSync("isRun",true);
let times = 1;
setInterval(
function () {
times ++;
// 提交远程服务器修改的内容,降低服务器压力,如果网络异常,也可以正常操作
console.log('setInterval 每过500毫秒执行一次任务' + times)
}, 5000);
}
});