Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
和慭琛
take_order
Commits
dbc90391
Commit
dbc90391
authored
Mar 08, 2021
by
和慭琛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增 检查更新 逻辑
parent
04807755
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
App.vue
take-order/App.vue
+31
-0
No files found.
take-order/App.vue
View file @
dbc90391
...
@@ -101,6 +101,9 @@
...
@@ -101,6 +101,9 @@
},
},
onLaunch
:
function
()
{
onLaunch
:
function
()
{
this
.
checkUpdate
()
var
that
=
this
var
that
=
this
uni
.
getStorage
({
uni
.
getStorage
({
key
:
'token'
,
key
:
'token'
,
...
@@ -118,6 +121,34 @@
...
@@ -118,6 +121,34 @@
},
},
onShow
:
function
()
{},
onShow
:
function
()
{},
methods
:
{
methods
:
{
//检查更新
checkUpdate
:
function
()
{
const
updateManager
=
wx
.
getUpdateManager
()
updateManager
.
onCheckForUpdate
(
function
(
res
)
{
// 请求完新版本信息的回调
console
.
log
(
res
.
hasUpdate
)
})
updateManager
.
onUpdateReady
(
function
()
{
wx
.
showModal
({
title
:
'更新提示'
,
content
:
'新版本已经准备好,是否重启应用?'
,
success
(
res
)
{
if
(
res
.
confirm
)
{
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager
.
applyUpdate
()
}
}
})
})
updateManager
.
onUpdateFailed
(
function
()
{
// 新版本下载失败
})
},
async
getBaseInfo
(
vm
,
callBack
){
async
getBaseInfo
(
vm
,
callBack
){
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中……'
title
:
'加载中……'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment