Browse Source

链接分享

sunshibo 1 week ago
parent
commit
b5d47c2db4

+ 70 - 4
HBuilderProjects/secondShareGoods.html

@@ -73,11 +73,12 @@
 			opacity: 1;
 		}
 
-		body.is-wechat.wx-jssdk-ready #launch-btn {
+		/* 仅「分享卡片」等受支持场景展示开放标签;复制链接进入见 .wx-copy-link-entry */
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #launch-btn {
 			display: block;
 		}
 
-		body.is-wechat.wx-jssdk-ready #openApp {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #openApp {
 			display: none !important;
 		}
 
@@ -796,6 +797,51 @@
 			return /MicroMessenger/i.test(navigator.userAgent || '');
 		}
 
+		/** 微信打开 H5 时的场景来源(分享卡片会带 from,复制链接通常没有) */
+		function getWxShareEntryFrom() {
+			var from = q('from');
+			return from ? String(from).trim().toLowerCase() : '';
+		}
+
+		/**
+		 * wx-open-launch-app 仅在部分微信场景可用(App/好友分享卡片、朋友圈卡片等)。
+		 * 复制链接粘贴打开一般无 from=,微信会报 launch:fail(当前场景不支持)。
+		 */
+		function isWxOpenLaunchAppSceneSupported() {
+			if (!isWeChatInAppBrowser()) return false;
+			if (readQueryParam('wxOpenTag') === '1' || readQueryParam('wxForceOpenTag') === '1') {
+				return true;
+			}
+			var from = getWxShareEntryFrom();
+			return (
+				from === 'singlemessage' ||
+				from === 'groupmessage' ||
+				from === 'timeline'
+			);
+		}
+
+		function applyWxOpenLaunchSceneBodyClass() {
+			if (!isWeChatInAppBrowser()) return;
+			var ok = isWxOpenLaunchAppSceneSupported();
+			document.body.classList.toggle('wx-open-tag-scene', ok);
+			document.body.classList.toggle('wx-copy-link-entry', !ok);
+		}
+
+		function logWxEntryDiagnostics() {
+			if (!isWeChatInAppBrowser()) return;
+			console.log('[wx-entry]', {
+				entryFrom: getWxShareEntryFrom() || '(无,多为复制链接进入)',
+				openLaunchTagScene: isWxOpenLaunchAppSceneSupported(),
+				signUrl: getWxConfigSignUrl()
+			});
+		}
+
+		function showWxCopyLinkEntryTip() {
+			showFabToast(
+				'当前为复制链接进入,微信不支持直接打开 App。请使用 App「分享到微信」发送卡片后,从卡片进入。'
+			);
+		}
+
 		function readQueryParam(name) {
 			return q(name);
 		}
@@ -1041,7 +1087,10 @@
 				wx.ready(function () {
 					weChatJssdkConfigured = true;
 					document.body.classList.add('wx-jssdk-ready');
-					refreshWxLaunchTagAttrs();
+					applyWxOpenLaunchSceneBodyClass();
+					if (isWxOpenLaunchAppSceneSupported()) {
+						refreshWxLaunchTagAttrs();
+					}
 					console.log('[wx.config] ready, htmlUrl=', htmlUrl);
 					resolve(true);
 				});
