Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
singleStore
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Max
singleStore
Commits
3a8ecc99
Commit
3a8ecc99
authored
Sep 02, 2021
by
June
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加版本号
parent
29adb4f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
10 deletions
+27
-10
App.vue
App.vue
+10
-8
pages/home/index.vue
pages/home/index.vue
+0
-1
pages/mine/index.vue
pages/mine/index.vue
+17
-1
No files found.
App.vue
View file @
3a8ecc99
...
...
@@ -6,7 +6,6 @@ import { removeStorage } from '@/lib/storage/index.js'
export
default
{
onLaunch
:
async
function
()
{
this
.
setMobileData
()
// 获取系统信息和胶囊信息
this
.
checkUpdate
()
// 检查更新
const
extConfig
=
wx
.
getExtConfigSync
?
wx
.
getExtConfigSync
():
{}
this
.
$store
.
state
.
user
.
appid
=
extConfig
.
appid
const
token
=
this
.
$getStorage
(
'
token
'
)
...
...
@@ -18,14 +17,15 @@ export default {
// uni.setEnableDebug({
// enableDebug: true
// })
uni
.
getStorageInfo
({
success
:
res
=>
{
if
(
res
.
currentSize
>
5120
)
{
removeStorage
(
'
search-history
'
)
}
}
})
})
this
.
checkUpdate
()
// 检查更新
},
globalData
:
{
...
...
@@ -47,18 +47,20 @@ export default {
// 检查更新
checkUpdate
()
{
if
(
wx
.
canIUse
(
'
getUpdateManager
'
))
{
if
(
uni
.
canIUse
(
'
getUpdateManager
'
))
{
const
updateManager
=
uni
.
getUpdateManager
()
// 请求完新版本信息的回调
//
updateManager.onCheckForUpdate(res => {
//
console.log(res.hasUpdate)
//
})
updateManager
.
onCheckForUpdate
(
res
=>
{
console
.
log
(
res
.
hasUpdate
)
})
updateManager
.
onUpdateReady
(()
=>
{
uni
.
showModal
({
title
:
'
是否更新
'
,
content
:
'
新版本已经准备好,是否重启应用?
'
,
success
:
res
=>
{
if
(
res
.
confirm
)
updateManager
.
applyUpdate
()
if
(
res
.
confirm
)
{
updateManager
.
applyUpdate
()
}
}
})
})
...
...
pages/home/index.vue
View file @
3a8ecc99
...
...
@@ -231,7 +231,6 @@ export default {
mixins
:
[
common_share
],
created
()
{
console
.
log
(
this
.
systemInfo
)
// 实例化分页方法
this
.
loadmore
=
new
LoadMore
()
this
.
getHomeCate
()
...
...
pages/mine/index.vue
View file @
3a8ecc99
...
...
@@ -106,6 +106,7 @@
</view>
</view>
<text
class=
"version font-24"
>
{{
version
}}
</text>
</view>
</
template
>
...
...
@@ -125,9 +126,11 @@ export default {
wait_receive
:
0
,
wait_send
:
0
},
commentCounts
:
0
commentCounts
:
0
,
version
:
''
}
},
computed
:
{
...
mapState
({
token
:
state
=>
state
.
user
.
token
,
...
...
@@ -135,6 +138,11 @@ export default {
})
},
created
()
{
const
accountInfo
=
uni
.
getAccountInfoSync
()
this
.
version
=
accountInfo
.
miniProgram
.
version
},
onShow
()
{
// 获取更新用户信息
this
.
init
()
},
...
...
@@ -324,4 +332,12 @@ export default {
}
}
}
.version
{
position
:
absolute
;
left
:
50%
;
bottom
:
10rpx
;
transform
:
translateX
(
-50%
);
color
:
#f9f9f9
;
}
</
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