Commit fe3d18b81c73d2a73b087b7af22d30004a67a437
1 parent
d5d60548
在购物车页面一般都是用redirectto进行跳转
Showing
5 changed files
with
26 additions
and
7 deletions
packageC/pages/presell/cart/cart2.js
@@ -213,7 +213,8 @@ Page({ | @@ -213,7 +213,8 @@ Page({ | ||
213 | util_pay.set_fir(); | 213 | util_pay.set_fir(); |
214 | 214 | ||
215 | //-- 通联的第三方支付的返回优化 -- | 215 | //-- 通联的第三方支付的返回优化 -- |
216 | - ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn,'none',function (){ | 216 | + ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn, |
217 | + "/pages/user/order_list/order_list",function (){ | ||
217 | if(!th.data.ok_order_sn) return false; | 218 | if(!th.data.ok_order_sn) return false; |
218 | getApp().request.promiseGet("/api/weshop/order/page", | 219 | getApp().request.promiseGet("/api/weshop/order/page", |
219 | {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | 220 | {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ |
packageE/pages/cart/cart2/cart2.js
@@ -285,7 +285,8 @@ Page({ | @@ -285,7 +285,8 @@ Page({ | ||
285 | util_pay.set_fir(); | 285 | util_pay.set_fir(); |
286 | 286 | ||
287 | //-- 通联的第三方支付的返回优化 -- | 287 | //-- 通联的第三方支付的返回优化 -- |
288 | - ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn,"none",function (){ | 288 | + ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn, |
289 | + "/pages/user/order_list/order_list",function (){ | ||
289 | //支付信息会先记录着 | 290 | //支付信息会先记录着 |
290 | if(!th.data.ok_order_sn) return false; | 291 | if(!th.data.ok_order_sn) return false; |
291 | getApp().request.promiseGet("/api/weshop/order/page", | 292 | getApp().request.promiseGet("/api/weshop/order/page", |
packageE/pages/cart/cart2_inte/cart2_inte.js
@@ -225,7 +225,8 @@ Page({ | @@ -225,7 +225,8 @@ Page({ | ||
225 | util_pay.set_fir(); | 225 | util_pay.set_fir(); |
226 | 226 | ||
227 | //-- 通联的第三方支付的返回优化 -- | 227 | //-- 通联的第三方支付的返回优化 -- |
228 | - ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn,"none",function (){ | 228 | + ut.is_pay_ok("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn, |
229 | + "/pages/user/order_list/order_list",function (){ | ||
229 | if(!th.data.ok_order_sn) return false; | 230 | if(!th.data.ok_order_sn) return false; |
230 | getApp().request.promiseGet("/api/weshop/order/page", | 231 | getApp().request.promiseGet("/api/weshop/order/page", |
231 | {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | 232 | {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ |
pages/cart/cart2_pt/cart2_pt.js
@@ -585,7 +585,8 @@ Page({ | @@ -585,7 +585,8 @@ Page({ | ||
585 | if(fy) return false; | 585 | if(fy) return false; |
586 | util_pay.set_fir(); | 586 | util_pay.set_fir(); |
587 | //-- 通联的第三方支付的返回优化 -- | 587 | //-- 通联的第三方支付的返回优化 -- |
588 | - ut.is_pay_ok("/pages/team/team_success/team_success?ordersn=" + th.data.ok_order_sn,"none",function (){ | 588 | + ut.is_pay_ok("/pages/team/team_success/team_success?ordersn=" + th.data.ok_order_sn, |
589 | + "/pages/user/order_list/order_list",function (){ | ||
589 | if(!th.data.ok_order_sn) return false; | 590 | if(!th.data.ok_order_sn) return false; |
590 | getApp().request.promiseGet("/api/weshop/order/page", | 591 | getApp().request.promiseGet("/api/weshop/order/page", |
591 | {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | 592 | {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ |
utils/util.js
@@ -891,11 +891,15 @@ module.exports = { | @@ -891,11 +891,15 @@ module.exports = { | ||
891 | * @param func 因为是物理键的返回,所以要调用结果,查询结果 | 891 | * @param func 因为是物理键的返回,所以要调用结果,查询结果 |
892 | * @param success //成功的回调函数, 当back_url是func | 892 | * @param success //成功的回调函数, 当back_url是func |
893 | * @param fail //失败的回调函数, 当err_url是func | 893 | * @param fail //失败的回调函数, 当err_url是func |
894 | + * @param is_navigateTo //跳转的页面是不是要is_re_to | ||
894 | */ | 895 | */ |
895 | - is_pay_ok(back_url,err_url,func,success,fail){ | 896 | + is_pay_ok(back_url,err_url,func,success,fail,is_navigateTo){ |
896 | if(!err_url){ | 897 | if(!err_url){ |
897 | err_url="/pages/index/index/index"; | 898 | err_url="/pages/index/index/index"; |
898 | } | 899 | } |
900 | + | ||
901 | + | ||
902 | + | ||
899 | let options = wx.getEnterOptionsSync(); | 903 | let options = wx.getEnterOptionsSync(); |
900 | if (options.scene == '1038' && options.referrerInfo.appId=='wxef277996acc166c3') { | 904 | if (options.scene == '1038' && options.referrerInfo.appId=='wxef277996acc166c3') { |
901 | let extraData = options.referrerInfo.extraData; | 905 | let extraData = options.referrerInfo.extraData; |
@@ -914,7 +918,14 @@ module.exports = { | @@ -914,7 +918,14 @@ module.exports = { | ||
914 | success(); | 918 | success(); |
915 | } | 919 | } |
916 | else if(back_url!='none'){ | 920 | else if(back_url!='none'){ |
917 | - wx.redirectTo({ url: back_url}); | 921 | + |
922 | + if(is_navigateTo){ | ||
923 | + getApp().goto(back_url) //跳到tabbar页 | ||
924 | + }else{ | ||
925 | + wx.redirectTo({ url: back_url}); | ||
926 | + } | ||
927 | + | ||
928 | + | ||
918 | } | 929 | } |
919 | },2000) | 930 | },2000) |
920 | } | 931 | } |
@@ -930,7 +941,11 @@ module.exports = { | @@ -930,7 +941,11 @@ module.exports = { | ||
930 | fail(); | 941 | fail(); |
931 | } | 942 | } |
932 | else if(err_url!='none'){ | 943 | else if(err_url!='none'){ |
933 | - getApp().goto(err_url); | 944 | + if(is_navigateTo){ |
945 | + getApp.goto({ url: err_url, }) //跳到tabbar页 | ||
946 | + }else { | ||
947 | + wxd.redirectTo(err_url); | ||
948 | + } | ||
934 | } | 949 | } |
935 | 950 | ||
936 | },2000) | 951 | },2000) |