Commit 6b1f9c79 authored by Smile's avatar Smile

bug318 googleplay自动升级问题处理 ,系统默认跳转Google Play应用商店,未安装应用商店才下载更新

parent 4e9a54d5
...@@ -361,6 +361,23 @@ export default { ...@@ -361,6 +361,23 @@ export default {
if (platform == 'ios') { if (platform == 'ios') {
plus.runtime.openURL('https://apps.apple.com/us/app/e-c-logistics/id6466407990') plus.runtime.openURL('https://apps.apple.com/us/app/e-c-logistics/id6466407990')
} else { } else {
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({ uni.showLoading({
title: this.$lang.lang.notices.startDown title: this.$lang.lang.notices.startDown
}) })
...@@ -406,6 +423,7 @@ export default { ...@@ -406,6 +423,7 @@ export default {
}) })
dtask.start() dtask.start()
} }
}
// #endif // #endif
}, },
getMemberSystemStatus(){ getMemberSystemStatus(){
......
...@@ -373,6 +373,23 @@ export default { ...@@ -373,6 +373,23 @@ export default {
if (platform == 'ios') { if (platform == 'ios') {
plus.runtime.openURL('https://apps.apple.com/us/app/e-c-logistics/id6466407990') plus.runtime.openURL('https://apps.apple.com/us/app/e-c-logistics/id6466407990')
} else { } else {
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({ uni.showLoading({
title: this.$lang.lang.notices.startDown title: this.$lang.lang.notices.startDown
}) })
...@@ -418,6 +435,7 @@ export default { ...@@ -418,6 +435,7 @@ export default {
}) })
dtask.start() dtask.start()
} }
}
// #endif // #endif
}, },
getVersion() { getVersion() {
......
...@@ -312,6 +312,24 @@ export default { ...@@ -312,6 +312,24 @@ export default {
if (platform == 'ios') { if (platform == 'ios') {
plus.runtime.openURL('https://apps.apple.com/us/app/e-c-logistics/id6466407990') plus.runtime.openURL('https://apps.apple.com/us/app/e-c-logistics/id6466407990')
} else { } else {
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({ // uni.showLoading({
// title: this.$lang.lang.notices.startDown, // title: this.$lang.lang.notices.startDown,
// }) // })
...@@ -335,7 +353,8 @@ export default { ...@@ -335,7 +353,8 @@ export default {
plus.runtime.install( plus.runtime.install(
d.filename, d.filename,
{}, {},
() => {}, () => {
},
function (error) { function (error) {
uni.showToast({ uni.showToast({
title: that.$lang.lang.notices.failDown, title: that.$lang.lang.notices.failDown,
...@@ -396,6 +415,7 @@ export default { ...@@ -396,6 +415,7 @@ export default {
}) })
} }
} }
}
// #endif // #endif
}, },
openAd() { openAd() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment