Commit 8aa21713a9d024bfc062479d34a6596122c6d597

Authored by liuqimichale
1 parent dc07d4e3

调试微信支付

Showing 2 changed files with 13 additions and 9 deletions
home.html
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
83 <script src="js/config.js?v=0.1"></script> 83 <script src="js/config.js?v=0.1"></script>
84 <script src="js/common.js?v=1.11"></script> 84 <script src="js/common.js?v=1.11"></script>
85 <!--<script src="js/jweixin-1.0.0.js?v=0.1"></script>--> 85 <!--<script src="js/jweixin-1.0.0.js?v=0.1"></script>-->
86 -<script src="js/pay.js?v=0.11320"></script> 86 +<script src="js/pay.js?v=0.320"></script>
87 </body> 87 </body>
88 88
89 </html> 89 </html>
js/pay.js
@@ -277,14 +277,14 @@ var webAppClass = { @@ -277,14 +277,14 @@ var webAppClass = {
277 // wxParams.recordArreaInfos= JSON.stringify([{"orderId":webAppParams.orderId,"orderNotPayFee":_mon*100,"parkId":getQueryString(window.location).parkCode}]); 277 // wxParams.recordArreaInfos= JSON.stringify([{"orderId":webAppParams.orderId,"orderNotPayFee":_mon*100,"parkId":getQueryString(window.location).parkCode}]);
278 // 278 //
279 // //新增end 279 // //新增end
280 -  
281 -  
282 - if (webAppCode == null || webAppCode == "") {//code检测  
283 - alertMsg(appState.codeNullTip);  
284 - $btnObj.style.display = "block";  
285 - $btnLoad.style.display = "none";  
286 - return;  
287 - } 280 + alert('走了微信第一步')
  281 +
  282 + // if (webAppCode == null || webAppCode == "") {//code检测
  283 + // alertMsg(appState.codeNullTip);
  284 + // $btnObj.style.display = "block";
  285 + // $btnLoad.style.display = "none";
  286 + // return;
  287 + // }
288 webAppClass.payAjaxJDK(orderID); 288 webAppClass.payAjaxJDK(orderID);
289 console.log("wxPay");//微信支付 289 console.log("wxPay");//微信支付
290 break; 290 break;
@@ -458,12 +458,15 @@ var webAppClass = { @@ -458,12 +458,15 @@ var webAppClass = {
458 458
459 //1:有code获取OpenId 459 //1:有code获取OpenId
460 postRequest(openIdUrl, codeParams, function (res) { 460 postRequest(openIdUrl, codeParams, function (res) {
  461 + alert('走了微信接口')
461 //alert(JSON.stringify(res)); 462 //alert(JSON.stringify(res));
462 if (res.code == 0) { 463 if (res.code == 0) {
  464 + alert('走了微信接口为0')
463 //alert(res.data); 465 //alert(res.data);
464 webAppClass.getPayParams(res.data, orderID); 466 webAppClass.getPayParams(res.data, orderID);
465 } 467 }
466 else if (res.code == 40163) {//code been used, hints[重复code问题] 468 else if (res.code == 40163) {//code been used, hints[重复code问题]
  469 + alert('走了微信接口不为0')
467 alertMsg(appState.codeNullTip); 470 alertMsg(appState.codeNullTip);
468 console.log(res.message); 471 console.log(res.message);
469 $btnObj.style.display = "block"; 472 $btnObj.style.display = "block";
@@ -510,6 +513,7 @@ var webAppClass = { @@ -510,6 +513,7 @@ var webAppClass = {
510 var payParamsUrl = webAppRoot + window.webAppH5.wxPayServer; 513 var payParamsUrl = webAppRoot + window.webAppH5.wxPayServer;
511 //alert(payParamsUrl);alert(orderID); 514 //alert(payParamsUrl);alert(orderID);
512 postRequest(payParamsUrl, wxParams, function (res) { 515 postRequest(payParamsUrl, wxParams, function (res) {
  516 + alert('走了微信支付接口')
513 $btnObj.style.display = "block"; 517 $btnObj.style.display = "block";
514 $btnLoad.style.display = "none"; 518 $btnLoad.style.display = "none";
515 //debugger; 519 //debugger;