1 Star 0 Fork 0

陈绍华 / mini-example

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
app.js 1.76 KB
一键复制 编辑 原始数据 按行查看 历史
陈绍华 提交于 2019-09-30 02:53 . fix: 开始审核页面
//app.js
App({
/**
* 当小程序初始化完成时,会触发 onLaunch(全局只触发一次)
*/
onLaunch: function() {
let that = this;
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
if (res.hasUpdate) {
updateManager.onUpdateReady(function() {
wx.showModal({
title: '升级提示',
content: '新版本已经为您准备就绪,是否升级应用?',
success: function(res) {
if (res.confirm) {
updateManager.applyUpdate();
}
}
})
})
}
})
} else {
wx.showModal({
title: '温馨提示',
content: '您当前微信版本过低,为了您的用户体验,建议您升级到最新版微信',
})
}
wx.getSystemInfo({
success: function (res) {
that.globalData.StatusBar = res.statusBarHeight;
let capsule = wx.getMenuButtonBoundingClientRect();
if (capsule) {
that.globalData.Custom = capsule;
that.globalData.CustomBar = capsule.bottom + capsule.top - res.statusBarHeight;
} else {
this.globalData.CustomBar = res.statusBarHeight + 50;
}
}
})
},
/**
* 当小程序启动,或从后台进入前台显示,会触发 onShow
*/
onShow: function(options) {
},
/**
* 当小程序从前台进入后台,会触发 onHide
*/
onHide: function() {
},
/**
* 当小程序发生脚本错误,或者 api 调用失败时,会触发 onError 并带上错误信息
*/
onError: function(msg) {
},
/**
* 全局配置
*/
globalData: {
}
});
JavaScript
1
https://gitee.com/marlboro029/mini-example.git
git@gitee.com:marlboro029/mini-example.git
marlboro029
mini-example
mini-example
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891