Ver Fonte

修改二维码扫描

XWookey há 3 anos atrás
pai
commit
bc874fade0
2 ficheiros alterados com 6 adições e 1 exclusões
  1. 0 1
      app.js
  2. 6 0
      pages/index/index.js

+ 0 - 1
app.js

@@ -3,7 +3,6 @@ let wechat = require('./utils/wechat.js');
 let log = require('./utils/log.js');
 App({
   globalData: {
-    //postHeadAgreement: 'https://charging.busilinq.com/cloud/chargapi',
     postHeadAgreement: 'https://cdglyy.pjnes.com/cloud/chargapi',
     helpPhoneNum: '4009608068',
     version:'2.0'

+ 6 - 0
pages/index/index.js

@@ -72,6 +72,9 @@ Page({
     let charePileId = decodeURIComponent(q).replace("https://cdgl.pjnes.com/", "");
     //console.log(charePileId);
     log.info('[首页]', '[微信扫一扫]', { 'q': q });
+    if(!charePileId){
+      charePileId = "0"
+    }
     if (charePileId) {
       let userInfo = wx.getStorageSync('userInfo');
       let isLogin = wx.getStorageSync('isLogin');
@@ -607,6 +610,9 @@ Page({
                 //console.log(d);
                 //兼容标准格式hlht://202001022222220101.330414214二维码
                 let scanResult = d.result;
+                if(scanResult || scanResult == ""){
+                  scanResult="*"
+                }
                 console.log(scanResult);
                 if (scanResult.startsWith("hlht://") || scanResult.startsWith("HLHT://")){
                   scanResult = scanResult.substring(7, scanResult.indexOf("."));