@@ -1097,6 +1146,10 @@
 							? String(detail.errmsg)
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
+				if (/launch:fail/i.test(errMsg) && !isWxOpenLaunchAppSceneSupported()) {
+					showWxCopyLinkEntryTip();
+					return;
+				}
 				showAppOpenFailTip(
 					errMsg
 						? '未能唤起 App:' + errMsg
@@ -1957,13 +2010,22 @@
 			if (launchTag) launchTag.setAttribute('appid', WECHAT_OPEN_APP_ID);
 			bindWeChatLaunchTagEvents();
 			if (shouldInitWeChatJssdkOnLoad()) {
-				if (isWeChatInAppBrowser()) document.body.classList.add('is-wechat');
+				if (isWeChatInAppBrowser()) {
+					document.body.classList.add('is-wechat');
+					applyWxOpenLaunchSceneBodyClass();
+					logWxEntryDiagnostics();
+				}
 				if (isWxPcBrowser() && (isWxForceDebug() || isWxPcAutoDebugHost())) {
 					document.body.classList.add('wx-pc-debug');
 				}
 				scheduleWeChatJssdkBootstrap();
 			}
 
+			document.addEventListener('WeixinOpenTagsError', function (e) {
+				console.warn('[WeixinOpenTagsError]', e && e.detail);
+				applyWxOpenLaunchSceneBodyClass();
+			});
+
 			if (isWeChatInAppBrowser()) {
 				var openBtnWx = document.getElementById('openApp');
 				if (openBtnWx) {
@@ -1972,6 +2034,10 @@
 							showFabToast(
 								wxInitLastError || '微信 SDK 初始化中,请稍候再点底部按钮'
 							);
+							return;
+						}
+						if (!isWxOpenLaunchAppSceneSupported()) {
+							showWxCopyLinkEntryTip();
 						}
 					});
 				}

+ 64 - 4
HBuilderProjects/shareCheckIn.html

@@ -322,11 +322,11 @@
 			opacity: 1;
 		}
 
-		body.is-wechat.wx-jssdk-ready #launch-btn {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #launch-btn {
 			display: block;
 		}
 
-		body.is-wechat.wx-jssdk-ready #openApp {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #openApp {
 			display: none !important;
 		}
 
@@ -795,6 +795,46 @@
 			return /MicroMessenger/i.test(navigator.userAgent || '');
 		}
 
+		function getWxShareEntryFrom() {
+			var from = q('from');
+			return from ? String(from).trim().toLowerCase() : '';
+		}
+
+		function isWxOpenLaunchAppSceneSupported() {
+			if (!isWeChatInAppBrowser()) return false;
+			if (readQueryParam('wxOpenTag') === '1' || readQueryParam('wxForceOpenTag') === '1') {
+				return true;
+			}
+			var from = getWxShareEntryFrom();
+			return (
+				from === 'singlemessage' ||
+				from === 'groupmessage' ||
+				from === 'timeline'
+			);
+		}
+
+		function applyWxOpenLaunchSceneBodyClass() {
+			if (!isWeChatInAppBrowser()) return;
+			var ok = isWxOpenLaunchAppSceneSupported();
+			document.body.classList.toggle('wx-open-tag-scene', ok);
+			document.body.classList.toggle('wx-copy-link-entry', !ok);
+		}
+
+		function logWxEntryDiagnostics() {
+			if (!isWeChatInAppBrowser()) return;
+			console.log('[wx-entry]', {
+				entryFrom: getWxShareEntryFrom() || '(无,多为复制链接进入)',
+				openLaunchTagScene: isWxOpenLaunchAppSceneSupported(),
+				signUrl: getWxConfigSignUrl()
+			});
+		}
+
+		function showWxCopyLinkEntryTip() {
+			showFabToast(
+				'当前为复制链接进入,微信不支持直接打开 App。请使用 App「分享到微信」发送卡片后,从卡片进入。'
+			);
+		}
+
 		function readQueryParam(name) {
 			return q(name);
 		}
@@ -1040,7 +1080,10 @@
 				wx.ready(function () {
 					weChatJssdkConfigured = true;
 					document.body.classList.add('wx-jssdk-ready');
-					refreshWxLaunchTagAttrs();
+					applyWxOpenLaunchSceneBodyClass();
+					if (isWxOpenLaunchAppSceneSupported()) {
+						refreshWxLaunchTagAttrs();
+					}
 					console.log('[wx.config] ready, htmlUrl=', htmlUrl);
 					resolve(true);
 				});
