Commit 50d37c32dfc1869c9b23dc3b7deb8dc495da1056
1 parent
ec82954b
支付失败的优化
Showing
1 changed file
with
29 additions
and
31 deletions
pages/user/plus/plus.js
@@ -146,39 +146,37 @@ Page({ | @@ -146,39 +146,37 @@ Page({ | ||
146 | //-- 通联的第三方支付的返回优化 -- | 146 | //-- 通联的第三方支付的返回优化 -- |
147 | ut.is_pay_ok("func","func",function (){ | 147 | ut.is_pay_ok("func","func",function (){ |
148 | 148 | ||
149 | - if(!th.data.ok_order_sn) return false; | ||
150 | - var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; | ||
151 | - getApp().request.promiseGet(ck_url,{}).then(res=>{ | ||
152 | - | ||
153 | - if(res.data.code==0 && res.data.data){ | ||
154 | - var item=res.data.data; | ||
155 | - if(item.pay_status==1){ | ||
156 | - //支付支付,返回首页 | ||
157 | - th.success() | ||
158 | - | ||
159 | - }else{ | ||
160 | - //支付支付,返回首页 | ||
161 | - getApp().my_warnning('支付失败', 0, th); | ||
162 | - th.setData({ | ||
163 | - is_select:0, | ||
164 | - focus:true, | ||
165 | - }) | ||
166 | - } | ||
167 | - } | ||
168 | - }) | ||
169 | - }, //成功的回调 | 149 | + if(!th.data.ok_order_sn) return false; |
150 | + var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; | ||
151 | + getApp().request.promiseGet(ck_url,{}).then(res=>{ | ||
152 | + | ||
153 | + if(res.data.code==0 && res.data.data){ | ||
154 | + var item=res.data.data; | ||
155 | + if(item.pay_status==1){ | ||
156 | + //支付支付,返回首页 | ||
157 | + th.success() | ||
158 | + | ||
159 | + }else{ | ||
160 | + //支付支付,返回首页 | ||
161 | + getApp().my_warnning('支付失败', 0, th); | ||
162 | + th.setData({ | ||
163 | + is_select:0, | ||
164 | + focus:true, | ||
165 | + }) | ||
166 | + } | ||
167 | + } | ||
168 | + }) | ||
169 | + }, //成功的回调 | ||
170 | + function (){ | ||
171 | + th.success(); | ||
172 | + },//失败的回调 | ||
170 | function (){ | 173 | function (){ |
171 | - th.success(); | ||
172 | - },//失败的回调 | ||
173 | - function (){ | 174 | + th.setData({ |
175 | + is_select:0, | ||
176 | + focus:true, | ||
177 | + }) | ||
174 | 178 | ||
175 | - getApp().my_warnning('支付失败', 0, th); | ||
176 | - th.setData({ | ||
177 | - is_select:0, | ||
178 | - focus:true, | ||
179 | - }) | ||
180 | - | ||
181 | - }); | 179 | + }); |
182 | } | 180 | } |
183 | 181 | ||
184 | this.setData({ | 182 | this.setData({ |