shish 4 лет назад
Родитель
Сommit
9f53fe77c8
2 измененных файлов с 16 добавлено и 1 удалено
  1. 12 1
      ghsApp/src/admin/billing/toPay.vue
  2. 4 0
      ghsApp/src/api/order/index.js

+ 12 - 1
ghsApp/src/admin/billing/toPay.vue

@@ -35,7 +35,7 @@
   </view>
 </template>
 <script>
-import { codePayCheck,scanPay} from "@/api/order/index";
+import { codePayCheck,scanPay,scanPayCheck} from "@/api/order/index";
 export default {
   name: "toPay",
   components: {
@@ -71,6 +71,7 @@ export default {
     // #endif
     if(this.isCashier == false){
       this.toScanPay()
+      this.checkPayInfo()
     }
 
   },
@@ -80,6 +81,16 @@ export default {
     uni.removeStorageSync('globalCodePayId')
   },
   methods: {
+    checkPayInfo(){
+      let that = this
+      setInterval(function(){ 
+          scanPayCheck({id:that.orderId}).then(res=>{
+            if(res.code == 1 && res.data.returnStatus == 'SUCCESS'){
+              that.$util.pageTo({ url: '/admin/billing/result',type:2,query: {orderId:this.orderId,orderSn:this.orderSn,title:'支付成功'}})
+            }
+          })
+       }, 4000);
+    },
     changePayWay(payWay){
       this.payWay = payWay
       this.toScanPay()

+ 4 - 0
ghsApp/src/api/order/index.js

@@ -197,3 +197,7 @@ export const getPayVoice = data => https.get("/order/get-pay-voice", data);
 
 //扫码付款
 export const scanPay = data => https.get("/order/scan-pay", data);
+
+//扫码付款结果查询
+export const scanPayCheck = data => https.get("/order/scan-pay-check", data);
+