增加微信小程序更新

This commit is contained in:
2024-10-29 17:02:00 +08:00
parent 397f25f0da
commit 9b09088e63

26
App.vue
View File

@@ -3,15 +3,29 @@
App.vue本身不是页面这里不能编写视图元素也就是没有<template>
-->
<script setup>
import { onLaunch } from '@dcloudio/uni-app';
import {
onLaunch
} from '@dcloudio/uni-app';
onLaunch(() => {
// console.log(uni.getExtConfigSync(),'uni.getExtConfigSync()')
// getExtStoreId();
uni.hideTabBar()
// appConfig.env.JEEPAY_BASE_URL = "https://b.rscygroup.com"
// 检查版本
// checkCurrVersion();
// #ifdef MP-WEIXIN
uni.setInnerAudioOption({
obeyMuteSwitch: false
});
const updateManager = wx.getUpdateManager() // 小程序版本更新管理器
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
})
updateManager.onUpdateReady(function() {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
})
updateManager.onUpdateFailed(function() {
// 新版本下载失败
})
// #endif
});
</script>