Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4aab5d4d
authored
Sep 25, 2024
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
更新
1 parent
d63727d8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
22 deletions
App.vue
components/HomeFrame/components/SettingBox.vue
manifest.json
App.vue
View file @
4aab5d4
...
@@ -2,14 +2,15 @@
...
@@ -2,14 +2,15 @@
* @Author: 前端 qianduan01@didihu.com.cn
* @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-04-07 17:09:53
* @Date: 2024-04-07 17:09:53
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-0
8-30 17:28:05
* @LastEditTime: 2024-0
9-24 11:01:24
* @FilePath: \gl_tape\App.vue
* @FilePath: \gl_tape\App.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
-->
<
script
>
<
script
>
const
PATH
=
[
'/pages/common/caseDetail'
]
const
PATH
=
[
'/pages/common/caseDetail'
]
import
checkUpdate
from
'@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js'
import
{
mapState
}
from
'vuex'
import
{
mapState
}
from
'vuex'
import
utils
from
'@/utils/utils'
export
default
{
export
default
{
computed
:
{
computed
:
{
...
mapState
(
'audio'
,
[
'isEnd'
,
'isStart'
])
...
mapState
(
'audio'
,
[
'isEnd'
,
'isStart'
])
...
@@ -26,6 +27,26 @@ export default {
...
@@ -26,6 +27,26 @@ export default {
})
})
},
},
methods
:
{
methods
:
{
async
handleCheck
()
{
const
{
textList
,
tempFileURL
,
version
}
=
uni
.
$storage
.
get
(
'mock_data'
)
const
res
=
utils
.
compareVersions
(
plus
?.
runtime
?.
version
,
version
)
if
(
res
>
-
1
)
{
return
}
const
e
=
{
result
:
{
is_silently
:
false
,
is_mandatory
:
true
,
name
:
''
,
title
:
''
,
contents
:
textList
.
join
(
'\n'
),
version
:
version
,
url
:
tempFileURL
,
stable_publish
:
true
}
}
checkUpdate
(
e
)
},
init
()
{
init
()
{
uni
.
addInterceptor
(
'navigateTo'
,
{
uni
.
addInterceptor
(
'navigateTo'
,
{
//监听跳转
//监听跳转
...
@@ -79,6 +100,7 @@ export default {
...
@@ -79,6 +100,7 @@ export default {
},
},
onShow
:
async
function
()
{
onShow
:
async
function
()
{
this
.
handleCheck
()
// const systemInfo = await uni.$api.systemApi.getMockData();
// const systemInfo = await uni.$api.systemApi.getMockData();
// if (systemInfo.isCheckedUpdate) {
// if (systemInfo.isCheckedUpdate) {
// checkUpdate();
// checkUpdate();
...
...
components/HomeFrame/components/SettingBox.vue
View file @
4aab5d4
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
import
checkUpdate
from
"@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js"
;
import
checkUpdate
from
"@/uni_modules/uni-upgrade-center-app/utils/check-update-nvue.js"
;
import
utils
from
'@/utils/utils'
export
default
{
export
default
{
name
:
'SettingBox'
,
name
:
'SettingBox'
,
data
()
{
data
()
{
...
@@ -56,24 +57,6 @@ export default {
...
@@ -56,24 +57,6 @@ export default {
}
}
});
});
},
},
/** 比较版本号的大小
**/
compareVersions
(
version1
,
version2
)
{
const
v1
=
version1
.
split
(
'.'
).
map
(
v
=>
+
v
)
// 转化成数字数组
const
v2
=
version2
.
split
(
'.'
).
map
(
v
=>
+
v
)
const
b1
=
v1
.
every
(
v
=>
!
isNaN
(
v
))
// 判断数组的每一项是否是数字
const
b2
=
v2
.
every
(
v
=>
!
isNaN
(
v
))
// 如果不是则返回错误信息
if
(
!
b1
||
!
b2
)
return
'版本号错误,只能包含数字、.'
const
len
=
Math
.
max
(
v1
.
length
,
v2
.
length
)
for
(
let
i
=
0
;
i
<
len
;
i
++
)
{
const
num1
=
v1
[
i
]
||
0
const
num2
=
v2
[
i
]
||
0
if
(
num1
>
num2
)
return
1
// 如果版本号1大于版本号2,则输出1
if
(
num1
<
num2
)
return
-
1
// 反之则输出 -1
}
// 如果版本号1 等于版本号2,则输出0
return
0
},
async
handleCheck
()
{
async
handleCheck
()
{
const
{
const
{
...
@@ -81,7 +64,7 @@ export default {
...
@@ -81,7 +64,7 @@ export default {
tempFileURL
,
tempFileURL
,
version
version
}
=
uni
.
$storage
.
get
(
'mock_data'
)
}
=
uni
.
$storage
.
get
(
'mock_data'
)
const
res
=
thi
s
.
compareVersions
(
this
.
version
,
version
)
const
res
=
util
s
.
compareVersions
(
this
.
version
,
version
)
if
(
res
>
-
1
)
{
if
(
res
>
-
1
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'目前已是最新版本'
,
title
:
'目前已是最新版本'
,
...
...
manifest.json
View file @
4aab5d4
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
"name"
:
"展业助手"
,
"name"
:
"展业助手"
,
"appid"
:
"__UNI__D3BD3DF"
,
"appid"
:
"__UNI__D3BD3DF"
,
"description"
:
""
,
"description"
:
""
,
"versionName"
:
"1.
6
.0"
,
"versionName"
:
"1.
9
.0"
,
"versionCode"
:
"100"
,
"versionCode"
:
"100"
,
"transformPx"
:
false
,
"transformPx"
:
false
,
/*
5
+App特有相关
*/
/*
5
+App特有相关
*/
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment