Преглед на файлове

fix: update payment QR instructions for WeChat browser users

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Xiaogang Liao преди 1 месец
родител
ревизия
3ad8dc2cf5
променени са 3 файла, в които са добавени 5 реда и са изтрити 3 реда
  1. 2 1
      web/articles/enagic-turmeric.html
  2. 1 1
      web/product-intro/gut-testing.html
  3. 2 1
      web/product-intro/kangen-water.html

+ 2 - 1
web/articles/enagic-turmeric.html

@@ -310,6 +310,7 @@ body{padding-bottom:70px}
 
 <script>
 function submitOrder(amount, productName) {
+  function isWechatBrowser() { return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1; }
   var name = document.getElementById('orderName').value.trim();
   var phone = document.getElementById('orderPhone').value.trim();
   var address = document.getElementById('orderAddress').value.trim();
@@ -377,7 +378,7 @@ function showQrCode(codeUrl, orderNo, productName, amount) {
     '<div style="width:200px;height:200px;margin:0 auto 0.8rem;display:flex;align-items:center;justify-content:center;border-radius:8px;overflow:hidden">' +
       '<img src="/api/payment/qrcode?text=' + encodeURIComponent(codeUrl) + '" alt="支付二维码" style="width:200px;height:200px">' +
     '</div>' +
-    '<p style="font-size:0.8rem;color:#999">打开微信「扫一扫」完成支付</p>' +
+    '<p style="font-size:0.8rem;color:#999">' + (typeof isWechatBrowser === 'function' && isWechatBrowser() ? '请截图保存二维码 → 打开微信扫一扫 → 从相册选择' : '打开微信「扫一扫」完成支付') + '</p>' +
     '<button onclick="this.closest(\'div[style]\').remove()" style="margin-top:0.8rem;padding:0.5rem 2rem;border:1px solid #e2e8f0;border-radius:8px;background:#fff;cursor:pointer">取消支付</button>' +
     '</div>';
   document.body.appendChild(div);

+ 1 - 1
web/product-intro/gut-testing.html

@@ -536,7 +536,7 @@ function showQrCode(codeUrl, orderNo) {
     '<div style="width:200px;height:200px;margin:0 auto 0.8rem;display:flex;align-items:center;justify-content:center;border-radius:8px;overflow:hidden">' +
       '<img src="/api/payment/qrcode?text=' + encodeURIComponent(codeUrl) + '" alt="支付二维码" style="width:200px;height:200px">' +
     '</div>' +
-    '<p style="font-size:0.8rem;color:#999">打开微信「扫一扫」完成支付</p>' +
+    '<p style="font-size:0.8rem;color:#999">' + (isWechatBrowser() ? '请截图保存二维码 → 打开微信扫一扫 → 从相册选择' : '打开微信「扫一扫」完成支付') + '</p>' +
     '<button onclick="this.closest(\'div[style]\').remove()" style="margin-top:0.8rem;padding:0.5rem 2rem;border:1px solid #e2e8f0;border-radius:8px;background:#fff;cursor:pointer">取消支付</button>' +
     '</div>';
   document.body.appendChild(div);

+ 2 - 1
web/product-intro/kangen-water.html

@@ -498,6 +498,7 @@ body{padding-bottom:70px}
 
 <script>
 function submitOrder(amount, productName) {
+  function isWechatBrowser() { return navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1; }
   var name = document.getElementById('orderName').value.trim();
   var phone = document.getElementById('orderPhone').value.trim();
   var address = document.getElementById('orderAddress').value.trim();
@@ -565,7 +566,7 @@ function showQrCode(codeUrl, orderNo, productName, amount) {
     '<div style="width:200px;height:200px;margin:0 auto 0.8rem;display:flex;align-items:center;justify-content:center;border-radius:8px;overflow:hidden">' +
       '<img src="/api/payment/qrcode?text=' + encodeURIComponent(codeUrl) + '" alt="支付二维码" style="width:200px;height:200px">' +
     '</div>' +
-    '<p style="font-size:0.8rem;color:#999">打开微信「扫一扫」完成支付</p>' +
+    '<p style="font-size:0.8rem;color:#999">' + (typeof isWechatBrowser === 'function' && isWechatBrowser() ? '请截图保存二维码 → 打开微信扫一扫 → 从相册选择' : '打开微信「扫一扫」完成支付') + '</p>' +
     '<button onclick="this.closest(\'div[style]\').remove()" style="margin-top:0.8rem;padding:0.5rem 2rem;border:1px solid #e2e8f0;border-radius:8px;background:#fff;cursor:pointer">取消支付</button>' +
     '</div>';
   document.body.appendChild(div);