Переглянути джерело

添加了登录验证,创建订单添加微信登录

rong air 4 роки тому
батько
коміт
b64b53c1e2
1 змінених файлів з 38 додано та 34 видалено
  1. 38 34
      src/pages/user_center/recharge/index.vue

+ 38 - 34
src/pages/user_center/recharge/index.vue

@@ -315,37 +315,46 @@ export default {
         buy_num: 1
       }
 
-      createOrder($params).then((res) => {
-          let $data = res.data
-          let $payment = $data.data
-          $this.order_sn = $payment['sn']
-          $this.payment_info = $payment
-          wx.requestPayment({
-            timeStamp: $payment.timeStamp,
-            nonceStr: $payment.nonceStr,
-            package: $payment.package,
-            signType: $payment.signType,
-            paySign: $payment.sign,
-            success(res) {
-              //支付成功
-              console.log('success', res)
-              //关闭确认订单窗口
-              $this.close_order_confirm()
-              $this.close_success_pop()
-              //打开成功充值窗口
-              $this.open_success_window()
+      // wx.login({
+      //   success(res1) {
+      //     console.log("微信登陆", res1.code);
+      //     let $code = res1.code
+      //     $params['code'] = $code
+          createOrder($params).then((res) => {
+              let $data = res.data
+              let $payment = $data.data
+              $this.order_sn = $payment['sn']
+              $this.payment_info = $payment
+              wx.requestPayment({
+                timeStamp: $payment.timeStamp,
+                nonceStr: $payment.nonceStr,
+                package: $payment.package,
+                signType: $payment.signType,
+                paySign: $payment.sign,
+                success(res) {
+                  //支付成功
+                  console.log('success', res)
+                  //关闭确认订单窗口
+                  $this.close_order_confirm()
+                  $this.close_success_pop()
+                  //打开成功充值窗口
+                  $this.open_success_window()
+                },
+                fail(res) {
+                  console.log('fail', res)
+                  $this.close_order_confirm()
+                  $this.err_show = true
+                }
+              })
             },
-            fail(res) {
-              console.log('fail', res)
-              $this.close_order_confirm()
-              $this.err_show = true
+            (err) => {
+              console.log(err)
             }
-          })
-        },
-        (err) => {
-          console.log(err)
-        }
-      )
+          )
+      //   }
+      // })
+
+
       //  接收回调方法后弹出支付成功
     },
     //跳转填写地址
@@ -356,11 +365,6 @@ export default {
     },
     // 获取充值卡列表
     get_card_list() {
-      wx.login({
-        success(res) {
-          console.log("微信登陆",res.code);
-        }
-      })
       goodsCardList().then((res) => {
         let $data = res.data.data
         $this.time_cards = $data.time_card