wangxy 1 tháng trước cách đây
mục cha
commit
ce4cc05bdf
2 tập tin đã thay đổi với 36 bổ sung19 xóa
  1. 19 11
      pages/login/index.vue
  2. 17 8
      pages/study/index.vue

+ 19 - 11
pages/login/index.vue

@@ -140,6 +140,7 @@
 	})
 
 	function BanbenConfirmBtn() {
+    let resa = false;
 		const systemInfo = uni.getSystemInfoSync();
 		if (systemInfo.platform == 'ios') {
 			const appStoreUrl = 'itms-apps://itunes.apple.com/app/6741551741'
@@ -175,18 +176,25 @@
 					storeWebUrl = `https://appgallery.huawei.com/app/C113217527`;
 					break;
 				default:
+          // 直接下载apk
+          initDownload(updateUrl.value)
+          resa = true;
+          break;
 			}
-			plus.runtime.openURL(storeScheme, (error) => {
-				console.log('调起应用商店失败,尝试网页链接', error);
-				plus.runtime.openURL(storeWebUrl, (webError) => {
-					console.error('网页链接失败', webError);
-					plus.runtime.openURL(updateUrl.value, (webError) => {
-            // 直接下载apk
-            initDownload(updateUrl.value)
-					});
-				});
-			});
-
+      if (!resa) {
+        plus.runtime.openURL(storeScheme, (error) => {
+          console.log('调起应用商店失败,尝试网页链接', error);
+          plus.runtime.openURL(storeWebUrl, (webError) => {
+            console.error('网页链接失败', webError);
+            plus.runtime.openURL(updateUrl.value, (webError) => {
+              uni.showToast({
+                title: '跳转失败,请手动打开应用商店搜索更新',
+                icon: 'none'
+              });
+            });
+          });
+        });
+      }
 		}
 	}
 

+ 17 - 8
pages/study/index.vue

@@ -154,6 +154,7 @@
 
 
 	function BanbenConfirmBtn() {
+    let resa = false;
 		const systemInfo = uni.getSystemInfoSync();
 		if (systemInfo.platform == 'ios') {
 			const appStoreUrl = 'itms-apps://itunes.apple.com/app/6741551741'
@@ -189,17 +190,25 @@
           storeWebUrl = `https://appgallery.huawei.com/app/C113217527`;
           break;
         default:
+          // 直接下载apk
+          initDownload(updateUrl.value)
+          resa = true;
+          break;
       }
-      plus.runtime.openURL(storeScheme, (error) => {
-        console.log('调起应用商店失败,尝试网页链接', error);
-        plus.runtime.openURL(storeWebUrl, (webError) => {
-          console.error('网页链接失败', webError);
-          plus.runtime.openURL(updateUrl.value, (webError) => {
-            // 直接下载apk
-            initDownload(updateUrl.value)
+      if (!resa) {
+        plus.runtime.openURL(storeScheme, (error) => {
+          console.log('调起应用商店失败,尝试网页链接', error);
+          plus.runtime.openURL(storeWebUrl, (webError) => {
+            console.error('网页链接失败', webError);
+            plus.runtime.openURL(updateUrl.value, (webError) => {
+              uni.showToast({
+                title: '跳转失败,请手动打开应用商店搜索更新',
+                icon: 'none'
+              });
+            });
           });
         });
-      });
+      }
 		}
 	}