From c238955d11fedda0a8e28dffef6bef96fbb41bae Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Wed, 26 Jun 2024 15:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E4=B8=AD=E5=BF=83=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patient/pages/payOrder/payOrder.js | 18 +++++++++++++++--- utils/request.js | 2 ++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/patient/pages/payOrder/payOrder.js b/patient/pages/payOrder/payOrder.js index 71cf4bc..ed8a710 100644 --- a/patient/pages/payOrder/payOrder.js +++ b/patient/pages/payOrder/payOrder.js @@ -26,6 +26,7 @@ Page({ showOrderMsg:false, showMsgOrder:false, time: '', + canPay:true, inquiry_no: '', amount_total: "", discount_amount:'', @@ -207,11 +208,15 @@ Page({ }, handleThrottle:throttle(function() { - console.log(this.data.isLock) + if(!this.data.canPay){ + wx.showToast({ + title: '订单异常', + icon:'none' + }) + return false; + } if(!this.data.isLock){ - console.log(11111) this.goPayPlatform(); - console.log(222222) this.setData({ isLock:true }); @@ -447,6 +452,13 @@ Page({ }) } + }).catch(error=>{ + if(error.code==500){ + this.setData({ + canPay:false + }) + }; + }) }, orderMsg(callback){ diff --git a/utils/request.js b/utils/request.js index dbbc001..a8e971d 100644 --- a/utils/request.js +++ b/utils/request.js @@ -120,6 +120,8 @@ function request(url, method, data, loding = false) { } reject(res.data); + }else if(Number(res.data.code) == 500){ + reject(res.data); } else { wx.showToast({ title: res.data.message,