shish 3 лет назад
Родитель
Сommit
35c5d22c00
1 измененных файлов с 18 добавлено и 4 удалено
  1. 18 4
      ghsApp/src/admin/billing/toPay.vue

+ 18 - 4
ghsApp/src/admin/billing/toPay.vue

@@ -31,7 +31,10 @@
               <button @click="changePayWay(1)" style="margin-left:40upx;" class="admin-button-com big" :class="payWay == 1 ? 'blue' : 'default'">支付宝</button>
               <button @click="changePayWay(2)" style="margin-left:40upx;" class="admin-button-com big" :class="payWay == 2 ? 'blue' : 'default'">赊账</button>
           </view>
-          <image mode="widthFix" style="width:350upx;margin:0 auto;" :src="payQrCodeUrl"></image>
+
+          <image mode="widthFix" v-if="expire == 0" style="width:350upx;margin:0 auto;" :src="payQrCodeUrl"></image>
+          <view style="font-size:32upx;color:red;font-weight:bold;padding-top:50upx;padding-bottom:50upx;" v-if="expire == 1">订单已过期,请重新创建</view>
+
           </view>
         </view>
         <view style="margin-top:35upx;">
@@ -60,7 +63,8 @@ export default {
       payWay:0,
       isCashier:false,
       INT:null,
-      orderInfo:{orderType:0}
+      orderInfo:{orderType:0},
+      expire:0
     };
   },
   mounted() {
@@ -98,12 +102,22 @@ export default {
     }
   },
   methods: {
+    init(){
+
+    },
     checkPayInfo(){
       let that = this
       this.INT = 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:that.orderId,orderSn:that.orderSn,title:'支付成功'}})
+            if(res.code == 1){
+              if(res.data.returnStatus == 'SUCCESS'){
+                that.$util.pageTo({ url: '/admin/billing/result',type:2,query: {orderId:that.orderId,orderSn:that.orderSn,title:'支付成功'}})
+              }
+              //订单过期
+              if(res.data.returnStatus == 'EXPIRE'){
+                clearInterval(that.INT)
+                that.expire = 1
+              }
             }
           })
        }, 4000);