Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MES_PAD
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
Administrator
MES_PAD
Commits
12b8c64c
Commit
12b8c64c
authored
Nov 15, 2018
by
上官
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加版本号的显示
parent
4321843b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
update.min.js
dest/js/update.min.js
+37
-1
manifest.json
manifest.json
+1
-1
No files found.
dest/js/update.min.js
View file @
12b8c64c
...
...
@@ -99,7 +99,12 @@ function checkUpdateData(inf){
}
else
{
if
(
is_invoke_from_setting
){
alert
(
'您的APP版本已经是最新的.'
)
plus
.
runtime
.
getProperty
(
plus
.
runtime
.
appid
,
function
(
inf
){
inf
.
version
;
alert
(
'您的APP版本已经是最新的. 版本号: '
+
compareVersion_big
(
curVer
,
inf
.
version
))
});
}
}
...
...
@@ -167,6 +172,37 @@ function compareVersion(ov,nv){
return
true
;
}
}
/**
* 比较版本大小,返回大的版本号
* @param {String} ov
* @param {String} nv
* @return {Boolean}
*/
function
compareVersion_big
(
ov
,
nv
){
if
(
!
ov
||
!
nv
||
ov
==
""
||
nv
==
""
){
return
"9.9.9.9"
;
}
var
b
=
false
,
ova
=
ov
.
split
(
"."
,
4
),
nva
=
nv
.
split
(
"."
,
4
),
j
=
ova
.
length
,
k
=
nva
.
length
;
// console.log("ova:"+ova+"nva:"+nva);
for
(
var
i
=
0
;
i
<
j
&&
i
<
k
;
i
+=
1
){
var
so
=
ova
[
i
],
no
=
parseInt
(
so
),
sn
=
nva
[
i
],
nn
=
parseInt
(
sn
);
if
(
nn
>
no
||
sn
.
length
>
so
.
length
){
return
nv
;
}
else
if
(
nn
<
no
){
return
ov
;
}
}
if
(
k
>
j
&&
0
==
nv
.
indexOf
(
ov
)){
return
nv
;
}
}
...
...
manifest.json
View file @
12b8c64c
...
...
@@ -3,7 +3,7 @@
"id"
:
"H544710A8"
,
/*应用的标识,创建应用时自动生成,勿手动修改*/
"name"
:
"飞天兔MES"
,
/*应用名称,程序桌面图标名称*/
"version"
:
{
"name"
:
"1.0.0.
29
"
,
/*应用版本名称*/
"name"
:
"1.0.0.
31
"
,
/*应用版本名称*/
"code"
:
"338"
},
"description"
:
"飞天兔MES平板版"
,
/*应用描述信息*/
...
...
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