sunshibo 1 день назад
Родитель
Сommit
5694da9364

+ 5 - 9
HBuilderProjects/secondShareGoods.html

@@ -720,6 +720,7 @@
 		 * 唤起 App 落地:二手商品详情(与 pages.json 路径一致)
 		 */
 		var APP_ANDROID_PACKAGE = 'com.alien.Udianzaizhe';
+		var APP_DOWNLOAD_URL = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.alien.Udianzaina';
 		var APP_IOS_URL_SCHEME = 'shopro://';
 		var APP_UNI_STORE_PATH = 'pages/secondHandTransactions/pages/detail/index';
 
@@ -741,12 +742,7 @@
 		var wxJssdkInitPromise = null;
 
 		function showDownloadTip() {
-			var msg = '请到应用商店下载';
-			if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
-				uni.showToast({ title: msg, icon: 'none', duration: 2500 });
-			} else {
-				window.alert(msg);
-			}
+			window.location.href = APP_DOWNLOAD_URL;
 		}
 
 		function mergeSearchAndHashParams() {
@@ -1173,9 +1169,7 @@
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
 				if (/launch:fail/i.test(errMsg) && !getWxShareEntryFrom()) {
-					showAppOpenFailTip(
-						'请前往应用商店下载U店在哪app'
-					);
+					showDownloadTip();
 				} else {
 					showAppOpenFailTip(
 						errMsg
@@ -1358,7 +1352,9 @@
 			}
 
 			window.setTimeout(function () {
+				if (done) return;
 				finish();
+				showDownloadTip();
 			}, 2600);
 		}
 

+ 6 - 7
HBuilderProjects/shareAiConsult.html

@@ -375,6 +375,8 @@
       var WX_GET_CONFIG_SIGN_URL = H5_PAGE_BASE_FALLBACK + "shareAiConsult.html";
       var WECHAT_JS_SAFE_HOSTS = ["uat.ailien.shop", "prod.ailien.shop"];
       var APP_ANDROID_PACKAGE = "com.alien.Udianzaizhe";
+      var APP_DOWNLOAD_URL =
+        "https://a.app.qq.com/o/simple.jsp?pkgname=com.alien.Udianzaina";
       var APP_IOS_URL_SCHEME = "shopro://";
       var APP_UNI_AI_PATH = "pages/aiSearchResult/index";
       var AI_LEGAL_CONVERSATION_API =
@@ -1304,7 +1306,7 @@
           // }
 
           if (/launch:fail/i.test(errMsg) && !getWxShareEntryFrom()) {
-            showAppOpenFailTip("请前往应用商店下载U店在哪app");
+            showDownloadTip();
             return;
           }
 
@@ -1383,12 +1385,7 @@
       }
 
       function showDownloadTip() {
-        var msg = "请到应用商店下载「U店在哪」";
-        if (typeof uni !== "undefined" && typeof uni.showToast === "function") {
-          uni.showToast({ title: msg, icon: "none", duration: 2500 });
-        } else {
-          window.alert(msg);
-        }
+        window.location.href = APP_DOWNLOAD_URL;
       }
 
       function showAppOpenFailTip(msg) {
@@ -1469,7 +1466,9 @@
         }
 
         window.setTimeout(function () {
+          if (done) return;
           finish();
+          showDownloadTip();
         }, 3200);
       }
 

+ 5 - 9
HBuilderProjects/shareCheckIn.html

@@ -566,6 +566,7 @@
 		 * 打卡落地:默认 pages/checkIn/index;URL 带 isShareCheckInSquare 且为真时 → pages/checkIn/details(合并 search + hash query)
 		 */
 		var APP_ANDROID_PACKAGE = 'com.alien.Udianzaizhe';
+		var APP_DOWNLOAD_URL = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.alien.Udianzaina';
 		var APP_IOS_URL_SCHEME = 'shopro://';
 		var APP_UNI_STORE_PATH = 'pages/checkIn/index';
 
@@ -588,12 +589,7 @@
 		var wxJssdkInitPromise = null;
 
 		function showDownloadTip() {
-			var msg = '请到应用商店下载';
-			if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
-				uni.showToast({ title: msg, icon: 'none', duration: 2500 });
-			} else {
-				window.alert(msg);
-			}
+			window.location.href = APP_DOWNLOAD_URL;
 		}
 
 		/**
@@ -1051,9 +1047,7 @@
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
 				if (/launch:fail/i.test(errMsg) && !getWxShareEntryFrom()) {
-					showAppOpenFailTip(
-						'请前往应用商店下载U店在哪app'
-					);
+					showDownloadTip();
 				} else {
 					showAppOpenFailTip(
 						errMsg
@@ -1235,7 +1229,9 @@
 			}
 
 			window.setTimeout(function () {
+				if (done) return;
 				finish();
+				showDownloadTip();
 			}, 2600);
 		}
 

+ 5 - 9
HBuilderProjects/shareCheckInUndefined.html

@@ -284,6 +284,7 @@
 		var wxJssdkInitPromise = null;
 
 		var APP_ANDROID_PACKAGE = 'com.alien.Udianzaizhe';
+		var APP_DOWNLOAD_URL = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.alien.Udianzaina';
 		var APP_IOS_URL_SCHEME = 'shopro://';
 		var APP_UNI_STORE_PATH = 'pages/checkIn/index';
 
@@ -293,12 +294,7 @@
 		}
 
 		function showDownloadTip() {
-			var msg = '请到应用商店下载';
-			if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
-				uni.showToast({ title: msg, icon: 'none', duration: 2500 });
-			} else {
-				window.alert(msg);
-			}
+			window.location.href = APP_DOWNLOAD_URL;
 		}
 
 		function mergeSearchAndHashParams() {
@@ -796,9 +792,7 @@
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
 				if (/launch:fail/i.test(errMsg) && !getWxShareEntryFrom()) {
-					showAppOpenFailTip(
-						'请前往应用商店下载U店在哪app'
-					);
+					showDownloadTip();
 				} else {
 					showAppOpenFailTip(
 						errMsg
@@ -988,7 +982,9 @@
 			}
 
 			window.setTimeout(function () {
+				if (done) return;
 				finish();
+				showDownloadTip();
 			}, 2600);
 		}
 

+ 5 - 9
HBuilderProjects/shareDynamic.html

@@ -648,16 +648,12 @@
 		 * shopro://pages/index/login?…(与 shareIndex.html、group_user pages/index/login 一致)。
 		 */
 		var APP_ANDROID_PACKAGE = 'com.alien.Udianzaizhe';
