Browse Source

feature 优化支付逻辑

xiahan 2 months ago
parent
commit
42f11ec818
1 changed files with 13 additions and 4 deletions
  1. 13 4
      pages/lijijiaofei/lijijiaofei.js

+ 13 - 4
pages/lijijiaofei/lijijiaofei.js

@@ -172,9 +172,12 @@ Page({
       data: {
         openId: app.globalData.userWxInfo.openid,
         totalAmount: this.data.amount*100,
-        dskey: app.globalData.currentAccountInfo.dsKey
+        dskey: app.globalData.currentAccountInfo.dsKey,
+        zdId: this.data.zdId,
+        userNumber: app.globalData.currentAccountInfo.usernumber
       },
       success: res => {
+        debugger;
         if(res.data.code === '200'){
           wx.hideLoading();
           console.log('预下单', res);
@@ -187,12 +190,19 @@ Page({
             paySign: res.data.data.paymentSign.paySign,
             success: res => {
               console.log('支付结果', res);
-              this.createWeChatPayMentRecord(orderNo,this.data.amount);
+              wx.hideLoading();
+              wx.navigateTo({
+                url: '/pages/jiaofeiSuccess/jiaofeiSuccess',
+              });
+              // setTimeout(function(){
+              //   this.createWeChatPayMentRecord(orderNo,this.data.amount);
+              // },200)
             },
             fail (res) {
               console.log("fail",res);
             },
-            complete: () => {
+            complete: (res) => {
+              console.log("complete",res);
             }
           })
         }else if(res.data.code === '500'){
@@ -410,7 +420,6 @@ Page({
       data: {
         orderNo: orderNo,
         paymentAmount: paymentAmount,
-        zdId: this.data.zdId,
         userNumber: app.globalData.currentAccountInfo.usernumber,
         dsKey: app.globalData.currentAccountInfo.dsKey
       },