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