shish 1 rok temu
rodzic
commit
31a9805f8e

+ 9 - 17
ghsApp/src/admin/billing/toPay.vue

@@ -16,10 +16,13 @@
         </block>
         </block>
         <view>
         <view>
           <view style="text-align:center;margin:10upx auto 10upx auto;">
           <view style="text-align:center;margin:10upx auto 10upx auto;">
-            <view class="balance" style="margin-bottom:25upx;" v-if="goPay == 0">扫客户付款码</view>
+            <view class="balance" style="margin-bottom:25upx;" v-if="goPay == 0">扫客户付款码</view>
             <view class="balance" style="margin-bottom:25upx;" v-if="goPay == 1">请求中</view>
             <view class="balance" style="margin-bottom:25upx;" v-if="goPay == 1">请求中</view>
             <view style="text-align:center;">
             <view style="text-align:center;">
               <image style="width:40upx;height:40upx;margin:0 auto;" :src="`${constant.imgUrl}/icon/loading.gif`" v-if="goPay == 1" mode="scaleToFill" />
               <image style="width:40upx;height:40upx;margin:0 auto;" :src="`${constant.imgUrl}/icon/loading.gif`" v-if="goPay == 1" mode="scaleToFill" />
+              <block v-if="goPay == 2">
+                <text style="color:red;font-weight:bold;font-size:28upx;">{{ remindText }}</text>
+              </block>
             </view>
             </view>
             <view style="margin-top:20upx;">
             <view style="margin-top:20upx;">
                 <button style="width:25vh;" @click="beginScan()" class="admin-button-com big blue">点击扫码</button>
                 <button style="width:25vh;" @click="beginScan()" class="admin-button-com big blue">点击扫码</button>
@@ -63,21 +66,17 @@ export default {
       payQrCodeUrl:'',
       payQrCodeUrl:'',
       payWay:0,
       payWay:0,
       isCashier:false,
       isCashier:false,
-      INT:null,
       orderInfo:{orderType:0},
       orderInfo:{orderType:0},
       expire:0,
       expire:0,
-      T:null,
       goPay:0,
       goPay:0,
       textscan: '扫码',
       textscan: '扫码',
-			typescan: 'scan-listener'
+			typescan: 'scan-listener',
+      remindText:''
     };
     };
   },
   },
   mounted() {
   mounted() {
   },
   },
 	onUnload() {
 	onUnload() {
-    if(this.T){
-      clearInterval(this.T)
-    }
 	},
 	},
   onLoad(option) {
   onLoad(option) {
     this.orderId = option.orderId
     this.orderId = option.orderId
@@ -123,6 +122,7 @@ export default {
       this.$util.pageTo({url: "/pagesOrder/detail?id="+id,type:2})
       this.$util.pageTo({url: "/pagesOrder/detail?id="+id,type:2})
     },
     },
     beginScan(){
     beginScan(){
+      this.remindText = ''
       // #ifdef MP-WEIXIN
       // #ifdef MP-WEIXIN
       this.toScan()
       this.toScan()
       // #endif
       // #endif
@@ -172,8 +172,8 @@ export default {
                         that.payFinish()
                         that.payFinish()
                     },1200)
                     },1200)
                 }else{
                 }else{
-                  that.$msg(res.msg)
-                  that.goPay = 0
+                  that.remindText = res.msg
+                  that.goPay = 2
                 }
                 }
             }
             }
         })
         })
