|
@@ -17,6 +17,7 @@
|
|
|
--text: #151515;
|
|
--text: #151515;
|
|
|
--muted: #aaaaaa;
|
|
--muted: #aaaaaa;
|
|
|
--orange: #f47d1f;
|
|
--orange: #f47d1f;
|
|
|
|
|
+ --safe-top: env(safe-area-inset-top, 0px);
|
|
|
--safe-bottom: env(safe-area-inset-bottom, 0px);
|
|
--safe-bottom: env(safe-area-inset-bottom, 0px);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -38,6 +39,57 @@
|
|
|
padding-bottom: calc(92px + var(--safe-bottom));
|
|
padding-bottom: calc(92px + var(--safe-bottom));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .nav {
|
|
|
|
|
+ position: sticky;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 10px 12px;
|
|
|
|
|
+ padding-top: calc(10px + var(--safe-top));
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .nav__close {
|
|
|
|
|
+ width: 36px;
|
|
|
|
|
+ height: 36px;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ font-size: 22px;
|
|
|
|
|
+ line-height: 36px;
|
|
|
|
|
+ color: #151515;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ -webkit-tap-highlight-color: transparent;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .nav__center {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ padding: 0 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .nav__title {
|
|
|
|
|
+ font-size: 15px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #151515;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .nav__url {
|
|
|
|
|
+ margin-top: 2px;
|
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
+ color: var(--muted);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .nav__side {
|
|
|
|
|
+ width: 36px;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.hero {
|
|
.hero {
|
|
|
padding: 16px 15px 0;
|
|
padding: 16px 15px 0;
|
|
|
}
|
|
}
|
|
@@ -83,11 +135,11 @@
|
|
|
max-width: 78%;
|
|
max-width: 78%;
|
|
|
padding: 10px 12px;
|
|
padding: 10px 12px;
|
|
|
background: var(--orange);
|
|
background: var(--orange);
|
|
|
- border-radius: 6px;
|
|
|
|
|
|
|
+ border-radius: 11px;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
font-size: 15px;
|
|
font-size: 15px;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
- line-height: 1.5;
|
|
|
|
|
|
|
+ line-height: 1.47;
|
|
|
white-space: pre-wrap;
|
|
white-space: pre-wrap;
|
|
|
word-break: break-word;
|
|
word-break: break-word;
|
|
|
}
|
|
}
|
|
@@ -208,6 +260,15 @@
|
|
|
</style>
|
|
</style>
|
|
|
</head>
|
|
</head>
|
|
|
<body>
|
|
<body>
|
|
|
|
|
+ <header class="nav">
|
|
|
|
|
+ <button type="button" class="nav__close" id="btnClose" aria-label="关闭">×</button>
|
|
|
|
|
+ <div class="nav__center">
|
|
|
|
|
+ <div class="nav__title" id="navTitle">与AI助手-U宝</div>
|
|
|
|
|
+ <div class="nav__url">www.ailien.shop</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="nav__side"></div>
|
|
|
|
|
+ </header>
|
|
|
|
|
+
|
|
|
<main id="main">
|
|
<main id="main">
|
|
|
<div class="empty">对话内容加载中…</div>
|
|
<div class="empty">对话内容加载中…</div>
|
|
|
</main>
|
|
</main>
|
|
@@ -239,7 +300,7 @@
|
|
|
}
|
|
}
|
|
|
.continue-btn__label {
|
|
.continue-btn__label {
|
|
|
display: block;
|
|
display: block;
|
|
|
- height: 16px;
|
|
|
|
|
|
|
+ height: 20px;
|
|
|
width: auto;
|
|
width: auto;
|
|
|
max-width: 90%;
|
|
max-width: 90%;
|
|
|
pointer-events: none;
|
|
pointer-events: none;
|
|
@@ -331,6 +392,13 @@
|
|
|
return qText + "的讨论";
|
|
return qText + "的讨论";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function formatNavTitle(question) {
|
|
|
|
|
+ var titled = formatDiscussionTitle(question);
|
|
|
|
|
+ var maxLen = 14;
|
|
|
|
|
+ var short = titled.length > maxLen ? titled.slice(0, maxLen) + "..." : titled;
|
|
|
|
|
+ return short + "-U宝";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function formatDate(ts) {
|
|
function formatDate(ts) {
|
|
|
var d = ts ? new Date(Number(ts)) : new Date();
|
|
var d = ts ? new Date(Number(ts)) : new Date();
|
|
|
if (isNaN(d.getTime())) d = new Date();
|
|
if (isNaN(d.getTime())) d = new Date();
|
|
@@ -397,7 +465,9 @@
|
|
|
applyWeixinShareMeta();
|
|
applyWeixinShareMeta();
|
|
|
sharePayloadCache = data || null;
|
|
sharePayloadCache = data || null;
|
|
|
var main = document.getElementById("main");
|
|
var main = document.getElementById("main");
|
|
|
|
|
+ var navTitle = document.getElementById("navTitle");
|
|
|
if (!data) {
|
|
if (!data) {
|
|
|
|
|
+ if (navTitle) navTitle.textContent = "与AI助手-U宝";
|
|
|
main.innerHTML = '<div class="empty">对话内容不存在或链接已失效</div>';
|
|
main.innerHTML = '<div class="empty">对话内容不存在或链接已失效</div>';
|
|
|
refreshWxLaunchTagAttrs();
|
|
refreshWxLaunchTagAttrs();
|
|
|
return;
|
|
return;
|
|
@@ -409,6 +479,7 @@
|
|
|
var pageTitle = formatDiscussionTitle(firstQuestion);
|
|
var pageTitle = formatDiscussionTitle(firstQuestion);
|
|
|
var dateText = formatDate(data.shareTime);
|
|
var dateText = formatDate(data.shareTime);
|
|
|
|
|
|
|
|
|
|
+ if (navTitle) navTitle.textContent = formatNavTitle(firstQuestion);
|
|
|
document.title = pageTitle;
|
|
document.title = pageTitle;
|
|
|
|
|
|
|
|
var bodyHtml =
|
|
var bodyHtml =
|
|
@@ -934,6 +1005,15 @@
|
|
|
bindWeChatLaunchTagEvents();
|
|
bindWeChatLaunchTagEvents();
|
|
|
scheduleWeChatJssdkBootstrap();
|
|
scheduleWeChatJssdkBootstrap();
|
|
|
document.getElementById("btnContinue").addEventListener("click", tryOpenApp);
|
|
document.getElementById("btnContinue").addEventListener("click", tryOpenApp);
|
|
|
|
|
+ document.getElementById("btnClose").addEventListener("click", function () {
|
|
|
|
|
+ if (window.history.length > 1) {
|
|
|
|
|
+ window.history.back();
|
|
|
|
|
+ } else if (typeof WeixinJSBridge !== "undefined") {
|
|
|
|
|
+ WeixinJSBridge.call("closeWindow");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ window.close();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
render(parsePayload());
|
|
render(parsePayload());
|
|
|
})();
|
|
})();
|
|
|
</script>
|
|
</script>
|