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 { - +
+
@@ -164,7 +180,7 @@ class Qrcode extends React.Component {
-
+
作者ciaochaosCPunisher
Copyright © {currentYear} QRBTF. All rights reserved.
浙 ICP 备 19005869 号