@@ -1096,6 +1139,10 @@
 							? String(detail.errmsg)
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
+				if (/launch:fail/i.test(errMsg) && !isWxOpenLaunchAppSceneSupported()) {
+					showWxCopyLinkEntryTip();
+					return;
+				}
 				showAppOpenFailTip(
 					errMsg
 						? '未能唤起 App:' + errMsg
@@ -2406,13 +2453,22 @@
 			if (launchTag) launchTag.setAttribute('appid', WECHAT_OPEN_APP_ID);
 			bindWeChatLaunchTagEvents();
 			if (shouldInitWeChatJssdkOnLoad()) {
-				if (isWeChatInAppBrowser()) document.body.classList.add('is-wechat');
+				if (isWeChatInAppBrowser()) {
+					document.body.classList.add('is-wechat');
+					applyWxOpenLaunchSceneBodyClass();
+					logWxEntryDiagnostics();
+				}
 				if (isWxPcBrowser() && (isWxForceDebug() || isWxPcAutoDebugHost())) {
 					document.body.classList.add('wx-pc-debug');
 				}
 				scheduleWeChatJssdkBootstrap();
 			}
 
+			document.addEventListener('WeixinOpenTagsError', function (e) {
+				console.warn('[WeixinOpenTagsError]', e && e.detail);
+				applyWxOpenLaunchSceneBodyClass();
+			});
+
 			fetchGetDeleteFlagByIdIfId().then(function (res) {
 				if (isShareCheckInDeletedByDeleteFlag(res)) {
 					applyCheckInDeletedByDeleteFlagUi();
@@ -2434,6 +2490,10 @@
 							showFabToast(
 								wxInitLastError || '微信 SDK 初始化中,请稍候再点底部按钮'
 							);
+							return;
+						}
+						if (!isWxOpenLaunchAppSceneSupported()) {
+							showWxCopyLinkEntryTip();
 						}
 					});
 				}

+ 64 - 4
HBuilderProjects/shareCheckInUndefined.html

@@ -211,11 +211,11 @@
 			opacity: 1;
 		}
 
-		body.is-wechat.wx-jssdk-ready #launch-btn {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #launch-btn {
 			display: block;
 		}
 
-		body.is-wechat.wx-jssdk-ready #openApp {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #openApp {
 			display: none !important;
 		}
 
@@ -550,6 +550,46 @@
 			return /MicroMessenger/i.test(navigator.userAgent || '');
 		}
 
+		function getWxShareEntryFrom() {
+			var from = q('from');
+			return from ? String(from).trim().toLowerCase() : '';
+		}
+
+		function isWxOpenLaunchAppSceneSupported() {
+			if (!isWeChatInAppBrowser()) return false;
+			if (readQueryParam('wxOpenTag') === '1' || readQueryParam('wxForceOpenTag') === '1') {
+				return true;
+			}
+			var from = getWxShareEntryFrom();
+			return (
+				from === 'singlemessage' ||
+				from === 'groupmessage' ||
+				from === 'timeline'
+			);
+		}
+
+		function applyWxOpenLaunchSceneBodyClass() {
+			if (!isWeChatInAppBrowser()) return;
+			var ok = isWxOpenLaunchAppSceneSupported();
+			document.body.classList.toggle('wx-open-tag-scene', ok);
+			document.body.classList.toggle('wx-copy-link-entry', !ok);
+		}
+
+		function logWxEntryDiagnostics() {
+			if (!isWeChatInAppBrowser()) return;
+			console.log('[wx-entry]', {
+				entryFrom: getWxShareEntryFrom() || '(无,多为复制链接进入)',
+				openLaunchTagScene: isWxOpenLaunchAppSceneSupported(),
+				signUrl: getWxConfigSignUrl()
+			});
+		}
+
+		function showWxCopyLinkEntryTip() {
+			showFabToast(
+				'当前为复制链接进入,微信不支持直接打开 App。请使用 App「分享到微信」发送卡片后,从卡片进入。'
+			);
+		}
+
 		function readQueryParam(name) {
 			return q(name);
 		}