+		var APP_DOWNLOAD_URL = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.alien.Udianzaina';
 		var APP_IOS_URL_SCHEME = 'shopro://';
 		var APP_UNI_STORE_PATH = 'pages/newdetails/index';
 
 		function showDownloadTip() {
-			var msg = '请到应用商店下载';
-			if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
-				uni.showToast({ title: msg, icon: 'none', duration: 2500 });
-			} else {
-				window.alert(msg);
-			}
+			window.location.href = APP_DOWNLOAD_URL;
 		}
 
 		/**
@@ -1321,9 +1317,7 @@
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
 				if (/launch:fail/i.test(errMsg) && !getWxShareEntryFrom()) {
-					showAppOpenFailTip(
-						'请前往应用商店下载U店在哪app'
-					);
+					showDownloadTip();
 				} else {
 					showAppOpenFailTip(
 						errMsg
@@ -1570,7 +1564,9 @@
 				}
 
 				window.setTimeout(function () {
+					if (done) return;
 					finish();
+					showDownloadTip();
 				}, 3200);
 			};
 			runOpen();

+ 5 - 9
HBuilderProjects/shareIndex.html

@@ -1034,17 +1034,13 @@
 		 * - Android 包名:manifest 未写 packagename 时与 App.vue 升级配置 androidPackageName 一致(云打包以 HBuilderX 为准)
 		 */
 		var APP_ANDROID_PACKAGE = 'com.alien.Udianzaizhe';
+		var APP_DOWNLOAD_URL = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.alien.Udianzaina';
 		var APP_IOS_URL_SCHEME = 'shopro://';
 		/** businessSection 未传或其它值时的默认落地页(与 1 相同) */
 		var APP_UNI_STORE_PATH = 'pages/ieisureEntertainment/eightTypeList/delicacyDetails';
 
 		function showDownloadTip() {
-			var msg = '请到应用商店下载';
-			if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
-				uni.showToast({ title: msg, icon: 'none', duration: 2500 });
-			} else {
-				window.alert(msg);
-			}
+			window.location.href = APP_DOWNLOAD_URL;
 		}
 
 		/** getClientStoreDetail 回填后用于补全 storeType / storeTypeName 等唤起参数 */
@@ -1523,9 +1519,7 @@
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
 				if (/launch:fail/i.test(errMsg) && !getWxShareEntryFrom()) {
-					showAppOpenFailTip(
-						'请前往应用商店下载U店在哪app'
-					);
+					showDownloadTip();
 				} else {
 					showAppOpenFailTip(
 						errMsg
@@ -1725,7 +1719,9 @@
 			}
 
 			window.setTimeout(function () {
+				if (done) return;
 				finish();
+				showDownloadTip();
 			}, 2600);
 		}
 

+ 8 - 6
HBuilderProjects/shareUndefined.html

@@ -542,16 +542,12 @@
 		 * 与 secondShareGoods.html 一致:唤起 App 打开二手商品详情页(合并 search + hash 内 query)
 		 */
 		var APP_ANDROID_PACKAGE = 'com.alien.Udianzaizhe';
+		var APP_DOWNLOAD_URL = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.alien.Udianzaina';
 		var APP_IOS_URL_SCHEME = 'shopro://';
 		var APP_UNI_STORE_PATH = 'pages/secondHandTransactions/pages/detail/index';
 
 		function showDownloadTip() {
-			var msg = '请到应用商店下载';
-			if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
-				uni.showToast({ title: msg, icon: 'none', duration: 2500 });
-			} else {
-				window.alert(msg);
-			}
+			window.location.href = APP_DOWNLOAD_URL;
 		}
 
 		function mergeSearchAndHashParams() {
@@ -1136,6 +1132,10 @@
 					return;
 				}
 
+				if (/launch:fail/i.test(errMsg)) {
+					showDownloadTip();
+					return;
+				}
 				showAppOpenFailTip(
 					errMsg
 						? '未能打开 App:' + errMsg
@@ -1331,7 +1331,9 @@
 				}
 
 				window.setTimeout(function () {
+					if (done) return;
 					finish();
+					showDownloadTip();
 				}, 2600);
 			}