|
|
@@ -171,7 +171,6 @@
|
|
|
}
|
|
|
|
|
|
.footer__btn-slot {
|
|
|
- position: relative;
|
|
|
width: 50%;
|
|
|
height: 48px;
|
|
|
margin: 0 auto;
|
|
|
@@ -204,15 +203,11 @@
|
|
|
|
|
|
#launch-btn {
|
|
|
display: none;
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
width: 100%;
|
|
|
height: 48px;
|
|
|
min-height: 48px;
|
|
|
border-radius: 999px;
|
|
|
overflow: hidden;
|
|
|
- z-index: 2;
|
|
|
}
|
|
|
|
|
|
body.is-wechat.wx-jssdk-ready #launch-btn {
|
|
|
@@ -221,7 +216,7 @@
|
|
|
}
|
|
|
|
|
|
body.is-wechat.wx-jssdk-ready #btnContinue {
|
|
|
- pointer-events: none;
|
|
|
+ display: none !important;
|
|
|
}
|
|
|
|
|
|
#openAppToast {
|
|
|
@@ -260,19 +255,32 @@
|
|
|
<script type="text/wxtag-template">
|
|
|
<style>
|
|
|
.wx-open-app-btn {
|
|
|
- display: block;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
width: 100%;
|
|
|
height: 48px;
|
|
|
margin: 0;
|
|
|
padding: 0;
|
|
|
border: none;
|
|
|
border-radius: 999px;
|
|
|
- background: transparent;
|
|
|
+ background: linear-gradient(90deg, #ffb84c 0%, #ff6b3e 100%);
|
|
|
+ box-shadow: 0 4px 16px rgba(255, 107, 62, 0.32);
|
|
|
cursor: pointer;
|
|
|
-webkit-tap-highlight-color: transparent;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+ .wx-open-app-btn__label {
|
|
|
+ display: block;
|
|
|
+ height: 20px;
|
|
|
+ width: auto;
|
|
|
+ max-width: 90%;
|
|
|
+ pointer-events: none;
|
|
|
}
|
|
|
</style>
|
|
|
- <button class="wx-open-app-btn" aria-label="和U宝继续聊"></button>
|
|
|
+ <button class="wx-open-app-btn" aria-label="和U宝继续聊">
|
|
|
+ <img class="wx-open-app-btn__label" src="https://test.ailien.shop/h5/HBuilderProjects/images/uCharts.png" alt="和U宝继续聊" decoding="async">
|
|
|
+ </button>
|
|
|
</script>
|
|
|
</wx-open-launch-app>
|
|
|
</div>
|
|
|
@@ -820,17 +828,20 @@
|
|
|
: "";
|
|
|
console.warn("[wx-open-launch-app]", detail, "extinfo=", tag.getAttribute("extinfo"));
|
|
|
if (/launch:fail_check/i.test(errMsg)) {
|
|
|
+ document.body.classList.remove("wx-jssdk-ready");
|
|
|
showAppOpenFailTip(
|
|
|
"微信唤起 App 校验失败,请确认开放标签域名与 App 关联配置正确"
|
|
|
);
|
|
|
return;
|
|
|
}
|
|
|
if (/launch:fail/i.test(errMsg)) {
|
|
|
+ document.body.classList.remove("wx-jssdk-ready");
|
|
|
showAppOpenFailTip(
|
|
|
"未能打开 App,请确认已安装最新版「U店在哪」,或从 App 内分享到微信后再打开"
|
|
|
);
|
|
|
return;
|
|
|
}
|
|
|
+ document.body.classList.remove("wx-jssdk-ready");
|
|
|
showAppOpenFailTip(
|
|
|
errMsg
|
|
|
? "未能打开 App:" + errMsg
|
|
|
@@ -994,10 +1005,22 @@
|
|
|
|
|
|
function tryOpenApp() {
|
|
|
if (isWeChatInAppBrowser()) {
|
|
|
+ if (weChatJssdkConfigured && document.body.classList.contains("wx-jssdk-ready")) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (!weChatJssdkConfigured) {
|
|
|
- showFabToast(wxInitLastError || "微信 SDK 初始化中,请稍候再点底部按钮");
|
|
|
- initWeChatOpenLaunchApp(true);
|
|
|
+ showFabToast("正在初始化,请稍候…");
|
|
|
+ initWeChatOpenLaunchApp(true).then(function (ok) {
|
|
|
+ if (ok) {
|
|
|
+ document.body.classList.add("wx-jssdk-ready");
|
|
|
+ showFabToast("请再次点击打开 App");
|
|
|
+ } else {
|
|
|
+ showAppOpenFailTip(wxInitLastError || "微信初始化失败");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
+ document.body.classList.add("wx-jssdk-ready");
|
|
|
return;
|
|
|
}
|
|
|
tryOpenHBuilderAppViaScheme();
|
|
|
@@ -1009,6 +1032,8 @@
|
|
|
|
|
|
document.addEventListener("WeixinOpenTagsError", function (e) {
|
|
|
console.warn("[WeixinOpenTagsError]", e && e.detail);
|
|
|
+ document.body.classList.remove("wx-jssdk-ready");
|
|
|
+ showFabToast("微信开放标签加载失败,请稍候再试");
|
|
|
});
|
|
|
|
|
|
var sharePayload = parsePayload();
|