From 50d37c32dfc1869c9b23dc3b7deb8dc495da1056 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Wed, 19 Jul 2023 08:59:03 +0800 Subject: [PATCH] 支付失败的优化 --- pages/user/plus/plus.js | 60 +++++++++++++++++++++++++++++------------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js index 65b0f73..436a976 100644 --- a/pages/user/plus/plus.js +++ b/pages/user/plus/plus.js @@ -146,39 +146,37 @@ Page({ //-- 通联的第三方支付的返回优化 -- ut.is_pay_ok("func","func",function (){ - if(!th.data.ok_order_sn) return false; - var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; - getApp().request.promiseGet(ck_url,{}).then(res=>{ - - if(res.data.code==0 && res.data.data){ - var item=res.data.data; - if(item.pay_status==1){ - //支付支付,返回首页 - th.success() - - }else{ - //支付支付,返回首页 - getApp().my_warnning('支付失败', 0, th); - th.setData({ - is_select:0, - focus:true, - }) - } - } - }) - }, //成功的回调 + if(!th.data.ok_order_sn) return false; + var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; + getApp().request.promiseGet(ck_url,{}).then(res=>{ + + if(res.data.code==0 && res.data.data){ + var item=res.data.data; + if(item.pay_status==1){ + //支付支付,返回首页 + th.success() + + }else{ + //支付支付,返回首页 + getApp().my_warnning('支付失败', 0, th); + th.setData({ + is_select:0, + focus:true, + }) + } + } + }) + }, //成功的回调 + function (){ + th.success(); + },//失败的回调 function (){ - th.success(); - },//失败的回调 - function (){ + th.setData({ + is_select:0, + focus:true, + }) - getApp().my_warnning('支付失败', 0, th); - th.setData({ - is_select:0, - focus:true, - }) - - }); + }); } this.setData({ -- libgit2 0.21.4