wangkaiyue před 5 roky
rodič
revize
1da3a3f071

+ 18 - 11
src/web/templates/weixin/dataExport/dataExport_toMyOrder.html

@@ -119,30 +119,37 @@
         $.post("/jypay/wx/getWxjsPayParam", {"orderCode": ordercode}, function (res) {
             gopayIndex = $(e).parent().parent().index();
             if (res.success) {
-                newBridgeReady(res, dotype);
+                newBridgeReady(res.data, dotype);
+            }else{
+              weui.toast(res.errMsg, {
+                  duration: 2000,
+                  className: 'custom-toast',
+              });
             }
         });
     }
 
     //调用微信支付接口
-    function newBridgeReady(res, dotype) {
+    function newBridgeReady(data, dotype) {
+        var payparam=JSON.parse(data.res)
+        console.log(typeof(payparam),payparam["appId"])
         WeixinJSBridge.invoke('getBrandWCPayRequest', {
-                "appId": res["appId"],
-                "timeStamp": res["timestamp"],
-                "nonceStr": res["nonceStr"],
-                "package": res["prepayId"],
-                "signType": res["signType"],
-                "paySign": res["sign"]
+                "appId": payparam["appId"],
+                "timeStamp": payparam["timestamp"],
+                "nonceStr": payparam["nonceStr"],
+                "package": payparam["prepayId"],
+                "signType": payparam["signType"],
+                "paySign": payparam["sign"]
             },
             function (r) {
                 if (r.err_msg === "get_brand_wcpay_request:ok") {
                     setTimeout(function () {
                         if (dotype === "dataexport") {
-                            window.location.href = "/front/wx_dataExport/paySuccessPage?orderCode=" + r.orderCode;
+                            window.location.href = "/front/wx_dataExport/paySuccessPage?orderCode=" + data.orderCode;
                         } else if (dotype === "vip") {
-                            window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode=" + r.orderCode);
+                            window.location.replace("/front/vipsubscribe/toPaySuccessPage?orderCode=" + data.orderCode);
                         } else if (dotype === "onlineCourse") {
-                            window.location.replace("/jyxsapp/paySucss?code=" + r.orderCode);
+                            window.location.replace("/jyxsapp/paySucss?code=" + data.orderCode);
                         }
                     }, 500)
                 } else if (r.err_msg === "get_brand_wcpay_request:cancel") {