From eece50c17270fd1a55648e88a39f57f8152d1bfa Mon Sep 17 00:00:00 2001 From: ciaochaos <1272777550@qq.com> Date: Sun, 3 May 2020 17:42:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BE=AE=E4=BF=A1=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E4=B8=AD=E6=97=A0=E6=B3=95=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Qrcode.css | 21 ++++++++++++++------- src/components/Qrcode.js | 20 ++++++++++++++++++-- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/components/Qrcode.css b/src/components/Qrcode.css index 03d7732..5d5c52e 100644 --- a/src/components/Qrcode.css +++ b/src/components/Qrcode.css @@ -319,16 +319,9 @@ table { .Qr-footer { color: #1D1D1F; - font-size: 12px; margin-bottom: -4px; } -@media (min-width: 500px) { - .Qr-footer { - font-size: 14px; - } -} - .Gray { color: #86868B; } @@ -346,3 +339,17 @@ a:hover { text-decoration: underline; } +#wx-message-inner { + margin-top: 20px; +} + +.note-font { + font-size: 12px; +} + +@media (min-width: 500px) { + .note-font { + color: #1D1D1F; + font-size: 14px; + } +} \ No newline at end of file diff --git a/src/components/Qrcode.js b/src/components/Qrcode.js index 415be47..bba7f5d 100644 --- a/src/components/Qrcode.js +++ b/src/components/Qrcode.js @@ -12,6 +12,21 @@ import QrItem from "./QrItem"; const date = new Date(); const currentYear = date.getFullYear(); +window.onload = function(){ + if(isWeiXin()){ + const outer = document.getElementById("wx-message"); + const inner = document.createElement("div"); + inner.className = "note-font"; + inner.id = "wx-message-inner"; + inner.innerHTML = "请在浏览器中打开"; + outer.appendChild(inner); + } +} +function isWeiXin(){ + const ua = window.navigator.userAgent.toLowerCase(); + return ua.match(/MicroMessenger/i) === 'micromessenger'; +} + const styleList = [ {value: "A1", renderer: QrRendererBase}, {value: "A2", renderer: QrRendererRound}, @@ -149,8 +164,9 @@ class Qrcode extends React.Component { - +
+