@@ -795,7 +835,10 @@
 				wx.ready(function () {
 					weChatJssdkConfigured = true;
 					document.body.classList.add('wx-jssdk-ready');
-					refreshWxLaunchTagAttrs();
+					applyWxOpenLaunchSceneBodyClass();
+					if (isWxOpenLaunchAppSceneSupported()) {
+						refreshWxLaunchTagAttrs();
+					}
 					console.log('[wx.config] ready, htmlUrl=', htmlUrl);
 					resolve(true);
 				});
@@ -851,6 +894,10 @@
 							? String(detail.errmsg)
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
+				if (/launch:fail/i.test(errMsg) && !isWxOpenLaunchAppSceneSupported()) {
+					showWxCopyLinkEntryTip();
+					return;
+				}
 				showAppOpenFailTip(
 					errMsg
 						? '未能唤起 App:' + errMsg
@@ -1277,13 +1324,22 @@
 			if (launchTag) launchTag.setAttribute('appid', WECHAT_OPEN_APP_ID);
 			bindWeChatLaunchTagEvents();
 			if (shouldInitWeChatJssdkOnLoad()) {
-				if (isWeChatInAppBrowser()) document.body.classList.add('is-wechat');
+				if (isWeChatInAppBrowser()) {
+					document.body.classList.add('is-wechat');
+					applyWxOpenLaunchSceneBodyClass();
+					logWxEntryDiagnostics();
+				}
 				if (isWxPcBrowser() && (isWxForceDebug() || isWxPcAutoDebugHost())) {
 					document.body.classList.add('wx-pc-debug');
 				}
 				scheduleWeChatJssdkBootstrap();
 			}
 
+			document.addEventListener('WeixinOpenTagsError', function (e) {
+				console.warn('[WeixinOpenTagsError]', e && e.detail);
+				applyWxOpenLaunchSceneBodyClass();
+			});
+
 			applyEmptyHeroState();
 			run();
 
@@ -1295,6 +1351,10 @@
 							showFabToast(
 								wxInitLastError || '微信 SDK 初始化中,请稍候再点底部按钮'
 							);
+							return;
+						}
+						if (!isWxOpenLaunchAppSceneSupported()) {
+							showWxCopyLinkEntryTip();
 						}
 					});
 				}

+ 64 - 4
HBuilderProjects/shareDynamic.html

@@ -512,11 +512,11 @@
 			opacity: 1;
 		}
 
-		body.is-wechat.wx-jssdk-ready #launch-btn {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #launch-btn {
 			display: block;
 		}
 
-		body.is-wechat.wx-jssdk-ready #openApp {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #openApp {
 			display: none !important;
 		}
 
@@ -1359,7 +1359,10 @@
 				wx.ready(function () {
 					weChatJssdkConfigured = true;
 					document.body.classList.add('wx-jssdk-ready');
-					refreshWxLaunchTagAttrs();
+					applyWxOpenLaunchSceneBodyClass();
+					if (isWxOpenLaunchAppSceneSupported()) {
+						refreshWxLaunchTagAttrs();
+					}
 					console.log('[wx.config] ready, htmlUrl=', htmlUrl);
 					resolve(true);
 				});
@@ -1415,6 +1418,10 @@
 							? String(detail.errmsg)
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
+				if (/launch:fail/i.test(errMsg) && !isWxOpenLaunchAppSceneSupported()) {
+					showWxCopyLinkEntryTip();
+					return;
+				}
 				showAppOpenFailTip(
 					errMsg
 						? '未能唤起 App:' + errMsg
@@ -1523,6 +1530,46 @@
 			return /MicroMessenger/i.test(navigator.userAgent || '');
 		}
 
