Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-customer-new-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-customer-new-master
Commits
98dae48f
Commit
98dae48f
authored
Mar 17, 2025
by
Smile
Committed by
wux
Mar 18, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug318 googleplay自动升级问题处理 ,系统默认跳转Google Play应用商店,未安装应用商店才下载更新
parent
d0831b0c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
218 additions
and
162 deletions
+218
-162
index.vue
src/pages/index/index.vue
+60
-42
login.vue
src/pages/login/login.vue
+60
-42
site.vue
src/pages/site/site.vue
+98
-78
No files found.
src/pages/index/index.vue
View file @
98dae48f
...
...
@@ -361,50 +361,68 @@ export default {
if
(
platform
==
'
ios
'
)
{
plus
.
runtime
.
openURL
(
'
https://apps.apple.com/us/app/e-c-logistics/id6466407990
'
)
}
else
{
uni
.
showLoading
({
title
:
this
.
$lang
.
lang
.
notices
.
startDown
})
that
.
showdownLine
=
true
var
dtask
=
plus
.
downloader
.
createDownload
(
that
.
appUrl
,
{},
(
d
,
status
)
=>
{
uni
.
hideLoading
()
if
(
status
==
200
)
{
// that.closeVe()
that
.
showdownLine
=
false
console
.
log
(
'
下载成功安装:
'
+
d
.
filename
)
plus
.
runtime
.
install
(
d
.
filename
)
}
else
{
that
.
showdownLine
=
false
// that.closeVe()
plus
.
nativeUI
.
alert
(
that
.
$lang
.
lang
.
notices
.
failDown
)
}
})
// uni.navigateTo({
// url:'../updateView/updateView?url='+this.appUrl
// })
// 下载进度
dtask
.
addEventListener
(
'
statechanged
'
,
function
(
download
,
status
)
{
if
(
that
.
downloadNum
==
100
)
{
console
.
log
(
'
android直接跳转
'
)
var
Uri
=
plus
.
android
.
importClass
(
"
android.net.Uri
"
);
var
Intent
=
plus
.
android
.
importClass
(
'
android.content.Intent
'
);
var
main
=
plus
.
android
.
runtimeMainActivity
();
//https://play.google.com/store/apps/details?id=com.jiedao.app
var
uri
=
Uri
.
parse
(
"
market://details?id=
"
+
"
com.jiedao.app
"
);
var
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
const
googlePlay
=
"
com.android.vending
"
// 选择进入商店
intent
.
setPackage
(
googlePlay
);
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
;
// 没有该商店应用
if
(
intent
.
resolveActivity
(
main
.
getPackageManager
())
!==
null
)
{
console
.
log
(
'
android 跳转google play
'
)
main
.
startActivity
(
intent
);
}
else
{
console
.
log
(
'
android 直接下载
'
)
uni
.
showLoading
({
title
:
this
.
$lang
.
lang
.
notices
.
startDown
})
that
.
showdownLine
=
true
var
dtask
=
plus
.
downloader
.
createDownload
(
that
.
appUrl
,
{},
(
d
,
status
)
=>
{
uni
.
hideLoading
()
}
switch
(
download
.
state
)
{
case
2
:
break
case
3
:
//进度条百分比 totalSize为总量,baifen为当前下载的百分比
if
(
that
.
totalSize
==
0
)
{
that
.
totalSize
=
parseInt
(
download
.
totalSize
)
}
if
(
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
!=
that
.
downloadNum
)
{
that
.
downloadNum
=
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
}
break
case
4
:
// mui.toast("下载完成");
if
(
status
==
200
)
{
// that.closeVe()
that
.
showdownLine
=
false
console
.
log
(
'
下载成功安装:
'
+
d
.
filename
)
plus
.
runtime
.
install
(
d
.
filename
)
}
else
{
that
.
showdownLine
=
false
// that.closeVe()
plus
.
nativeUI
.
alert
(
that
.
$lang
.
lang
.
notices
.
failDown
)
}
})
// uni.navigateTo({
// url:'../updateView/updateView?url='+this.appUrl
// })
// 下载进度
dtask
.
addEventListener
(
'
statechanged
'
,
function
(
download
,
status
)
{
if
(
that
.
downloadNum
==
100
)
{
uni
.
hideLoading
()
break
}
})
dtask
.
start
()
}
switch
(
download
.
state
)
{
case
2
:
break
case
3
:
//进度条百分比 totalSize为总量,baifen为当前下载的百分比
if
(
that
.
totalSize
==
0
)
{
that
.
totalSize
=
parseInt
(
download
.
totalSize
)
}
if
(
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
!=
that
.
downloadNum
)
{
that
.
downloadNum
=
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
}
break
case
4
:
// mui.toast("下载完成");
uni
.
hideLoading
()
break
}
})
dtask
.
start
()
}
}
// #endif
},
...
...
src/pages/login/login.vue
View file @
98dae48f
...
...
@@ -373,50 +373,68 @@ export default {
if
(
platform
==
'
ios
'
)
{
plus
.
runtime
.
openURL
(
'
https://apps.apple.com/us/app/e-c-logistics/id6466407990
'
)
}
else
{
uni
.
showLoading
({
title
:
this
.
$lang
.
lang
.
notices
.
startDown
})
that
.
showdownLine
=
true
var
dtask
=
plus
.
downloader
.
createDownload
(
that
.
appUrl
,
{},
(
d
,
status
)
=>
{
uni
.
hideLoading
()
if
(
status
==
200
)
{
// that.closeVe()
that
.
showdownLine
=
false
console
.
log
(
'
下载成功安装:
'
+
d
.
filename
)
plus
.
runtime
.
install
(
d
.
filename
)
}
else
{
that
.
showdownLine
=
false
// that.closeVe()
plus
.
nativeUI
.
alert
(
that
.
$lang
.
lang
.
notices
.
failDown
)
}
})
// uni.navigateTo({
// url:'../updateView/updateView?url='+this.appUrl
// })
// 下载进度
dtask
.
addEventListener
(
'
statechanged
'
,
function
(
download
,
status
)
{
if
(
that
.
downloadNum
==
100
)
{
console
.
log
(
'
android直接跳转
'
)
var
Uri
=
plus
.
android
.
importClass
(
"
android.net.Uri
"
);
var
Intent
=
plus
.
android
.
importClass
(
'
android.content.Intent
'
);
var
main
=
plus
.
android
.
runtimeMainActivity
();
//https://play.google.com/store/apps/details?id=com.jiedao.app
var
uri
=
Uri
.
parse
(
"
market://details?id=
"
+
"
com.jiedao.app
"
);
var
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
const
googlePlay
=
"
com.android.vending
"
// 选择进入商店
intent
.
setPackage
(
googlePlay
);
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
;
// 没有该商店应用
if
(
intent
.
resolveActivity
(
main
.
getPackageManager
())
!==
null
)
{
console
.
log
(
'
android 跳转google play
'
)
main
.
startActivity
(
intent
);
}
else
{
console
.
log
(
'
android 直接下载
'
)
uni
.
showLoading
({
title
:
this
.
$lang
.
lang
.
notices
.
startDown
})
that
.
showdownLine
=
true
var
dtask
=
plus
.
downloader
.
createDownload
(
that
.
appUrl
,
{},
(
d
,
status
)
=>
{
uni
.
hideLoading
()
}
switch
(
download
.
state
)
{
case
2
:
break
case
3
:
//进度条百分比 totalSize为总量,baifen为当前下载的百分比
if
(
that
.
totalSize
==
0
)
{
that
.
totalSize
=
parseInt
(
download
.
totalSize
)
}
if
(
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
!=
that
.
downloadNum
)
{
that
.
downloadNum
=
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
}
break
case
4
:
// mui.toast("下载完成");
if
(
status
==
200
)
{
// that.closeVe()
that
.
showdownLine
=
false
console
.
log
(
'
下载成功安装:
'
+
d
.
filename
)
plus
.
runtime
.
install
(
d
.
filename
)
}
else
{
that
.
showdownLine
=
false
// that.closeVe()
plus
.
nativeUI
.
alert
(
that
.
$lang
.
lang
.
notices
.
failDown
)
}
})
// uni.navigateTo({
// url:'../updateView/updateView?url='+this.appUrl
// })
// 下载进度
dtask
.
addEventListener
(
'
statechanged
'
,
function
(
download
,
status
)
{
if
(
that
.
downloadNum
==
100
)
{
uni
.
hideLoading
()
break
}
})
dtask
.
start
()
}
switch
(
download
.
state
)
{
case
2
:
break
case
3
:
//进度条百分比 totalSize为总量,baifen为当前下载的百分比
if
(
that
.
totalSize
==
0
)
{
that
.
totalSize
=
parseInt
(
download
.
totalSize
)
}
if
(
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
!=
that
.
downloadNum
)
{
that
.
downloadNum
=
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
}
break
case
4
:
// mui.toast("下载完成");
uni
.
hideLoading
()
break
}
})
dtask
.
start
()
}
}
// #endif
},
...
...
src/pages/site/site.vue
View file @
98dae48f
...
...
@@ -312,88 +312,108 @@ export default {
if
(
platform
==
'
ios
'
)
{
plus
.
runtime
.
openURL
(
'
https://apps.apple.com/us/app/e-c-logistics/id6466407990
'
)
}
else
{
// uni.showLoading({
// title: this.$lang.lang.notices.startDown,
// })
that
.
showdownLine
=
true
uni
.
showLoading
({
title
:
this
.
$lang
.
lang
.
notices
.
startDown
})
var
dtask
=
plus
.
downloader
.
createDownload
(
that
.
appUrl
,
{
timeout
:
60
,
retry
:
1
,
retryInterval
:
3
},
(
d
,
status
)
=>
{
if
(
status
==
200
)
{
uni
.
hideLoading
()
that
.
closeVe
()
that
.
showdownLine
=
false
console
.
log
(
'
下载成功安装:
'
+
d
.
filename
)
plus
.
runtime
.
install
(
d
.
filename
,
{},
()
=>
{},
function
(
error
)
{
uni
.
showToast
({
title
:
that
.
$lang
.
lang
.
notices
.
failDown
,
duration
:
1500
,
icon
:
'
none
'
})
console
.
log
(
'
android直接跳转
'
)
var
Uri
=
plus
.
android
.
importClass
(
"
android.net.Uri
"
);
var
Intent
=
plus
.
android
.
importClass
(
'
android.content.Intent
'
);
var
main
=
plus
.
android
.
runtimeMainActivity
();
//https://play.google.com/store/apps/details?id=com.jiedao.app
var
uri
=
Uri
.
parse
(
"
market://details?id=
"
+
"
com.jiedao.app
"
);
var
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
,
uri
);
const
googlePlay
=
"
com.android.vending
"
// 选择进入商店
intent
.
setPackage
(
googlePlay
);
intent
.
flags
=
Intent
.
FLAG_ACTIVITY_NEW_TASK
;
// 没有该商店应用
if
(
intent
.
resolveActivity
(
main
.
getPackageManager
())
!==
null
)
{
console
.
log
(
'
android 跳转google play
'
)
main
.
startActivity
(
intent
);
}
else
{
console
.
log
(
'
android直接跳转
'
)
// uni.showLoading({
// title: this.$lang.lang.notices.startDown,
// })
that
.
showdownLine
=
true
uni
.
showLoading
({
title
:
this
.
$lang
.
lang
.
notices
.
startDown
})
var
dtask
=
plus
.
downloader
.
createDownload
(
that
.
appUrl
,
{
timeout
:
60
,
retry
:
1
,
retryInterval
:
3
},
(
d
,
status
)
=>
{
if
(
status
==
200
)
{
uni
.
hideLoading
()
that
.
closeVe
()
that
.
showdownLine
=
false
console
.
log
(
'
下载成功安装:
'
+
d
.
filename
)
plus
.
runtime
.
install
(
d
.
filename
,
{},
()
=>
{
},
function
(
error
)
{
uni
.
showToast
({
title
:
that
.
$lang
.
lang
.
notices
.
failDown
,
duration
:
1500
,
icon
:
'
none
'
})
}
)
}
else
{
that
.
showdownLine
=
false
that
.
closeVe
()
plus
.
nativeUI
.
alert
(
that
.
$lang
.
lang
.
notices
.
failDown
)
}
)
}
else
{
that
.
showdownLine
=
false
that
.
closeVe
()
plus
.
nativeUI
.
alert
(
that
.
$lang
.
lang
.
notices
.
failDown
)
}
}
)
}
)
// uni.navigateTo({
// url:'../updateView/updateView?url='+this.appUrl
// })
// uni.navigateTo({
// url:'../updateView/updateView?url='+this.appUrl
// })
try
{
dtask
.
start
()
// 下载进度
dtask
.
addEventListener
(
'
statechanged
'
,
function
(
download
,
status
)
{
if
(
that
.
downloadNum
==
100
)
{
uni
.
hideLoading
()
}
switch
(
download
.
state
)
{
case
1
:
showLoading
.
setTitle
(
'
正在下载
'
)
break
case
2
:
break
case
3
:
//进度条百分比 totalSize为总量,baifen为当前下载的百分比
if
(
that
.
totalSize
==
0
)
{
that
.
totalSize
=
parseInt
(
download
.
totalSize
)
}
if
(
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
!=
that
.
downloadNum
)
{
that
.
downloadNum
=
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
}
break
case
4
:
// mui.toast("下载完成");
try
{
dtask
.
start
()
// 下载进度
dtask
.
addEventListener
(
'
statechanged
'
,
function
(
download
,
status
)
{
if
(
that
.
downloadNum
==
100
)
{
uni
.
hideLoading
()
break
}
})
}
catch
(
err
)
{
uni
.
hideLoading
()
that
.
showdownLine
=
false
that
.
closeVe
()
uni
.
showToast
({
title
:
that
.
$lang
.
lang
.
notices
.
failDown
,
duration
:
1500
,
icon
:
'
none
'
})
}
switch
(
download
.
state
)
{
case
1
:
showLoading
.
setTitle
(
'
正在下载
'
)
break
case
2
:
break
case
3
:
//进度条百分比 totalSize为总量,baifen为当前下载的百分比
if
(
that
.
totalSize
==
0
)
{
that
.
totalSize
=
parseInt
(
download
.
totalSize
)
}
if
(
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
!=
that
.
downloadNum
)
{
that
.
downloadNum
=
parseInt
((
download
.
downloadedSize
/
that
.
totalSize
)
*
100
)
}
break
case
4
:
// mui.toast("下载完成");
uni
.
hideLoading
()
break
}
})
}
catch
(
err
)
{
uni
.
hideLoading
()
that
.
showdownLine
=
false
that
.
closeVe
()
uni
.
showToast
({
title
:
that
.
$lang
.
lang
.
notices
.
failDown
,
duration
:
1500
,
icon
:
'
none
'
})
}
}
}
// #endif
...
...
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