Commit 58f7cd647032e9074efc16ce62aceba3f7e30dd8
1 parent
657e9b4f
cart_pt
Showing
6 changed files
with
44 additions
and
11 deletions
pages/cart/cart2_pt/cart2_pt.js renamed to packageE/pages/cart/cart2_pt/cart2_pt.js
1 | -var t = getApp(), app = t, a = t.request, e = require("../../../utils/common.js"), | |
2 | - s = require("../../../utils/util.js"), ut = s, o = require("../../../utils/md5.js"), to = getApp(); | |
1 | +var t = getApp(), app = t, a = t.request, e = require("../../../../utils/common.js"), | |
2 | + s = require("../../../../utils/util.js"), ut = s, o = require("../../../../utils/md5.js"), to = getApp(); | |
3 | 3 | var oo = t.globalData.setting, os = oo; |
4 | -var regeneratorRuntime = require('../../../utils/runtime.js'); | |
5 | -var util_pay = require("../../../utils/pay.js"); | |
4 | +var regeneratorRuntime = require('../../../../utils/runtime.js'); | |
5 | +var util_pay = require("../../../../utils/pay.js"); | |
6 | 6 | |
7 | 7 | Page({ |
8 | 8 | |
... | ... | @@ -101,7 +101,7 @@ Page({ |
101 | 101 | }) |
102 | 102 | }, |
103 | 103 | onLoad: function (t) { |
104 | - console.log("onLoad_pt_cart"); | |
104 | + this.data.fir_in=1; | |
105 | 105 | var th = this; |
106 | 106 | getApp().getConfig2(function (e) { |
107 | 107 | th.setData({ |
... | ... | @@ -575,12 +575,44 @@ Page({ |
575 | 575 | //----------子页返回父页触发---------- |
576 | 576 | onShow: function () { |
577 | 577 | |
578 | - var fy=ut.fy_back("/pages/user/order_list/order_list",1); | |
579 | - if(fy) return false; | |
578 | + var th = this; | |
579 | + //判断是不是第一次进入 | |
580 | + if(this.data.fir_in){ | |
581 | + this.data.fir_in=0; | |
582 | + }else{ | |
583 | + //-- 富有的支付 -- | |
584 | + var fy=ut.fy_back("/pages/user/order_list/order_list",1); | |
585 | + if(fy) return false; | |
586 | + util_pay.set_fir(); | |
587 | + //-- 通联的第三方支付的返回优化 -- | |
588 | + ut.is_pay_ok("/pages/team/team_success/team_success?ordersn=" + th.data.ok_order_sn,null,function (){ | |
589 | + if(!th.data.ok_order_sn) return false; | |
590 | + getApp().request.promiseGet("/api/weshop/order/page", | |
591 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | |
592 | + if(ut.ajax_ok(res)){ | |
593 | + var item=res.data.data.pageData[0]; | |
594 | + //拼团成功的判断 | |
595 | + if(item.pt_status==1 || item.pt_status==2){ | |
596 | + //支付支付,返回首页 | |
597 | + ut.m_toast('支付成功'); | |
598 | + setTimeout(()=>{ | |
599 | + getApp().re_to("/pages/team/team_success/team_success?ordersn=" + th.data.ok_order_sn); | |
600 | + },1000) | |
601 | + | |
602 | + }else{ | |
603 | + //支付支付,返回首页 | |
604 | + ut.m_toast('支付失败'); | |
605 | + setTimeout(()=>{ | |
606 | + getApp().goto("/pages/index/index/index"); | |
607 | + },1000) | |
608 | + } | |
609 | + } | |
610 | + }) | |
611 | + }); | |
612 | + | |
613 | + } | |
580 | 614 | |
581 | - util_pay.set_fir(); | |
582 | 615 | |
583 | - var th = this; | |
584 | 616 | if (th.data.isclose == 0) { |
585 | 617 | wx.navigateTo({ |
586 | 618 | url: "/pages/index/index/index" |
... | ... | @@ -1339,6 +1371,7 @@ Page({ |
1339 | 1371 | // order_sn: data.data, |
1340 | 1372 | // type:1, |
1341 | 1373 | // }, 1); |
1374 | + th.data.ok_order_sn=data.data; | |
1342 | 1375 | util_pay.pay(data.data, function () { |
1343 | 1376 | setTimeout(function () { |
1344 | 1377 | wx.reLaunch({ | ... | ... |
pages/cart/cart2_pt/cart2_pt.json renamed to packageE/pages/cart/cart2_pt/cart2_pt.json
pages/cart/cart2_pt/cart2_pt.wxml renamed to packageE/pages/cart/cart2_pt/cart2_pt.wxml
pages/cart/cart2_pt/cart2_pt.wxss renamed to packageE/pages/cart/cart2_pt/cart2_pt.wxss
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -5308,7 +5308,7 @@ Page({ |
5308 | 5308 | buyNow_pt: function (e) { |
5309 | 5309 | s.set_b_now(e); |
5310 | 5310 | wx.navigateTo({ |
5311 | - url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + e.goods_id, | |
5311 | + url: "/packageE/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + e.goods_id, | |
5312 | 5312 | }); |
5313 | 5313 | }, |
5314 | 5314 | ... | ... |
pages/team/team_show/team_show.js
... | ... | @@ -850,7 +850,7 @@ Page({ |
850 | 850 | |
851 | 851 | s.set_b_now(newd); |
852 | 852 | wx.navigateTo({ |
853 | - url: "/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + th.data.goods.goods_id, | |
853 | + url: "/packageE/pages/cart/cart2_pt/cart2_pt?is_bnow=1&goods_id=" + th.data.goods.goods_id, | |
854 | 854 | }); |
855 | 855 | }); |
856 | 856 | }, | ... | ... |