+		function getWxShareEntryFrom() {
+			var from = q('from');
+			return from ? String(from).trim().toLowerCase() : '';
+		}
+
+		function isWxOpenLaunchAppSceneSupported() {
+			if (!isWeChatInAppBrowser()) return false;
+			if (readQueryParam('wxOpenTag') === '1' || readQueryParam('wxForceOpenTag') === '1') {
+				return true;
+			}
+			var from = getWxShareEntryFrom();
+			return (
+				from === 'singlemessage' ||
+				from === 'groupmessage' ||
+				from === 'timeline'
+			);
+		}
+
+		function applyWxOpenLaunchSceneBodyClass() {
+			if (!isWeChatInAppBrowser()) return;
+			var ok = isWxOpenLaunchAppSceneSupported();
+			document.body.classList.toggle('wx-open-tag-scene', ok);
+			document.body.classList.toggle('wx-copy-link-entry', !ok);
+		}
+
+		function logWxEntryDiagnostics() {
+			if (!isWeChatInAppBrowser()) return;
+			console.log('[wx-entry]', {
+				entryFrom: getWxShareEntryFrom() || '(无,多为复制链接进入)',
+				openLaunchTagScene: isWxOpenLaunchAppSceneSupported(),
+				signUrl: getWxConfigSignUrl()
+			});
+		}
+
+		function showWxCopyLinkEntryTip() {
+			showFabToast(
+				'当前为复制链接进入,微信不支持直接打开 App。请使用 App「分享到微信」发送卡片后,从卡片进入。'
+			);
+		}
+
 		/** 微信内置浏览器、iOS:OSS 截图/封面易因 Referer 被拒;video 首帧不可靠 */
 		function preferStaticStillOverVideo() {
 			return isIOSVideoEnv() || isWeChatInAppBrowser();
@@ -3098,13 +3145,22 @@
 			if (launchTag) launchTag.setAttribute('appid', WECHAT_OPEN_APP_ID);
 			bindWeChatLaunchTagEvents();
 			if (shouldInitWeChatJssdkOnLoad()) {
-				if (isWeChatInAppBrowser()) document.body.classList.add('is-wechat');
+				if (isWeChatInAppBrowser()) {
+					document.body.classList.add('is-wechat');
+					applyWxOpenLaunchSceneBodyClass();
+					logWxEntryDiagnostics();
+				}
 				if (isWxPcBrowser() && (isWxForceDebug() || isWxPcAutoDebugHost())) {
 					document.body.classList.add('wx-pc-debug');
 				}
 				scheduleWeChatJssdkBootstrap();
 			}
 
+			document.addEventListener('WeixinOpenTagsError', function (e) {
+				console.warn('[WeixinOpenTagsError]', e && e.detail);
+				applyWxOpenLaunchSceneBodyClass();
+			});
+
 			fetchGetDeleteFlagByIdIfId().then(function (res) {
 				if (isGetOneBusinessStatus99(res)) {
 					applyShareDynamicClosedMerchantUi(true);
@@ -3128,6 +3184,10 @@
 							showFabToast(
 								wxInitLastError || '微信 SDK 初始化中,请稍候再点底部按钮'
 							);
+							return;
+						}
+						if (!isWxOpenLaunchAppSceneSupported()) {
+							showWxCopyLinkEntryTip();
 						}
 					});
 				}

+ 68 - 4
HBuilderProjects/shareIndex.html

@@ -496,11 +496,11 @@
 			opacity: 1;
 		}
 
-		body.is-wechat.wx-jssdk-ready #launch-btn {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #launch-btn {
 			display: block;
 		}
 
-		body.is-wechat.wx-jssdk-ready #openApp {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #openApp {
 			display: none !important;
 		}
 
@@ -1237,6 +1237,49 @@
 			return /MicroMessenger/i.test(navigator.userAgent || '');
 		}
 
