adultDeviceApp/App.vue

65 lines
1.7 KiB
Vue
Raw Normal View History

2022-05-03 21:35:39 +08:00
<script>
2022-05-13 09:22:34 +08:00
import {
mapState
} from "vuex";
export default {
methods: {},
computed: {
...mapState(["appTheme"]),
},
onLaunch() {
// 版本更新
const updateManager = wx.getUpdateManager()
// 请求完新版本信息的回调
updateManager.onCheckForUpdate(function(res) {
console.log("是否有新版本", res.hasUpdate)
})
// 新版本下载成功
updateManager.onUpdateReady(function() {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
// 新版本下载失败
updateManager.onUpdateFailed(function() {
wx.showModal({
title: '新版本更新失败',
content: '请退出并移除小程序,重新打开...',
})
})
// 系统信息
// uni.getSystemInfo({
// success: e => {
// let res = uni.getMenuButtonBoundingClientRect()
// let statusBarHeight = {
// BarTopHeight: res.top,
// BarTopLineHeight: res.height + 10,
// BarMarginTop: Number(res.top + res.height + 10)
// }
// this.$store.commit("handleBarHeight", statusBarHeight);
// console.log("系统信息", e, res)
// }
// })
//
},
mounted() {},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
},
}
2022-05-03 21:35:39 +08:00
</script>
<style lang="scss">
</style>