Commit 64e142d7d7a010f8f3eb657a0bbcc2bde03fa324
1 parent
b85909cb
1、 支付的优化
Showing
3 changed files
with
66 additions
and
5 deletions
packageD/pages/user/deposit/prepaid/prepaid.js
... | ... | @@ -105,10 +105,32 @@ Page({ |
105 | 105 | if(this.data.fir_in){ |
106 | 106 | this.data.fir_in=0; |
107 | 107 | }else{ |
108 | - | |
109 | - //富友插件 | |
108 | + //-- 富友插件 -- | |
110 | 109 | ut.fy_back('',0) |
111 | 110 | t_pay.set_fir(); |
111 | + | |
112 | + //-- 通联的第三方支付的返回优化 -- | |
113 | + ut.is_pay_ok("/packageD/pages/user/deposit/prepaid/msg/msg","none",function (){ | |
114 | + if(!th.data.ok_order_sn) return false; | |
115 | + var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; | |
116 | + getApp().request.promiseGet(ck_url,{}).then(res=>{ | |
117 | + if(ut.ajax_ok(res)){ | |
118 | + var item=res.data.data.pageData[0]; | |
119 | + if(item.pay_status==1){ | |
120 | + //支付支付,返回首页 | |
121 | + ut.m_toast('支付成功'); | |
122 | + setTimeout(()=>{ | |
123 | + getApp().re_to("/packageD/pages/user/deposit/prepaid/msg/msg"); | |
124 | + },1000) | |
125 | + | |
126 | + }else{ | |
127 | + //支付支付,返回首页 | |
128 | + ut.m_toast('支付失败'); | |
129 | + | |
130 | + } | |
131 | + } | |
132 | + }) | |
133 | + }); | |
112 | 134 | } |
113 | 135 | |
114 | 136 | wx.setNavigationBarTitle({ |
... | ... | @@ -182,6 +204,8 @@ Page({ |
182 | 204 | var parentSn = msg.order_sn; |
183 | 205 | var store_id = os.stoid; |
184 | 206 | t_pay.set_pay_url("/api/weshop/order/pay/createRechargeOrder"); |
207 | + | |
208 | + th.data.ok_order_sn=parentSn; | |
185 | 209 | t_pay.pay({ |
186 | 210 | parentSn: parentSn, |
187 | 211 | store_id: store_id | ... | ... |
packageD/pages/user/integral/integral.js
... | ... | @@ -208,6 +208,9 @@ Page({ |
208 | 208 | */ |
209 | 209 | onLoad: function (options) { |
210 | 210 | |
211 | + //定义第一次进入 | |
212 | + this.data.fir_in=1; | |
213 | + | |
211 | 214 | var th=this; |
212 | 215 | getApp().request.get("/api/wx/weappSendlist/page", { |
213 | 216 | data: { |
... | ... | @@ -258,6 +261,8 @@ Page({ |
258 | 261 | var store_id = os.stoid; |
259 | 262 | |
260 | 263 | t_pay.set_pay_url("/api/weshop/order/pay/createRechargeOrder"); |
264 | + | |
265 | + th.data.ok_order_sn=parentSn; | |
261 | 266 | t_pay.pay({ |
262 | 267 | parentSn: parentSn, |
263 | 268 | store_id: store_id |
... | ... | @@ -331,9 +336,40 @@ Page({ |
331 | 336 | */ |
332 | 337 | onShow: function () { |
333 | 338 | |
334 | - ut.fy_back('',0); | |
339 | + | |
340 | + var th=this; | |
341 | + //判断是不是第一次进入 | |
342 | + if(this.data.fir_in){ | |
343 | + this.data.fir_in=0; | |
344 | + }else{ | |
345 | + //-- 富友的插件 -- | |
346 | + ut.fy_back('',0); | |
347 | + t_pay.set_fir(); | |
348 | + | |
349 | + //-- 通联的第三方支付的返回优化 -- | |
350 | + ut.is_pay_ok("/packageD/pages/user/deposit/prepaid/msg/msg",null,function (){ | |
351 | + if(!th.data.ok_order_sn) return false; | |
352 | + var ck_url="/api/weshop/recharge/get/"+os.stoid+"/"+th.data.ok_order_sn; | |
353 | + getApp().request.promiseGet(ck_url,{}).then(res=>{ | |
354 | + if(ut.ajax_ok(res)){ | |
355 | + var item=res.data.data.pageData[0]; | |
356 | + if(item.pay_status==1){ | |
357 | + //支付支付,返回首页 | |
358 | + ut.m_toast('支付成功'); | |
359 | + setTimeout(()=>{ | |
360 | + getApp().re_to("/packageD/pages/user/deposit/prepaid/msg/msg"); | |
361 | + },1000) | |
362 | + | |
363 | + }else{ | |
364 | + //支付支付,返回首页 | |
365 | + ut.m_toast('支付失败'); | |
366 | + } | |
367 | + } | |
368 | + }) | |
369 | + }); | |
370 | + } | |
371 | + | |
335 | 372 | this.data.paying=0; |
336 | - t_pay.set_fir(); | |
337 | 373 | getApp().check_can_share(); |
338 | 374 | //--先判断会员状态-- |
339 | 375 | var user_info = getApp().globalData.userInfo; | ... | ... |