+		function getWxShareEntryFrom() {
+			var from = '';
+			try {
+				from = new URLSearchParams(location.search || '').get('from') || '';
+			} catch (eFrom) {}
+			return from ? String(from).trim().toLowerCase() : '';
+		}
+
+		function isWxOpenLaunchAppSceneSupported() {
+			if (!isWeChatInAppBrowser()) return false;
+			if (readQueryParam('wxOpenTag') === '1' || readQueryParam('wxForceOpenTag') === '1') {
+				return true;
+			}
+			var from = getWxShareEntryFrom();
+			return (
+				from === 'singlemessage' ||
+				from === 'groupmessage' ||
+				from === 'timeline'
+			);
+		}
+
+		function applyWxOpenLaunchSceneBodyClass() {
+			if (!isWeChatInAppBrowser()) return;
+			var ok = isWxOpenLaunchAppSceneSupported();
+			document.body.classList.toggle('wx-open-tag-scene', ok);
+			document.body.classList.toggle('wx-copy-link-entry', !ok);
+		}
+
+		function logWxEntryDiagnostics() {
+			if (!isWeChatInAppBrowser()) return;
+			console.log('[wx-entry]', {
+				entryFrom: getWxShareEntryFrom() || '(无,多为复制链接进入)',
+				openLaunchTagScene: isWxOpenLaunchAppSceneSupported(),
+				signUrl: getWxConfigSignUrl()
+			});
+		}
+
+		function showWxCopyLinkEntryTip() {
+			showFabToast(
+				'当前为复制链接进入,微信不支持直接打开 App。请使用 App「分享到微信」发送卡片后,从卡片进入。'
+			);
+		}
+
 		function readQueryParam(name) {
 			try {
 				var v = new URLSearchParams(location.search || '').get(name);
@@ -1543,7 +1586,10 @@
 				wx.ready(function () {
 					weChatJssdkConfigured = true;
 					document.body.classList.add('wx-jssdk-ready');
-					refreshWxLaunchTagAttrs();
+					applyWxOpenLaunchSceneBodyClass();
+					if (isWxOpenLaunchAppSceneSupported()) {
+						refreshWxLaunchTagAttrs();
+					}
 					console.log('[wx.config] ready, htmlUrl=', htmlUrl);
 					resolve(true);
 				});
@@ -1599,6 +1645,10 @@
 							? String(detail.errmsg)
 							: '';
 				console.warn('[wx-open-launch-app]', detail);
+				if (/launch:fail/i.test(errMsg) && !isWxOpenLaunchAppSceneSupported()) {
+					showWxCopyLinkEntryTip();
+					return;
+				}
 				showAppOpenFailTip(
 					errMsg
 						? '未能唤起 App:' + errMsg
@@ -2948,12 +2998,22 @@
 			if (launchTag) launchTag.setAttribute('appid', WECHAT_OPEN_APP_ID);
 			bindWeChatLaunchTagEvents();
 			if (shouldInitWeChatJssdkOnLoad()) {
-				if (isWeChatInAppBrowser()) document.body.classList.add('is-wechat');
+				if (isWeChatInAppBrowser()) {
+					document.body.classList.add('is-wechat');
+					applyWxOpenLaunchSceneBodyClass();
+					logWxEntryDiagnostics();
+				}
 				if (isWxPcBrowser() && (isWxForceDebug() || isWxPcAutoDebugHost())) {
 					document.body.classList.add('wx-pc-debug');
 				}
 				scheduleWeChatJssdkBootstrap();
 			}
+
+			document.addEventListener('WeixinOpenTagsError', function (e) {
+				console.warn('[WeixinOpenTagsError]', e && e.detail);
+				applyWxOpenLaunchSceneBodyClass();
+			});
+
 			if (isWeChatInAppBrowser()) {
 				var openBtnWx = document.getElementById('openApp');
 				if (openBtnWx) {
@@ -2962,6 +3022,10 @@
 							showFabToast(
 								wxInitLastError || '微信 SDK 初始化中,请稍候再点底部按钮'
 							);
+							return;
+						}
+						if (!isWxOpenLaunchAppSceneSupported()) {
+							showWxCopyLinkEntryTip();
 						}
 					});
 				}

+ 65 - 4
HBuilderProjects/shareUndefined.html

@@ -457,11 +457,11 @@
 			opacity: 1;
 		}
 
-		body.is-wechat.wx-jssdk-ready #launch-btn {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #launch-btn {
 			display: block;
 		}
 
-		body.is-wechat.wx-jssdk-ready #openApp {
+		body.is-wechat.wx-jssdk-ready.wx-open-tag-scene #openApp {
 			display: none !important;
 		}
 
