linwenxin 2 nedēļas atpakaļ
vecāks
revīzija
1ad2936ea5

+ 21 - 1
src/packageMaterial/pages/newSale/pay.vue

@@ -31,7 +31,8 @@
       <template slot="footer">
         <view class="footer-btn-group">
           <u-button v-if="detail.ifCancel" text="取消订单" @click="cancelOrder"></u-button>
-          <u-button text="扫码支付" type="primary" @click="scanCode"></u-button>
+          <!-- <u-button text="扫码支付" type="primary" @click="scanCode"></u-button> -->
+          <u-button text="线下支付" type="primary" @click="scanCodeXX"></u-button>
         </view>
       </template>
     </zj-page-layout>
@@ -192,6 +193,25 @@ export default {
         })
     },
 
+    scanCodeXX() {
+      this.$api
+        .post('/pay/paid', {
+          orderId: this.orderId,
+          payType: 'LINE'
+        })
+        .then(res => {
+          this.orderId = res.data.orderId
+          if (res.data.payStatus == 'PAID') {
+            // 支付成功
+            this.state = 2
+          } else {
+            // 支付失败
+            this.state = 4
+          }
+        })
+        .catch(res => {})
+    },
+
     offTiming() {
       if (this.timeout) {
         clearTimeout(this.timeout)

+ 21 - 1
src/packageMaterial/pages/sale/pay.vue

@@ -31,7 +31,8 @@
       <template slot="footer">
         <view class="footer-btn-group">
           <u-button v-if="detail.ifCancel" text="取消订单" @click="cancelOrder"></u-button>
-          <u-button text="扫码支付" type="primary" @click="scanCode"></u-button>
+          <!-- <u-button text="扫码支付" type="primary" @click="scanCode"></u-button> -->
+          <u-button text="线下支付" type="primary" @click="scanCodeXX"></u-button>
         </view>
       </template>
     </zj-page-layout>
@@ -193,6 +194,25 @@ export default {
         })
     },
 
+    scanCodeXX() {
+      this.$api
+        .post('/pay/paid', {
+          orderId: this.orderId,
+          payType: 'LINE'
+        })
+        .then(res => {
+          this.orderId = res.data.orderId
+          if (res.data.payStatus == 'PAID') {
+            // 支付成功
+            this.state = 2
+          } else {
+            // 支付失败
+            this.state = 4
+          }
+        })
+        .catch(res => {})
+    },
+
     offTiming() {
       if (this.timeout) {
         clearTimeout(this.timeout)