Procházet zdrojové kódy

还原不调getWxConfig接口

zhuli před 1 týdnem
rodič
revize
40d9d8183e
1 změnil soubory, kde provedl 23 přidání a 661 odebrání
  1. 23 661
      HBuilderProjects/shareIndex.html

+ 23 - 661
HBuilderProjects/shareIndex.html

@@ -22,10 +22,6 @@
 			padding: 0;
 			box-sizing: border-box;
 		}
-		#staffGroupsMount{
-			height: 202px;
-			overflow: hidden;
-		}
 
 		html {
 			font-size: 16px;
@@ -469,34 +465,10 @@
 			pointer-events: none;
 		}
 
-		.fab-dock__slot {
-			width: 100%;
-			max-width: 320px;
-			height: 48px;
-			margin: 0 auto;
+		.fab-wrap .fab {
 			pointer-events: auto;
 		}
 
-		#openApp img {
-			pointer-events: none;
-		}
-
-		/* 微信内:wx.config 成功后只显示开放标签按钮(官方用法) */
-		#launch-btn {
-			display: none;
-			width: 100%;
-			height: 48px;
-			min-height: 48px;
-		}
-
-		body.is-wechat.wx-jssdk-ready #launch-btn {
-			display: block;
-		}
-
-		body.is-wechat.wx-jssdk-ready #openApp {
-			display: none !important;
-		}
-
 		.fab {
 			display: flex;
 			align-items: center;
@@ -532,28 +504,6 @@
 			opacity: 0.2;
 		}
 