@@ -185,7 +185,6 @@ export default {
           if(res.code == 1){
           if(res.code == 1){
               if(res.data.returnStatus == 'SUCCESS'){
               if(res.data.returnStatus == 'SUCCESS'){
                   uni.hideLoading()
                   uni.hideLoading()
-                  clearInterval(that.T)
                   setTimeout(function(){
                   setTimeout(function(){
                       that.payFinish()
                       that.payFinish()
                   },1500)
                   },1500)
@@ -205,7 +204,6 @@ export default {
       let that = this
       let that = this
       if(payWay == 2){
       if(payWay == 2){
         that.$util.confirmModal({content:'确认赊账?'},() => {
         that.$util.confirmModal({content:'确认赊账?'},() => {
-            clearInterval(this.INT)
             debtPay({id:this.orderId}).then(res=>{
             debtPay({id:this.orderId}).then(res=>{
               if(res.code == 1){
               if(res.code == 1){
                 that.$msg(res.msg)
                 that.$msg(res.msg)
@@ -223,14 +221,11 @@ export default {
           if(res.code == 1){
           if(res.code == 1){
               if(res.data.returnStatus == 'SUCCESS'){
               if(res.data.returnStatus == 'SUCCESS'){
                   uni.hideLoading()
                   uni.hideLoading()
-                  clearInterval(that.T)
                   setTimeout(function(){
                   setTimeout(function(){
                       that.payFinish()
                       that.payFinish()
                   },1500)
                   },1500)
-                  return
               }
               }
           }
           }
-          that.$msg('没有付款,请跟客户确认')
       })
       })
     },
     },
     confirmToCancel(){
     confirmToCancel(){
@@ -239,14 +234,12 @@ export default {
             if(res.code == 1){
             if(res.code == 1){
                 if(res.data.returnStatus == 'SUCCESS'){
                 if(res.data.returnStatus == 'SUCCESS'){
                     uni.hideLoading()
                     uni.hideLoading()
-                    clearInterval(that.T)
                     setTimeout(function(){
                     setTimeout(function(){
                         that.payFinish()
                         that.payFinish()
                     },1500)
                     },1500)
                     return
                     return
                 }
                 }
             }
             }
-            clearInterval(that.T)
             cancel({id:this.orderId}).then(res=>{
             cancel({id:this.orderId}).then(res=>{
                 if(res.code == 1){
                 if(res.code == 1){
                     that.$msg('已取消')
                     that.$msg('已取消')
@@ -260,7 +253,6 @@ export default {
     toCancel(){
     toCancel(){
       let that = this
       let that = this
       that.$util.confirmModal({content:'确认取消?'},() => {
       that.$util.confirmModal({content:'确认取消?'},() => {
-          clearInterval(this.INT)
           cancel({id:this.orderId}).then(res=>{
           cancel({id:this.orderId}).then(res=>{
             if(res.code == 1){
             if(res.code == 1){
               that.$msg(res.msg)
               that.$msg(res.msg)

+ 14 - 23
ghsPad/src/pages/home/components/toPay.vue

@@ -6,10 +6,14 @@
                 <view style="margin-top:20upx;font-weight:bold;font-size:35upx;color:black;">¥{{price}}</view>
                 <view style="margin-top:20upx;font-weight:bold;font-size:35upx;color:black;">¥{{price}}</view>
                 <view class="show-code" v-if="goPay == 0">请出示付款码</view>
                 <view class="show-code" v-if="goPay == 0">请出示付款码</view>
                 <view class="paying" v-if="goPay == 1">请求中</view>
                 <view class="paying" v-if="goPay == 1">请求中</view>
+                <view style="font-size:19upx;margin:55upx auto 10upx auto;color:red;font-weight:bold;" v-if="goPay == 2">
+                    {{ remindText }}
+                    <text v-if="returnCode=='BBS11105' || returnCode=='BBS10000'" style="margin-left:10upx;color:green;" @click="checkPay">查询结果</text>
+                </view>
                 <image style="width:40upx;height:40upx;position:absolute;top:200upx;left:165upx;" :src="`${constant.imgUrl}/icon/loading.gif`" v-if="goPay == 1" mode="scaleToFill" />
                 <image style="width:40upx;height:40upx;position:absolute;top:200upx;left:165upx;" :src="`${constant.imgUrl}/icon/loading.gif`" v-if="goPay == 1" mode="scaleToFill" />
                 <view style="margin-top:30upx;">
                 <view style="margin-top:30upx;">
                     <view @click="cancelPayFn" class="btn-default">取消</view>
                     <view @click="cancelPayFn" class="btn-default">取消</view>
-                    <view @click="manualCheck()" style="margin-left:20upx;background-color:#3385FF;color:white;" class="btn-default">手动查结果</view>
+                    <view @click="reScan()" style="margin-left:20upx;background-color:#1c7b20;color:white;width:150upx;" class="btn-default">重新出示付款码</view>
                 </view>
                 </view>
             </view>
             </view>
         </view>
         </view>
@@ -41,7 +45,9 @@ export default {
         return {
         return {
             showSuccess:false,
             showSuccess:false,
             T:null,
             T:null,
-            goPay:0
+            goPay:0,
+            remindText:'',
+            returnCode:''
         }
         }
     },
     },
 	props: {
 	props: {
@@ -72,22 +78,9 @@ export default {
                 }
                 }
             })
             })
         },
         },
-        manualCheck(){
-            let that = this
-            codePayCheck({id:this.orderId}).then(res=>{
-                if(res.code == 1){
-                    if(res.data.returnStatus == 'SUCCESS'){
-                        uni.hideLoading()
-                        that.showSuccess = true
-                        //clearInterval(that.T)
-                        setTimeout(function(){
-                            that.payFinish()
-                        },1500)
-                        return
-                    }
-                }
-                that.$msg('没有付款,请跟客户确认')
-            })
+        reScan(){
+            this.remindText = ''
+            this.goPay = 0
         },
         },
         //查询付款结果
         //查询付款结果
         checkPay(){
         checkPay(){
@@ -97,7 +90,6 @@ export default {
                     if(res.data.returnStatus == 'SUCCESS'){
                     if(res.data.returnStatus == 'SUCCESS'){
                         uni.hideLoading()
                         uni.hideLoading()
                         that.showSuccess = true
                         that.showSuccess = true
-                        clearInterval(that.T)
                         setTimeout(function(){
                         setTimeout(function(){
                             that.payFinish()
                             that.payFinish()
                         },1500)
                         },1500)
@@ -118,8 +110,9 @@ export default {
                             that.payFinish()
                             that.payFinish()
                         },1200)
                         },1200)
                     }else{
                     }else{
-                        that.$msg(res.msg)
-                        that.goPay = 0
+                        that.remindText = res.msg
+                        that.goPay = 2
+                        that.returnCode = res.data.returnCode ? res.data.returnCode : ''
                         // that.T = setInterval(function(){
                         // that.T = setInterval(function(){
                         //     that.checkPay()
                         //     that.checkPay()
                         // }, 1000)
                         // }, 1000)
@@ -149,14 +142,12 @@ export default {
                     if(res.data.returnStatus == 'SUCCESS'){
                     if(res.data.returnStatus == 'SUCCESS'){
                         uni.hideLoading()
                         uni.hideLoading()
                         that.showSuccess = true
                         that.showSuccess = true
-                        //clearInterval(that.T)
                         setTimeout(function(){
                         setTimeout(function(){
                             that.payFinish()
                             that.payFinish()
                         },1500)
                         },1500)
                         return
                         return
                     }
                     }
                 }
                 }
-                //clearInterval(that.T)
                 cancelOrderFn({id:this.orderId}).then(res=>{
                 cancelOrderFn({id:this.orderId}).then(res=>{
                     if(res.code == 1){
                     if(res.code == 1){
                         that.$msg('已取消')
                         that.$msg('已取消')

+ 15 - 26
hdPad/src/pages/home/components/toPay.vue

@@ -6,10 +6,14 @@
                 <view style="margin-top:20upx;font-weight:bold;font-size:35upx;color:black;">¥{{price}}</view>
                 <view style="margin-top:20upx;font-weight:bold;font-size:35upx;color:black;">¥{{price}}</view>
                 <view class="show-code" v-if="goPay == 0">请出示付款码</view>
                 <view class="show-code" v-if="goPay == 0">请出示付款码</view>
                 <view class="paying" v-if="goPay == 1">请求中</view>
                 <view class="paying" v-if="goPay == 1">请求中</view>
+                <view style="font-size:19upx;margin:55upx auto 10upx auto;color:red;font-weight:bold;" v-if="goPay == 2">
+                    {{ remindText }}
+                    <text v-if="returnCode=='BBS11105' || returnCode=='BBS10000'" style="margin-left:10upx;color:green;" @click="checkPay">查询结果</text>
+                </view>
                 <image style="width:40upx;height:40upx;position:absolute;top:200upx;left:165upx;" :src="`${constant.imgUrl}/icon/loading.gif`" v-if="goPay == 1" mode="scaleToFill" />
                 <image style="width:40upx;height:40upx;position:absolute;top:200upx;left:165upx;" :src="`${constant.imgUrl}/icon/loading.gif`" v-if="goPay == 1" mode="scaleToFill" />
                 <view style="margin-top:30upx;">
                 <view style="margin-top:30upx;">
                     <view @click="cancelPayFn" class="btn-default">取消</view>
                     <view @click="cancelPayFn" class="btn-default">取消</view>
-                    <view @click="manualCheck()" style="margin-left:20upx;background-color:#3385FF;color:white;" class="btn-default">手动查结果</view>
+                    <view @click="reScan()" style="margin-left:20upx;background-color:#1c7b20;color:white;width:150upx;" class="btn-default">重新出示付款码</view>
                 </view>
                 </view>
             </view>
             </view>
         </view>
         </view>
@@ -41,7 +45,9 @@ export default {
         return {
         return {
             showSuccess:false,
             showSuccess:false,
             T:null,
             T:null,
-            goPay:0
+            goPay:0,
+            remindText:'',
+            returnCode:''
         }
         }
     },
     },
 	props: {
 	props: {
@@ -72,24 +78,10 @@ export default {
                 }
                 }
             })
             })
         },
         },
-        manualCheck(){
-            let that = this
-            codePayCheck({id:this.orderId}).then(res=>{
-                if(res.code == 1){
-                    if(res.data.returnStatus == 'SUCCESS'){
-                        uni.hideLoading()
-                        that.showSuccess = true
-                        //clearInterval(that.T)
-                        setTimeout(function(){
-                            that.payFinish()
-                        },1500)
-                        return
-                    }
-                }
-                that.$msg('没有付款,请跟客户确认')
-            })
+        reScan(){
+            this.remindText = ''
+            this.goPay = 0
         },
         },
-        //查询付款结果
         checkPay(){
         checkPay(){
             let that = this
             let that = this
             codePayCheck({id:this.orderId}).then(res=>{
             codePayCheck({id:this.orderId}).then(res=>{
@@ -97,11 +89,9 @@ export default {
                     if(res.data.returnStatus == 'SUCCESS'){
                     if(res.data.returnStatus == 'SUCCESS'){
                         uni.hideLoading()
                         uni.hideLoading()
                         that.showSuccess = true
                         that.showSuccess = true
-                        //clearInterval(that.T)
                         setTimeout(function(){
                         setTimeout(function(){
                             that.payFinish()
                             that.payFinish()
                         },1500)
                         },1500)
-                        return
                     }
                     }
                 }
                 }
             })
             })
@@ -110,7 +100,7 @@ export default {
         requestCodePay(authCode){
         requestCodePay(authCode){
             let that = this
             let that = this
             this.goPay = 1
             this.goPay = 1
-            codePay({id:this.orderId,authCode:authCode}).then(res=>{
+            codePay({id:this.orderId,authCode:authCode,version:2}).then(res=>{
                 if(res.code == 1){
                 if(res.code == 1){
                     if(res.data.returnStatus == 'SUCCESS'){
                     if(res.data.returnStatus == 'SUCCESS'){
                         that.showSuccess = true
                         that.showSuccess = true
@@ -118,8 +108,9 @@ export default {
                             that.payFinish()
                             that.payFinish()
                         },1500)
                         },1500)
                     }else{
                     }else{
-                        that.$msg(res.msg)
-                        that.goPay = 0
+                        that.remindText = res.msg
+                        that.returnCode = res.data.returnCode ? res.data.returnCode : ''
+                        that.goPay = 2
                         // that.T = setInterval(function(){
                         // that.T = setInterval(function(){
                         //     that.checkPay()
                         //     that.checkPay()
                         // }, 1000)
                         // }, 1000)
@@ -151,14 +142,12 @@ export default {
                     if(res.data.returnStatus == 'SUCCESS'){
                     if(res.data.returnStatus == 'SUCCESS'){
                         uni.hideLoading()
                         uni.hideLoading()
                         that.showSuccess = true
                         that.showSuccess = true
-                        //clearInterval(that.T)
                         setTimeout(function(){
                         setTimeout(function(){
                             that.payFinish()
                             that.payFinish()
                         },1500)
                         },1500)
                         return
                         return
                     }
                     }
                 }
                 }
-                //clearInterval(that.T)
                 cancelOrderFn({id:this.orderId}).then(res=>{
                 cancelOrderFn({id:this.orderId}).then(res=>{
                     if(res.code == 1){
                     if(res.code == 1){
                         that.$msg('已取消')
                         that.$msg('已取消')