42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
App({
|
|
showToast: function (title, icon = 'none', duration = 1500) {
|
|
wx.showToast({
|
|
title: title,
|
|
icon: icon,
|
|
duration: duration
|
|
});
|
|
},
|
|
onLaunch(e) {
|
|
const updateManager = wx.getUpdateManager();
|
|
|
|
updateManager.onCheckForUpdate(function (res) {
|
|
console.log(res.hasUpdate); // 检查是否有新版本
|
|
console.log("检查是否有新版本",res.hasUpdate); // 检查是否有新版本
|
|
});
|
|
|
|
updateManager.onUpdateReady(function () {
|
|
updateManager.applyUpdate()
|
|
|
|
});
|
|
|
|
updateManager.onUpdateFailed(function () {
|
|
console.log('新版本下载失败'); // 处理下载失败
|
|
});
|
|
if (wx.getStorageSync('menuTop') != '' && wx.getStorageSync('menuHeight') != '') return
|
|
const button = wx.getMenuButtonBoundingClientRect();
|
|
console.log(button);
|
|
wx.setStorageSync('menuTop', button.top)
|
|
wx.setStorageSync('menuHeight', button.height)
|
|
},
|
|
onShow(){
|
|
|
|
},
|
|
globalData: {
|
|
teamRefresh: 0, //团队首页是否刷新
|
|
homeWorkRefresh: 0, //教师作业列表是否刷新
|
|
sex: 1, //性别
|
|
areaId: 1, //城市id
|
|
gradeId: 1, //年级
|
|
isUserLogout: false, //是否用户手动退出登录
|
|
},
|
|
}); |