@@ -833,6 +833,46 @@
 			return /MicroMessenger/i.test(navigator.userAgent || '');
 		}
 
+		function getWxShareEntryFrom() {
+			var from = q('from');
+			return from ? String(from).trim().toLowerCase() : '';
+		}
+
+		function isWxOpenLaunchAppSceneSupported() {
+			if (!isWeChatInAppBrowser()) return false;
+			if (readQueryParam('wxOpenTag') === '1' || readQueryParam('wxForceOpenTag') === '1') {
+				return true;
+			}
+			var from = getWxShareEntryFrom();
+			return (
+				from === 'singlemessage' ||
+				from === 'groupmessage' ||
+				from === 'timeline'
+			);
+		}
+
+		function applyWxOpenLaunchSceneBodyClass() {
+			if (!isWeChatInAppBrowser()) return;
+			var ok = isWxOpenLaunchAppSceneSupported();
+			document.body.classList.toggle('wx-open-tag-scene', ok);
+			document.body.classList.toggle('wx-copy-link-entry', !ok);
+		}
+
+		function logWxEntryDiagnostics() {
+			if (!isWeChatInAppBrowser()) return;
+			console.log('[wx-entry]', {
+				entryFrom: getWxShareEntryFrom() || '(无,多为复制链接进入)',
+				openLaunchTagScene: isWxOpenLaunchAppSceneSupported(),
+				signUrl: getWxConfigSignUrl()
+			});
+		}
+
+		function showWxCopyLinkEntryTip() {
+			showFabToast(
+				'当前为复制链接进入,微信不支持直接打开 App。请使用 App「分享到微信」发送卡片后,从卡片进入。'
+			);
+		}
+
 		function readQueryParam(name) {
 			return q(name);
 		}
@@ -1078,7 +1118,10 @@
 				wx.ready(function () {
 					weChatJssdkConfigured = true;
 					document.body.classList.add('wx-jssdk-ready');
-					refreshWxLaunchTagAttrs();
+					applyWxOpenLaunchSceneBodyClass();
+					if (isWxOpenLaunchAppSceneSupported()) {
+						refreshWxLaunchTagAttrs(false);
+					}
 					console.log('[wx.config] ready, htmlUrl=', htmlUrl);
 					resolve(true);
 				});
@@ -1147,6 +1190,11 @@
 					return;
 				}
 
+				if (/launch:fail/i.test(errMsg) && !isWxOpenLaunchAppSceneSupported()) {
+					showWxCopyLinkEntryTip();
+					return;
+				}
+
 				if (
 					/launch:fail/i.test(errMsg) &&
 					!tag._wxLaunchBareRetried &&
@@ -1848,13 +1896,22 @@
 			if (launchTag) launchTag.setAttribute('appid', WECHAT_OPEN_APP_ID);
 			bindWeChatLaunchTagEvents();
 			if (shouldInitWeChatJssdkOnLoad()) {
-				if (isWeChatInAppBrowser()) document.body.classList.add('is-wechat');
+				if (isWeChatInAppBrowser()) {
+					document.body.classList.add('is-wechat');
+					applyWxOpenLaunchSceneBodyClass();
+					logWxEntryDiagnostics();
+				}
 				if (isWxPcBrowser() && (isWxForceDebug() || isWxPcAutoDebugHost())) {
 					document.body.classList.add('wx-pc-debug');
 				}
 				scheduleWeChatJssdkBootstrap();
 			}
 
+			document.addEventListener('WeixinOpenTagsError', function (e) {
+				console.warn('[WeixinOpenTagsError]', e && e.detail);
+				applyWxOpenLaunchSceneBodyClass();
+			});
+
 			run();
 
 			if (isWeChatInAppBrowser()) {
@@ -1865,6 +1922,10 @@
 							showFabToast(
 								wxInitLastError || '微信 SDK 初始化中,请稍候再点底部按钮'
 							);
+							return;
+						}
+						if (!isWxOpenLaunchAppSceneSupported()) {
+							showWxCopyLinkEntryTip();
 						}
 					});
 				}