1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <script>
- export default {
-
- globalData: {
- },
-
- onLaunch() {
-
- this.updateManager()
- },
- methods: {
-
- updateManager() {
- const updateManager = uni.getUpdateManager();
- updateManager.onCheckForUpdate(res => {
-
-
- })
- updateManager.onUpdateReady(() => {
- uni.showModal({
- title: '更新提示',
- content: '新版本已经准备好,即将重启应用',
- showCancel: false,
- success(res) {
- if (res.confirm) {
-
- updateManager.applyUpdate()
- }
- }
- })
- })
- updateManager.onUpdateFailed(() => {
-
- uni.showModal({
- title: '更新提示',
- content: '新版本下载失败',
- showCancel: false
- })
- })
- }
- }
- }
- </script>
- <style lang="scss">
-
- @import "uview-ui/index.scss";
- </style>
- <style>
-
- @import "./app.scss";
- </style>
|