Commit 40d5873af683aa5bdfebec6fa74b3d34cccfa9da
1 parent
e5d00f7e
月包的支付的详情, 和 专享礼包支付的详情的优化
Showing
2 changed files
with
62 additions
and
53 deletions
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
| @@ -454,35 +454,41 @@ Page({ | @@ -454,35 +454,41 @@ Page({ | ||
| 454 | } | 454 | } |
| 455 | }) | 455 | }) |
| 456 | 456 | ||
| 457 | - var money=th.data.payMoney; | ||
| 458 | - var bk_url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + th.data.back_ord; | ||
| 459 | - | ||
| 460 | - //-- 通联的第三方支付的返回优化 -- | ||
| 461 | - ut.is_pay_ok(bk_url,"none",function (){ | ||
| 462 | - if(!th.data.back_ord) return false; | ||
| 463 | - getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page", | ||
| 464 | - {data:{store_id:os.stoid,order_sn:th.data.back_ord,user_id:getApp().globalData.user_id}}).then(res=>{ | ||
| 465 | - | ||
| 466 | - if(ut.ajax_ok(res)){ | ||
| 467 | - var item=res.data.data.pageData[0]; | ||
| 468 | - if(item.pay_state==1){ | ||
| 469 | - //支付支付,返回首页 | ||
| 470 | - ut.m_toast('支付成功'); | ||
| 471 | - th.data.back_ord=null; | ||
| 472 | - setTimeout(()=>{ | ||
| 473 | - getApp().goto(bk_url); | ||
| 474 | - },1000) | ||
| 475 | - | ||
| 476 | - }else{ | ||
| 477 | - //支付支付,返回首页 | ||
| 478 | - ut.m_toast('支付失败'); | ||
| 479 | - setTimeout(()=>{ | ||
| 480 | - getApp().goto("/pages/index/index/index"); | ||
| 481 | - },1000) | 457 | + |
| 458 | + if(th.data.back_ord){ | ||
| 459 | + | ||
| 460 | + var money=th.data.payMoney; | ||
| 461 | + var bk_url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + th.data.back_ord; | ||
| 462 | + //-- 通联的第三方支付的返回优化 -- | ||
| 463 | + ut.is_pay_ok(bk_url,"none",function (){ | ||
| 464 | + if(!th.data.back_ord) return false; | ||
| 465 | + getApp().request.promiseGet("/api/weshop/marketing/marketingMonthgiftbagRecord/page", | ||
| 466 | + {data:{store_id:os.stoid,order_sn:th.data.back_ord,user_id:getApp().globalData.user_id}}).then(res=>{ | ||
| 467 | + | ||
| 468 | + if(ut.ajax_ok(res)){ | ||
| 469 | + var item=res.data.data.pageData[0]; | ||
| 470 | + if(item.pay_state==1){ | ||
| 471 | + //支付支付,返回首页 | ||
| 472 | + ut.m_toast('支付成功'); | ||
| 473 | + th.data.back_ord=null; | ||
| 474 | + setTimeout(()=>{ | ||
| 475 | + getApp().goto(bk_url); | ||
| 476 | + },1000) | ||
| 477 | + | ||
| 478 | + }else{ | ||
| 479 | + //支付支付,返回首页 | ||
| 480 | + ut.m_toast('支付失败'); | ||
| 481 | + setTimeout(()=>{ | ||
| 482 | + getApp().goto("/pages/index/index/index"); | ||
| 483 | + },1000) | ||
| 484 | + } | ||
| 482 | } | 485 | } |
| 483 | - } | ||
| 484 | - }) | ||
| 485 | - },null,null,1); | 486 | + }) |
| 487 | + },null,null,1); | ||
| 488 | + | ||
| 489 | + th.data.back_ord=null; | ||
| 490 | + } | ||
| 491 | + | ||
| 486 | 492 | ||
| 487 | }, 1000) | 493 | }, 1000) |
| 488 | } | 494 | } |
pages/giftpack/giftpacklist/giftpacklist.js
| @@ -183,32 +183,35 @@ Page({ | @@ -183,32 +183,35 @@ Page({ | ||
| 183 | ut.fy_back('',0); | 183 | ut.fy_back('',0); |
| 184 | com.set_py_fir(); | 184 | com.set_py_fir(); |
| 185 | 185 | ||
| 186 | - //-- 通联的第三方支付的返回优化 -- | ||
| 187 | - var money=th.data.payMoney; | ||
| 188 | - var back_url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + th.data.ok_order_sn; | ||
| 189 | - | ||
| 190 | - ut.is_pay_ok(back_url,'none',function (){ | ||
| 191 | - if(!th.data.ok_order_sn) return false; | ||
| 192 | - getApp().request.promiseGet("/api/weshop/marketing/my/giftbag/detail/get", | ||
| 193 | - {data:{storeId:os.stoid,orderSn:th.data.ok_order_sn,userId:getApp().globalData.user_id}}).then(res=>{ | ||
| 194 | - | ||
| 195 | - th.data.ok_order_sn=null; | ||
| 196 | - if(res.data.code==0 && res.data.data){ | ||
| 197 | - var item=res.data.data; | ||
| 198 | - if(item.payState==1){ | ||
| 199 | - //支付支付,返回首页 | ||
| 200 | - ut.m_toast('支付成功'); | ||
| 201 | - setTimeout(()=>{ | ||
| 202 | - getApp().goto(back_url); | ||
| 203 | - },1000) | ||
| 204 | - | ||
| 205 | - }else{ | ||
| 206 | - //支付支付,返回首页 | ||
| 207 | - ut.m_toast('支付失败'); | 186 | + if(th.data.ok_order_sn){ |
| 187 | + //-- 通联的第三方支付的返回优化 -- | ||
| 188 | + var money=th.data.payMoney; | ||
| 189 | + var back_url = "/pages/giftpack/payment/payment?money=" + money + "&order_sn=" + th.data.ok_order_sn; | ||
| 190 | + ut.is_pay_ok(back_url,'none',function (){ | ||
| 191 | + if(!th.data.ok_order_sn) return false; | ||
| 192 | + getApp().request.promiseGet("/api/weshop/marketing/my/giftbag/detail/get", | ||
| 193 | + {data:{storeId:os.stoid,orderSn:th.data.ok_order_sn,userId:getApp().globalData.user_id}}).then(res=>{ | ||
| 194 | + | ||
| 195 | + th.data.ok_order_sn=null; | ||
| 196 | + if(res.data.code==0 && res.data.data){ | ||
| 197 | + var item=res.data.data; | ||
| 198 | + if(item.payState==1){ | ||
| 199 | + //支付支付,返回首页 | ||
| 200 | + ut.m_toast('支付成功'); | ||
| 201 | + setTimeout(()=>{ | ||
| 202 | + getApp().goto(back_url); | ||
| 203 | + },1000) | ||
| 204 | + | ||
| 205 | + }else{ | ||
| 206 | + //支付支付,返回首页 | ||
| 207 | + ut.m_toast('支付失败'); | ||
| 208 | + } | ||
| 208 | } | 209 | } |
| 209 | - } | ||
| 210 | - }) | ||
| 211 | - },null,null,1); | 210 | + }) |
| 211 | + },null,null,1); | ||
| 212 | + th.data.ok_order_sn=null; | ||
| 213 | + } | ||
| 214 | + | ||
| 212 | } | 215 | } |
| 213 | 216 | ||
| 214 | 217 |