Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
ba5ff906
Commit
ba5ff906
authored
May 18, 2023
by
qipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增版本更新后小程序热启动机制
parent
4f60f64f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
App.vue
App.vue
+25
-0
pages.json
pages.json
+7
-0
productList.vue
pages/my/order/productList/productList.vue
+22
-0
No files found.
App.vue
View file @
ba5ff906
...
@@ -39,6 +39,31 @@
...
@@ -39,6 +39,31 @@
uni
.
removeStorageSync
(
'alipayQrCode'
)
uni
.
removeStorageSync
(
'alipayQrCode'
)
}
}
//#endif
//#endif
/* 版本自动更新代码 */
const
updateManager
=
wx
.
getUpdateManager
()
updateManager
.
onCheckForUpdate
(
function
(
res
)
{
console
.
log
(
'是否有更新:'
+
res
.
hasUpdate
)
// 请求完新版本信息的回调 true说明有更新
})
updateManager
.
onUpdateReady
(
function
()
{
wx
.
showModal
({
title
:
'更新检测'
,
// 此处可自定义提示标题
content
:
'检测到新版本,是否重启小程序?'
,
// 此处可自定义提示消息内容
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager
.
applyUpdate
()
}
}
})
})
updateManager
.
onUpdateFailed
(
function
()
{
// 新的版本下载失败
wx
.
showModal
({
title
:
'更新提示'
,
content
:
'新版本下载失败'
,
showCancel
:
false
})
})
},
},
onShow
:
function
()
{
onShow
:
function
()
{
...
...
pages.json
View file @
ba5ff906
...
@@ -67,6 +67,13 @@
...
@@ -67,6 +67,13 @@
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
},
{
"path"
:
"pages/my/order/productList/productList"
,
"style"
:
{
"navigationBarTitleText"
:
"我的订单"
,
"enablePullDownRefresh"
:
false
}
},
{
{
"path"
:
"pages/combination/sourceCombiChoose/sourceCombiChoose"
,
"path"
:
"pages/combination/sourceCombiChoose/sourceCombiChoose"
,
"style"
:
{
"style"
:
{
...
...
pages/my/order/productList/productList.vue
0 → 100644
View file @
ba5ff906
<
template
>
<view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
}
},
methods
:
{
}
}
</
script
>
<
style
>
</
style
>
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