Commit 5fbbf2c4 authored by June's avatar June

feature: appjs

parent af43e5d9
<script> <script>
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { checkLoginStatus } from '@/apis/user.js' import { checkLoginStatus } from '@/apis/user.js'
import { login_wx } from '@/utils/modules/login.js' import { login_wx } from '@/utils/modules/login.js'
...@@ -20,37 +20,37 @@ export default { ...@@ -20,37 +20,37 @@ export default {
} }
}) })
.catch(err => console.log(err)) .catch(err => console.log(err))
}, },
methods: { methods: {
...mapActions('systemInfo', ['setSystemInfo', 'setMenuButtonInfo']), ...mapActions('systemInfo', ['setSystemInfo', 'setMenuButtonInfo']),
...mapActions('user', ['setLocation', 'setLoginStatus']), ...mapActions('user', ['setLocation', 'setLoginStatus']),
...mapActions('cart', ['setCount']), ...mapActions('cart', ['setCount']),
// 检查更新 // 检查更新
checkUpdate() { checkUpdate() {
if (wx.canIUse('getUpdateManager')) { if (wx.canIUse('getUpdateManager')) {
const updateManager = uni.getUpdateManager() const updateManager = uni.getUpdateManager()
// 请求完新版本信息的回调 // 请求完新版本信息的回调
// updateManager.onCheckForUpdate(res => { // updateManager.onCheckForUpdate(res => {
// console.log(res.hasUpdate) // console.log(res.hasUpdate)
// }) // })
updateManager.onUpdateReady(() => { updateManager.onUpdateReady(() => {
uni.showModal({ uni.showModal({
title: '是否更新', title: '是否更新',
content: '新版本已经准备好,是否重启应用?', content: '新版本已经准备好,是否重启应用?',
success: res => { success: res => {
if(res.confirm) updateManager.applyUpdate() if(res.confirm) updateManager.applyUpdate()
} }
}) })
}) })
// updateManager.applyUpdate() // updateManager.applyUpdate()
updateManager.onUpdateFailed(() => { updateManager.onUpdateFailed(() => {
this.$toast({title: "更新失败,请检查您的网络是否正常"}) this.$toast({title: "更新失败,请检查您的网络是否正常"})
}) })
} }
} }
} }
} }
</script> </script>
...@@ -59,10 +59,10 @@ export default { ...@@ -59,10 +59,10 @@ export default {
@import url("@/styles/layout.css"); @import url("@/styles/layout.css");
/* 隐藏scrollbar 滚动条 */ /* 隐藏scrollbar 滚动条 */
::-webkit-scrollbar { ::-webkit-scrollbar {
display:none; display:none;
width:0; width:0;
height:0; height:0;
color:transparent; color:transparent;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment