sunshibo 1 週間 前
コミット
87f784d8fe
1 ファイル変更23 行追加54 行削除
  1. 23 54
      HBuilderProjects/shareUndefined.html

+ 23 - 54
HBuilderProjects/shareUndefined.html

@@ -447,10 +447,6 @@
 			pointer-events: none;
 			pointer-events: none;
 		}
 		}
 
 
-		.fab-dock__slot {
-			position: relative;
-		}
-
 		#launch-btn {
 		#launch-btn {
 			display: none;
 			display: none;
 			width: 100%;
 			width: 100%;
@@ -459,48 +455,15 @@
 			border-radius: 24px;
 			border-radius: 24px;
 			overflow: hidden;
 			overflow: hidden;
 			opacity: 1;
 			opacity: 1;
-			position: relative;
-			z-index: 2;
-		}
-
-		/* 微信内:仅 wx.config 成功后展示开放标签,避免被 #openApp 挡住 */
-		body.is-wechat.wx-jssdk-ready #launch-btn,
-		body.wx-jssdk-ready #launch-btn {
-			display: block !important;
-		}
-
-		body.is-wechat.wx-jssdk-ready #openApp,
-		body.wx-jssdk-ready #openApp {
-			display: none !important;
-			visibility: hidden !important;
-			pointer-events: none !important;
-			position: absolute !important;
-			width: 0 !important;
-			height: 0 !important;
-			overflow: hidden !important;
 		}
 		}
 
 
-		body.is-wechat:not(.wx-jssdk-ready) #launch-btn {
-			display: none !important;
-		}
-
-		body.is-wechat:not(.wx-jssdk-ready) #openApp {
+		/* 与 secondShareGoods 一致:wx 就绪后仅显示开放标签(叠在 openApp 之上) */
+		body.is-wechat.wx-jssdk-ready #launch-btn {
 			display: block;
 			display: block;
-			width: 100%;
-			touch-action: manipulation;
-		}
-
-		#openApp {
-			display: block;
-			width: 100%;
-			padding: 0;
-			border: none;
-			background: transparent;
-			cursor: pointer;
-			touch-action: manipulation;
+			pointer-events: auto;
 		}
 		}
 
 
-		body:not(.is-wechat) #launch-btn {
+		body.is-wechat.wx-jssdk-ready #openApp {
 			display: none !important;
 			display: none !important;
 		}
 		}
 
 
@@ -584,7 +547,10 @@
 	<div id="openAppToast" role="status" aria-live="polite"></div>
 	<div id="openAppToast" role="status" aria-live="polite"></div>
 	<div class="fab-wrap">
 	<div class="fab-wrap">
 		<div class="fab-dock__slot">
 		<div class="fab-dock__slot">
-			<!-- 微信内 wx.config 成功后:开放标签须在顶层,避免被 #openApp 遮挡 -->
+			<!-- 与 secondShareGoods 相同顺序:openApp 在下,launch-btn 在上,避免挡住点击 -->
+			<button type="button" class="fab" id="openApp">
+				<img src="images/uBtn.png" alt="APP内打开" decoding="async">
+			</button>
 			<wx-open-launch-app id="launch-btn" appid="wxf5f1efe3a9f5012e" extinfo="">
 			<wx-open-launch-app id="launch-btn" appid="wxf5f1efe3a9f5012e" extinfo="">
 				<script type="text/wxtag-template">
 				<script type="text/wxtag-template">
 					<style>
 					<style>
@@ -612,15 +578,11 @@
 							-webkit-user-drag: none;
 							-webkit-user-drag: none;
 						}
 						}
 					</style>
 					</style>
-					<button type="button" class="wx-open-app-btn" aria-label="APP内打开">
+					<button class="wx-open-app-btn" aria-label="APP内打开">
 						<img src="https://test.ailien.shop/h5/HBuilderProjects/images/uBtn.png" alt="APP内打开" width="198" height="48" />
 						<img src="https://test.ailien.shop/h5/HBuilderProjects/images/uBtn.png" alt="APP内打开" width="198" height="48" />
 					</button>
 					</button>
 				</script>
 				</script>
 			</wx-open-launch-app>
 			</wx-open-launch-app>
-			<!-- 非微信 / 微信 JSSDK 未就绪:scheme 唤起 -->
-			<button type="button" class="fab" id="openApp">
-				<img src="images/uBtn.png" alt="APP内打开" decoding="async">
-			</button>
 		</div>
 		</div>
 		<div class="home-indicator" aria-hidden="true"></div>
 		<div class="home-indicator" aria-hidden="true"></div>
 	</div>
 	</div>
@@ -994,8 +956,6 @@
 
 
 		function getWxConfigSignUrl() {
 		function getWxConfigSignUrl() {
 			if (String(q('wxSignBaseOnly') || '') === '1') return getWxHtmlUrlBase();
 			if (String(q('wxSignBaseOnly') || '') === '1') return getWxHtmlUrlBase();
-			/* 微信分享链 query 较长时用 pathname 签名,避免 invalid signature 导致开放标签不可用 */
-			if (isWeChatInAppBrowser()) return getWxHtmlUrlBase();
 			return getWxSignPageUrlForApi();
 			return getWxSignPageUrlForApi();
 		}
 		}
 
 
@@ -1177,12 +1137,7 @@
 				wx.ready(function () {
 				wx.ready(function () {
 					weChatJssdkConfigured = true;
 					weChatJssdkConfigured = true;
 					document.body.classList.add('wx-jssdk-ready');
 					document.body.classList.add('wx-jssdk-ready');
-					var launchEl = document.getElementById('launch-btn');
-					if (launchEl) {
-						launchEl._wxLaunchBound = false;
-					}
 					refreshWxLaunchTagAttrs(false);
 					refreshWxLaunchTagAttrs(false);
-					bindWeChatLaunchTagEvents();
 					console.log('[wx.config] ready, htmlUrl=', htmlUrl);
 					console.log('[wx.config] ready, htmlUrl=', htmlUrl);
 					resolve(true);
 					resolve(true);
 				});
 				});
@@ -1228,10 +1183,24 @@
 			tag._wxLaunchBareRetried = false;
 			tag._wxLaunchBareRetried = false;
 			refreshWxLaunchTagAttrs(false);
 			refreshWxLaunchTagAttrs(false);
 			tag.addEventListener('launch', function () {
 			tag.addEventListener('launch', function () {
+				if (tag._launchTapTimer) {
+					clearTimeout(tag._launchTapTimer);
+					tag._launchTapTimer = null;
+				}
 				tag._wxLaunchBareRetried = false;
 				tag._wxLaunchBareRetried = false;
 				console.log('[wx-open-launch-app] launch ok');
 				console.log('[wx-open-launch-app] launch ok');
 				showFabToast('正在打开 U店在哪…');
 				showFabToast('正在打开 U店在哪…');
 			});
 			});
+			tag.addEventListener('click', function () {
+				if (!weChatJssdkConfigured) return;
+				if (tag._launchTapTimer) clearTimeout(tag._launchTapTimer);
+				tag._launchTapTimer = setTimeout(function () {
+					tag._launchTapTimer = null;
+					if (!tag._wxLaunchBareRetried) {
+						showFabToast('正在唤起 App,请稍候…');
+					}
+				}, 600);
+			});
 			tag.addEventListener('error', function (e) {
 			tag.addEventListener('error', function (e) {
 				var detail = e && e.detail;
 				var detail = e && e.detail;
 				var errMsg =
 				var errMsg =