-		#openAppToast {
-			display: none;
-			position: fixed;
-			left: 16px;
-			right: 16px;
-			bottom: calc(72px + var(--safe-bottom));
-			z-index: 10001;
-			padding: 10px 14px;
-			font-size: 13px;
-			line-height: 1.45;
-			color: #fff;
-			text-align: center;
-			background: rgba(0, 0, 0, 0.78);
-			border-radius: 8px;
-			pointer-events: none;
-			word-break: break-all;
-		}
-
-		#openApp {
-			touch-action: manipulation;
-		}
-
 		/* 营销活动(getStoreCouponList.marketingList) */
 		.marketing-section {
 			padding: 4px 15px 20px;
@@ -1017,43 +967,15 @@
 			<div id="staffGroupsMount"></div>
 		</section>
 	</div>
-	<div id="openAppToast" role="status" aria-live="polite"></div>
-	<div id="fabDock" class="fab-wrap">
-		<div class="fab-dock__slot">
-			<!-- 非微信 / 微信 JSSDK 未就绪:scheme 唤起 -->
+	<div id="shareBelowContentEl">
+		<div class="fab-wrap">
 			<button type="button" class="fab" id="openApp">
 				<img src="images/uBtn.png" alt="APP内打开" decoding="async">
 			</button>
-			<!-- 微信内 wx.config 成功后:仅此按钮可唤起 App(须用户直接点击) -->
-			<wx-open-launch-app id="launch-btn" appid="wxf5f1efe3a9f5012e" extinfo="">
-				<script type="text/wxtag-template">
-					<style>
-						.wx-open-app-btn {
-							display: block;
-							width: 100%;
-							height: 48px;
-							margin: 0;
-							padding: 0;
-							border: none;
-							background: transparent;
-							cursor: pointer;
-						}
-						.wx-open-app-btn img {
-							display: block;
-							width: 100%;
-							height: 48px;
-							object-fit: contain;
-						}
-					</style>
-					<button class="wx-open-app-btn" aria-label="APP内打开">
-						<img src="https://test.ailien.shop/h5/HBuilderProjects/images/uBtn.png" alt="APP内打开" />
-					</button>
-				</script>
-			</wx-open-launch-app>
+			<div class="home-indicator" aria-hidden="true"></div>
 		</div>
-		<div class="home-indicator" aria-hidden="true"></div>
 	</div>
-	<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
+
 	<script>
 	(function () {
 		'use strict';
@@ -1072,45 +994,7 @@
 		 * 注意:用 file:// 打开本页时,浏览器可能因 CORS 拦截跨域请求。
 		 * 请用本地 HTTP 打开(如 VS Code Live Server、npx serve)或让后端为 H5 域名配置 Access-Control-Allow-Origin。
 		 */
-		/** 按 H5 域名选择 alienStore 网关,避免 uat 页请求 test 接口导致签名环境不一致 */
-		var WECHAT_MP_APP_ID_BY_HOST = {
-			'test.ailien.shop': 'wx412792c77f47babd',
-			'uat.ailien.shop': 'wx5598889b28511717'
-		};
-
-		/**
-		 * 微信 JSSDK(服务号「麦丽恩严U店」)— 仅用于 wx.config 签名,Secret 只放后端
-		 * 后端 GET {resolveApiBase()}/wx/getWxConfig 须用对应环境服务号 AppId + AppSecret 对入参 url 签名
-		 */
-		var WECHAT_MP_APP_ID = 'wx412792c77f47babd';
-		/** 微信开放标签 wx-open-launch-app — 移动应用「U店在哪」AppID(不是服务号 ID) */
-		var WECHAT_OPEN_APP_ID = 'wxf5f1efe3a9f5012e';
-		var WECHAT_GET_WX_CONFIG_PATH = '/wx/getWxConfig';
-		var H5_PAGE_BASE_FALLBACK = 'https://test.ailien.shop/h5/HBuilderProjects/';
-		var WX_GET_CONFIG_SIGN_URL = H5_PAGE_BASE_FALLBACK + 'shareIndex.html';
-		var WECHAT_JS_SAFE_HOSTS = ['uat.ailien.shop', 'test.ailien.shop'];
-
-		function resolveApiBase() {
-			var host = (location.hostname || '').toLowerCase();
-			if (host === 'uat.ailien.shop') return 'https://uat.ailien.shop/alienStore';
-			if (host === 'test.ailien.shop' || host === 'www.ailien.shop') {
-				return 'https://test.ailien.shop/alienStore';
-			}
-			return 'https://test.ailien.shop/alienStore';
-		}
-
-		function getWeChatMpAppId() {
-			var fromQuery = String(q('wxMpAppId') || '').trim();
-			if (fromQuery) return fromQuery;
-			var host = (location.hostname || '').toLowerCase();
-			if (WECHAT_MP_APP_ID_BY_HOST[host]) return WECHAT_MP_APP_ID_BY_HOST[host];
-			return WECHAT_MP_APP_ID;
-		}
-		var weChatJssdkConfigured = false;
-		var wxConfigSignRetriedBaseUrl = false;
-		var wxSignUrlFullBeforeStrip = '';
-		var wxInitLastError = '';
-		var wxJssdkInitPromise = null;
+		var API_BASE = 'https://test.ailien.shop/alienStore';
 
 		/**
 		 * 关店(businessStatus=99)更多推荐:POST …/ai/multimodal-services/api/v1/search/global/store-recommend
@@ -1126,9 +1010,9 @@
 			var cityRaw = (q('userCity') || q('city') || '').trim();
 			return {
 				userLat:
-					latRaw !== '' && !isNaN(Number(latRaw)) ? Number(latRaw) : 38.925747,
+					latRaw !== '' && !isNaN(Number(latRaw)) ? Number(latRaw) : 38.925537,
 				userLng:
-					lonRaw !== '' && !isNaN(Number(lonRaw)) ? Number(lonRaw) : 121.662531,
+					lonRaw !== '' && !isNaN(Number(lonRaw)) ? Number(lonRaw) : 121.662209,
 				userCity: cityRaw !== '' ? cityRaw : '大连市'
 			};
 		}
@@ -1196,486 +1080,6 @@
 			return /MicroMessenger/i.test(navigator.userAgent || '');
 		}
 
-		function readQueryParam(name) {
-			try {
-				var v = new URLSearchParams(location.search || '').get(name);
-				return v == null ? '' : String(v);
-			} catch (eQ) {
-				return '';
-			}
-		}
-
-		function isWxDebugOn() {
-			return readQueryParam('wxDebug') === '1';
-		}
-
-		/** PC 联调:测试域 / localhost 自动开启;也可显式 ?wxForce=1 */
-		function isWxForceDebug() {
-			return readQueryParam('wxForce') === '1';
-		}
-
-		function isWxConfigOnClickDebug() {
-			return readQueryParam('wxConfigOnClick') === '1';
-		}
-
-		function isWxPcAutoDebugHost() {
-			var h = (location.hostname || '').toLowerCase();
-			if (h === 'localhost' || h === '127.0.0.1') return true;
-			for (var i = 0; i < WECHAT_JS_SAFE_HOSTS.length; i++) {
-				if (WECHAT_JS_SAFE_HOSTS[i] === h) return true;
-			}
-			return false;
-		}
-
-		function isWxPcBrowser() {
-			return !isWeChatInAppBrowser();
-		}
-
-		function shouldInitWeChatJssdkOnLoad() {
-			if (isWeChatInAppBrowser()) return true;
-			return isWxForceDebug() || isWxPcAutoDebugHost();
-		}
-
-		function shouldFetchWxConfig(fromUserClick) {
-			if (isWeChatInAppBrowser()) return true;
-			if (fromUserClick) return true;
-			return isWxForceDebug() || isWxPcAutoDebugHost();
-		}
-
-		function getWxSignUrlFull() {
-			var forced = String(q('wxSignUrl') || '').trim();
-			if (forced) return forced.split('#')[0];
-			if (location.origin && /^https?:/i.test(location.origin)) {
-				return (
-					location.origin +
-					(location.pathname || '/h5/HBuilderProjects/shareIndex.html') +
-					(location.search || '')
-				);
-			}
-			var href = String(location.href || '').split('#')[0];
-			if (href && href.indexOf('file:') !== 0) return href;
-			return WX_GET_CONFIG_SIGN_URL;
-		}
-
-		function getWxSignUrlBase() {
-			if (location.origin && /^https?:/i.test(location.origin)) {
-				return location.origin + (location.pathname || '/h5/HBuilderProjects/shareIndex.html');
-			}
-			return WX_GET_CONFIG_SIGN_URL;
-		}
-
-		function getWxConfigSignUrl() {
-			if (String(q('wxSignBaseOnly') || '') === '1') return getWxSignUrlBase();
-			return getWxSignUrlFull();
-		}
-
-		function syncBrowserUrlForWxSign(signUrl) {
-			var target = String(signUrl || '').split('#')[0];
-			if (!target) return;
-			var current = String(location.href || '').split('#')[0];
-			if (current !== target) {
-				history.replaceState(history.state, document.title, target + (location.hash || ''));
-			}
-		}
-
-		function buildWxGetConfigRequestUrl(signPageUrl) {
-			var qs =
-				'url=' +
-				encodeURIComponent(signPageUrl || getWxConfigSignUrl()) +
-				'&mpAppId=' +
-				encodeURIComponent(getWeChatMpAppId());
-			return (
-				resolveApiBase().replace(/\/$/, '') +
-				WECHAT_GET_WX_CONFIG_PATH +
-				'?' +
-				qs
-			);
-		}
-
-		function resolveWxConfigAppIdFromSignData(d) {
-			if (!d || typeof d !== 'object') return getWeChatMpAppId();
-			var mp =
-				d.mpAppId ||
-				d.mpAppid ||
-				d.officialAppId ||
-				d.gzhAppId ||
-				d.serviceAppId;
-			if (mp != null && String(mp).trim() !== '') return String(mp).trim();
-			var fromQuery = String(q('wxMpAppId') || '').trim();
-			if (fromQuery) return fromQuery;
-			var raw = d.appId || d.appid || d.wxAppId;
-			var rawId = raw != null ? String(raw).trim() : '';
-			if (rawId && rawId !== WECHAT_OPEN_APP_ID) return rawId;
-			return getWeChatMpAppId();
-		}
-
-		function normalizeWxJssdkSignPayload(res, signUrlUsed) {
-			if (!res || typeof res !== 'object') return null;
-			var d = res.data != null && typeof res.data === 'object' ? res.data : res;
-			if (!d || typeof d !== 'object') return null;
-			var appId = resolveWxConfigAppIdFromSignData(d);
-			var timestamp = d.timestamp != null ? d.timestamp : d.timeStamp;
-			var nonceStr = d.nonceStr || d.noncestr || d.nonce;
-			var signature = d.signature || d.sign;
-			if (!appId || timestamp == null || !nonceStr || !signature) return null;
-			var signedUrl =
-				d.signUrl != null && String(d.signUrl).trim() !== ''
-					? String(d.signUrl).trim().split('#')[0]
-					: signUrlUsed != null && String(signUrlUsed).trim() !== ''
-						? String(signUrlUsed).trim().split('#')[0]
-						: '';
-			var backendAppId = String(
-				(d.appId || d.appid || d.wxAppId || '').trim()
-			);
-			return {
-				appId: String(appId),
-				backendAppId: backendAppId,
-				timestamp: Number(timestamp),
-				nonceStr: String(nonceStr),
-				signature: String(signature),
-				signUrl: signedUrl
-			};
-		}
-
-		function getWxErrMsg(err) {
-			if (!err) return '';
-			if (err.errMsg) return String(err.errMsg);
-			if (typeof err === 'string') return err;
-			try {
-				return JSON.stringify(err);
-			} catch (e) {
-				return String(err);
-			}
-		}
-
-		function formatWxConfigErrorTip(err, signPageUrl) {
-			var errMsg = getWxErrMsg(err);
-			var tip = '微信 JSSDK 配置失败';
-			if (/invalid signature/i.test(errMsg)) {
-				return (
-					tip +
-					':签名无效。地址栏:' +
-					String(location.href || '').split('#')[0] +
-					';签名 url:' +
-					(signPageUrl || getWxSignUrlFull())
-				);
-			}
-			if (/require\s*subscribe/i.test(errMsg)) {
-				return tip + ':' + errMsg + '(服务号需用户已关注)';
-			}
-			return errMsg ? tip + ':' + errMsg : tip;
-		}
-
-		function buildWeChatLaunchExtinfo() {
-			var pageUrl = getWxSignUrlFull();
-			if (pageUrl && pageUrl.length <= 1024) return pageUrl;
-			var path = getAppUniPathForBusinessSection().replace(/^\//, '');
-			var qs = buildAppOpenQueryString().replace(/^\?/, '');
-			try {
-				var pack = JSON.stringify({ path: path, query: qs, h5: pageUrl });
-				if (pack.length <= 1024) return pack;
-			} catch (eJ) {}
-			var deep = buildAppDeepLink();
-			return deep.length <= 1024 ? deep : (pageUrl || deep).slice(0, 1024);
-		}
-
-		function setWxInitError(msg) {
-			wxInitLastError = String(msg || '').trim();
-			if (wxInitLastError) console.warn('[wx]', wxInitLastError);
-		}
-
-		function fetchWeChatJssdkSign(signPageUrl) {
-			signPageUrl = signPageUrl || getWxConfigSignUrl();
-			var url = buildWxGetConfigRequestUrl(signPageUrl);
-			console.log('[wx] GET getWxConfig →', url);
-			return fetch(url, {
-				method: 'GET',
-				mode: 'cors',
-				credentials: 'omit',
-				headers: { Accept: 'application/json' }
-			})
-				.then(function (r) {
-					if (r.ok) return r.json();
-					return r
-						.text()
-						.catch(function () {
-							return '';
-						})
-						.then(function (text) {
-							var hint = '';
-							try {
-								var j = JSON.parse(text);
-								hint = j.msg || j.message || '';
-							} catch (eP) {
-								if (text) hint = text.slice(0, 120);
-							}
-							throw new Error('getWxConfig HTTP ' + r.status + (hint ? ':' + hint : ''));
-						});
-				})
-				.then(function (res) {
-					if (res && res.code != null) {
-						var c = Number(res.code);
-						if (c !== 200 && c !== 0 && res.success !== true) {
-							throw new Error(res.msg || res.message || 'getWxConfig code ' + c);
-						}
-					}
-					var pack = normalizeWxJssdkSignPayload(res, signPageUrl);
-					if (!pack) {
-						console.warn('[wx] getWxConfig 响应字段不全', res, 'signUrl=', signPageUrl);
-						throw new Error(
-							'getWxConfig 缺少 appId/timestamp/nonceStr/signature(见控制台原始响应)'
-						);
-					}
-					console.log('[wx] getWxConfig OK', {
-						appId: pack.appId,
-						signUrl: pack.signUrl || signPageUrl
-					});
-					return pack;
-				});
-		}
-
-		function runWxConfig(sign, urlForWx) {
-			return new Promise(function (resolve, reject) {
-				wx.config({
-					debug: isWxDebugOn(),
-					appId: "wx412792c77f47babd",
-					timestamp: sign.timestamp,
-					nonceStr: sign.nonceStr,
-					signature: sign.signature,
-					jsApiList: [],
-					openTagList: ['wx-open-launch-app']
-				});
-				wx.ready(function () {
-					weChatJssdkConfigured = true;
-					document.body.classList.add('wx-jssdk-ready');
-					if (wxSignUrlFullBeforeStrip) {
-						history.replaceState(
-							history.state,
-							document.title,
-							wxSignUrlFullBeforeStrip + (location.hash || '')
-						);
-						wxSignUrlFullBeforeStrip = '';
-					}
-					refreshWxLaunchTagAttrs();
-					resolve(true);
-				});
-				wx.error(function (err) {
-					weChatJssdkConfigured = false;
-					document.body.classList.remove('wx-jssdk-ready');
-					reject(err);
-				});
-			});
-		}
-
-		function applyWxConfig(sign, signPageUrl, options) {
-			options = options || {};
-			var urlForWx =
-				sign.signUrl && String(sign.signUrl).trim() !== ''
-					? String(sign.signUrl).trim()
-					: signPageUrl;
-			syncBrowserUrlForWxSign(urlForWx);
-			return runWxConfig(sign, urlForWx).catch(function (err) {
-				wxJssdkInitPromise = null;
-				var errMsg = getWxErrMsg(err);
-				setWxInitError(formatWxConfigErrorTip(err, urlForWx));
-				if (isWxDebugOn()) window.alert(wxInitLastError);
-				console.warn('[wx.config]', errMsg, urlForWx, 'appId=', sign.appId);
-
-				var backendAppId = String(sign.backendAppId || '').trim();
-				if (
-					!/invalid signature/i.test(errMsg) ||
-					options.triedBackendAppId ||
-					!backendAppId ||
-					backendAppId === sign.appId
-				) {
-					var baseUrl = getWxSignUrlBase();
-					var fullUrl = getWxSignUrlFull();
-					if (
-						!/invalid signature/i.test(errMsg) ||
-						wxConfigSignRetriedBaseUrl ||
-						baseUrl === fullUrl ||
-						urlForWx === baseUrl
-					) {
-						return false;
-					}
-					wxConfigSignRetriedBaseUrl = true;
-					wxSignUrlFullBeforeStrip = fullUrl;
-					return fetchWeChatJssdkSign(baseUrl)
-						.then(function (sign2) {
-							if (!sign2) return false;
-							return applyWxConfig(sign2, baseUrl, options);
-						})
-						.catch(function () {
-							return false;
-						});
-				}
-
-				console.warn(
-					'[wx] invalid signature,改用后端返回 appId 重试 wx.config:',
-					backendAppId
-				);
-				var altSign = {
-					appId: backendAppId,
-					backendAppId: backendAppId,
-					timestamp: sign.timestamp,
-					nonceStr: sign.nonceStr,
-					signature: sign.signature,
-					signUrl: sign.signUrl
-				};
-				return applyWxConfig(altSign, signPageUrl, {
-					triedBackendAppId: true
-				});
-			});
-		}
-
-		function refreshWxLaunchTagAttrs() {
-			var tag = document.getElementById('launch-btn');
-			if (!tag) return;
-			try {
-				tag.setAttribute('appid', WECHAT_OPEN_APP_ID);
-				tag.setAttribute('extinfo', buildWeChatLaunchExtinfo());
-			} catch (eA) {}
-		}
-
-		function bindWeChatLaunchTagEvents() {
-			var tag = document.getElementById('launch-btn');
-			if (!tag || tag._wxLaunchBound) return;
-			tag._wxLaunchBound = true;
-			refreshWxLaunchTagAttrs();
-			tag.addEventListener('launch', function () {
-				console.log('[wx-open-launch-app] launch ok');
-				showFabToast('正在打开 U店在哪…');
-			});
-			tag.addEventListener('error', function (e) {
-				var detail = e && e.detail;
-				var errMsg =
-					detail && detail.errMsg
-						? String(detail.errMsg)
-						: detail && detail.errmsg
-							? String(detail.errmsg)
-							: '';
-				console.warn('[wx-open-launch-app]', detail);
-				showAppOpenFailTip(
-					errMsg
-						? '未能唤起 App:' + errMsg
-						: '未能唤起 App,请确认已安装 U店在哪,且开放平台已绑定服务号与移动应用。'
-				);
-			});
-		}
-
-		function initWeChatOpenLaunchApp(fromUserClick) {
-			if (!shouldFetchWxConfig(!!fromUserClick)) {
-				console.log('[wx] 未调用 getWxConfig');
-				return Promise.resolve(false);
-			}
-			if (isWxPcBrowser()) {
-				console.warn(
-					'[wx] PC:请求 getWxConfig' + (fromUserClick ? '(按钮)' : '(进页)')
-				);
-			}
-			if (wxJssdkInitPromise && !fromUserClick) return wxJssdkInitPromise;
-
-			wxConfigSignRetriedBaseUrl = false;
-			wxInitLastError = '';
-			var signPageUrl = getWxConfigSignUrl();
-
-			bindWeChatLaunchTagEvents();
-			wxJssdkInitPromise = fetchWeChatJssdkSign(signPageUrl)
-				.then(function (sign) {
-					if (!sign) {
-						setWxInitError('getWxConfig 返回为空');
-						return false;
-					}
-					var expectedMpId = getWeChatMpAppId();
-					if (
-						sign.backendAppId === WECHAT_OPEN_APP_ID &&
-						sign.appId === expectedMpId
-					) {
-						setWxInitError(
-							'后端 getWxConfig 返回了移动应用 appId(' +
-								WECHAT_OPEN_APP_ID +
-								'),须改为用服务号 ' +
-								expectedMpId +
-								' 的 AppSecret 对 url 签名'
-						);
-					} else if (sign.appId !== expectedMpId && sign.backendAppId !== expectedMpId) {
-						setWxInitError(
-							'后端 appId=' +
-								sign.appId +
-								',当前环境服务号应为 ' +
-								expectedMpId
-						);
-					}
-					if (typeof wx === 'undefined') {
-						if (isWxPcBrowser()) {
-							console.log('[wx] PC getWxConfig 成功', sign);
-							return true;
-						}
-						setWxInitError('jweixin.js 未加载');
-						return false;
-					}
-					return applyWxConfig(sign, signPageUrl).then(function (ok) {
-						if (!ok && !wxInitLastError) {
-							setWxInitError('wx.config 失败,可加 ?wxDebug=1');
-						}
-						return ok;
-					});
-				})
-				.catch(function (e) {
-					var msg = e && e.message ? e.message : 'getWxConfig 请求失败';
-					setWxInitError(msg);
-					console.warn('[wx] fetchWeChatJssdkSign failed', msg, 'signUrl=', signPageUrl);
-					if (isWeChatInAppBrowser() && isWxDebugOn()) window.alert(msg);
-					return false;
-				})
-				.finally(function () {
-					if (!weChatJssdkConfigured) wxJssdkInitPromise = null;
-				});
-
-			return wxJssdkInitPromise;
-		}
-
-		/** 进页即尝试拉签名;jweixin 晚到时自动重试 */
-		function scheduleWeChatJssdkBootstrap() {
-			if (!shouldInitWeChatJssdkOnLoad()) return;
-			var attempts = 0;
-			function tick() {
-				attempts += 1;
-				if (weChatJssdkConfigured) return;
-				initWeChatOpenLaunchApp();
-				if (!weChatJssdkConfigured && attempts < 8 && typeof wx === 'undefined') {
-					setTimeout(tick, 400);
-				}
-			}
-			tick();
-		}
-
-		function showFabToast(msg, ms) {
-			var tip = String(msg || '').trim();
-			if (!tip) return;
-			var el = document.getElementById('openAppToast');
-			if (el) {
-				el.textContent = tip;
-				el.style.display = 'block';
-				if (showFabToast._t) clearTimeout(showFabToast._t);
-				showFabToast._t = setTimeout(function () {
-					el.style.display = 'none';
-				}, ms || 2800);
-			}
-			console.log('[openApp]', tip);
-		}
-
-		function showAppOpenFailTip(msg) {
-			var tip = msg || '未能打开 App,请确认已安装最新版「U店在哪」。';
-			if (typeof uni !== 'undefined' && typeof uni.showToast === 'function') {
-				uni.showToast({ title: tip, icon: 'none', duration: 2800 });
-			} else if (isWeChatInAppBrowser()) {
-				window.alert(tip);
-			} else {
-				console.warn('[openApp]', tip);
-			}
-		}
-
 		/** 部分 WebView 对 location.href 拦截,用 a 标签点击略稳 */
 		function launchAppDeepLink(deepLink) {
 			
@@ -1696,38 +1100,7 @@
 		 * 有 plus:检测 App 是否安装后 openURL;深链形如 shopro://{APP_UNI_STORE_PATH}?…
 		 * 系统浏览器:唤起 scheme;微信内常拦截 scheme,需「在浏览器打开」。
 		 */
-		function tryFetchWxConfigOnPcClick() {
-			if (!isWxPcBrowser()) return Promise.resolve(false);
-			showFabToast('正在请求 getWxConfig…');
-			wxJssdkInitPromise = null;
-			return initWeChatOpenLaunchApp(true).then(function (ok) {
-				if (ok) {
-					showFabToast(
-						weChatJssdkConfigured
-							? 'getWxConfig 成功,wx.config 已就绪'
-							: 'getWxConfig 成功'
-					);
-				} else {
-					showFabToast(wxInitLastError || 'getWxConfig 失败');
-				}
-				return ok;
-			});
-		}
-
 		function tryOpenHBuilderApp() {
-			/* 微信内须直接点击 wx-open-launch-app,scheme 会被拦截 */
-			if (isWeChatInAppBrowser()) return;
-
-			tryFetchWxConfigOnPcClick().then(function () {
-				if (isWxConfigOnClickDebug() && !isWxForceDebug() && !isWxPcAutoDebugHost()) {
-					return;
-				}
-				tryOpenHBuilderAppViaScheme();
-			});
-		}
-
-		function tryOpenHBuilderAppViaScheme() {
-			showFabToast('正在打开 U店在哪…');
 			var deepLink = buildAppDeepLink();
 
 			if (typeof plus !== 'undefined' && plus.runtime) {
@@ -1772,6 +1145,10 @@
 			document.addEventListener('visibilitychange', onVis);
 			window.addEventListener('pagehide', onHide);
 
+			if (isWeChatInAppBrowser()) {
+				window.alert('若点击后无法打开 App:请先点右上角「···」,选择「在浏览器中打开」,再点「APP内打开」。');
+			}
+
 			try {
 				launchAppDeepLink(deepLink);
 			} catch (e3) {
@@ -1781,6 +1158,10 @@
 			}
 
 			window.setTimeout(function () {
+				if (done) return;
+				if (document.visibilityState === 'visible' && Date.now() - t0 < 3500) {
+					showDownloadTip();
+				}
 				finish();
 			}, 2600);
 		}
@@ -1808,7 +1189,7 @@
 		}
 
 		function apiFetch(path) {
-			return fetch(resolveApiBase() + path, {
+			return fetch(API_BASE + path, {
 				method: 'GET',
 				mode: 'cors',
 				credentials: 'omit',
@@ -2928,34 +2309,15 @@
 		}
 
 		function boot() {
-			var launchTag = document.getElementById('launch-btn');
-			if (launchTag) launchTag.setAttribute('appid', WECHAT_OPEN_APP_ID);
-			bindWeChatLaunchTagEvents();
-			if (shouldInitWeChatJssdkOnLoad()) {
-				if (isWeChatInAppBrowser()) document.body.classList.add('is-wechat');
-				if (isWxPcBrowser() && (isWxForceDebug() || isWxPcAutoDebugHost())) {
-					document.body.classList.add('wx-pc-debug');
-				}
-				scheduleWeChatJssdkBootstrap();
-			}
-			if (isWeChatInAppBrowser()) {
-				var openBtnWx = document.getElementById('openApp');
-				if (openBtnWx) {
-					openBtnWx.addEventListener('click', function () {
-						if (!weChatJssdkConfigured) {
-							showFabToast(
-								wxInitLastError || '微信 SDK 初始化中,请稍候再点底部按钮'
-							);
-						}
-					});
-				}
-			} else {
-				var openBtn = document.getElementById('openApp');
-				if (openBtn) openBtn.addEventListener('click', tryOpenHBuilderApp);
-			}
 			run();
 			bindMarketingMore();
 			bindStaffSection();
+			var openBtn = document.getElementById('openApp');
+			if (openBtn) {
+				openBtn.addEventListener('click', function () {
+					tryOpenHBuilderApp();
+				});
+			}
 		}
 
 		if (document.readyState === 'complete') {