|
|
@@ -5,6 +5,12 @@
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
|
|
|
<meta name="format-detection" content="telephone=no">
|
|
|
<title>与U宝对话</title>
|
|
|
+ <meta property="og:title" content="和U宝的对话">
|
|
|
+ <meta property="og:description" content="点击查看对话内容">
|
|
|
+ <meta property="og:site_name" content="U店在哪">
|
|
|
+ <meta name="application-name" content="U店在哪">
|
|
|
+ <link rel="icon" type="image/png" href="https://alien-volume.oss-cn-beijing.aliyuncs.com/icon/ubao.png">
|
|
|
+ <link rel="apple-touch-icon" href="https://alien-volume.oss-cn-beijing.aliyuncs.com/icon/ubao.png">
|
|
|
<style>
|
|
|
:root {
|
|
|
--bg: #f4f6fb;
|
|
|
@@ -336,7 +342,37 @@
|
|
|
return html;
|
|
|
}
|
|
|
|
|
|
+ function applyWeixinShareMeta() {
|
|
|
+ var siteName = "U店在哪";
|
|
|
+ var iconUrl =
|
|
|
+ "https://alien-volume.oss-cn-beijing.aliyuncs.com/icon/ubao.png";
|
|
|
+ var setMeta = function (key, content) {
|
|
|
+ var el =
|
|
|
+ document.querySelector('meta[property="' + key + '"]') ||
|
|
|
+ document.querySelector('meta[name="' + key + '"]');
|
|
|
+ if (!el) {
|
|
|
+ el = document.createElement("meta");
|
|
|
+ if (key.indexOf("og:") === 0) {
|
|
|
+ el.setAttribute("property", key);
|
|
|
+ } else {
|
|
|
+ el.setAttribute("name", key);
|
|
|
+ }
|
|
|
+ document.head.appendChild(el);
|
|
|
+ }
|
|
|
+ el.setAttribute("content", content);
|
|
|
+ };
|
|
|
+ setMeta("og:site_name", siteName);
|
|
|
+ setMeta("application-name", siteName);
|
|
|
+ setMeta("og:title", "和U宝的对话");
|
|
|
+ setMeta("og:description", "点击查看对话内容");
|
|
|
+ var links = document.querySelectorAll('link[rel="icon"], link[rel="apple-touch-icon"]');
|
|
|
+ for (var i = 0; i < links.length; i++) {
|
|
|
+ links[i].setAttribute("href", iconUrl);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
function render(data) {
|
|
|
+ applyWeixinShareMeta();
|
|
|
sharePayloadCache = data || null;
|
|
|
var main = document.getElementById("main");
|
|
|
if (!data) {
|