Commit d5d60548dbee372426ad2b4271848bdcb2758199
1 parent
fe24f116
我的礼包的优化
Showing
2 changed files
with
86 additions
and
6 deletions
packageA/pages/myGift/myGift.js
... | ... | @@ -53,6 +53,9 @@ Page({ |
53 | 53 | */ |
54 | 54 | onLoad: function (options) { |
55 | 55 | |
56 | + //定义第一次进入 | |
57 | + this.data.fir_in=1; | |
58 | + | |
56 | 59 | self = this; |
57 | 60 | if(options.index){ |
58 | 61 | this.setData({currentIndex:1}); //查看我的礼包 |
... | ... | @@ -92,9 +95,42 @@ Page({ |
92 | 95 | */ |
93 | 96 | onShow: function () { |
94 | 97 | |
95 | - util.fy_back('',0) | |
96 | 98 | this.data.is_summit_ing=0; |
97 | - t_pay.set_fir(); | |
99 | + | |
100 | + | |
101 | + var th=this; | |
102 | + //判断是不是第一次进入 | |
103 | + if(this.data.fir_in){ | |
104 | + this.data.fir_in=0; | |
105 | + }else{ | |
106 | + //富友插件支付 | |
107 | + util.fy_back('',0) | |
108 | + t_pay.set_fir(); | |
109 | + | |
110 | + //-- 通联的第三方支付的返回优化 -- | |
111 | + ut.is_pay_ok("none","none",function (){ | |
112 | + if(!th.data.ok_order_sn) return false; | |
113 | + getApp().request.promiseGet("/api/weshop/order/page", | |
114 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | |
115 | + if(ut.ajax_ok(res)){ | |
116 | + var item=res.data.data.pageData[0]; | |
117 | + if(item.pay_status==1){ | |
118 | + //支付支付,返回首页 | |
119 | + ut.m_toast('支付成功'); | |
120 | + }else{ | |
121 | + //支付支付,返回首页 | |
122 | + ut.m_toast('支付失败'); | |
123 | + } | |
124 | + } | |
125 | + }) | |
126 | + }); | |
127 | + | |
128 | + } | |
129 | + | |
130 | + | |
131 | + | |
132 | + | |
133 | + | |
98 | 134 | getApp().check_can_share(); |
99 | 135 | if(app.globalData.userInfo) { |
100 | 136 | if(!this.data.isLogin) { |
... | ... | @@ -306,6 +342,13 @@ Page({ |
306 | 342 | },function (e){ |
307 | 343 | th.data.is_summit_ing=0; |
308 | 344 | getApp().my_warnning(e, 0, th); |
345 | + },function (ordno){ | |
346 | + if(ordno.indexOf('_')){ | |
347 | + var str_arr=ordno.split('_'); | |
348 | + ordno=str_arr[0]; | |
349 | + } | |
350 | + th.data.ok_order_sn=ordno; | |
351 | + | |
309 | 352 | }) |
310 | 353 | // var url = "/api/weshop/libao/libaoFormvip/libaoOrder"; |
311 | 354 | // getApp().request.post(url, | ... | ... |
packageA/pages/myGiftDetails/myGiftDetails.js
... | ... | @@ -24,8 +24,10 @@ Page({ |
24 | 24 | * 生命周期函数--监听页面加载 |
25 | 25 | */ |
26 | 26 | onLoad: function (options) { |
27 | + //定义第一次进入 | |
28 | + this.data.fir_in=1; | |
27 | 29 | |
28 | - self = this; | |
30 | + self = this; | |
29 | 31 | |
30 | 32 | // 如果从商品详情页点击促销栏里的礼包跳转过来的话,不显示底部按钮 |
31 | 33 | // showBtn 控制按钮是否显示 |
... | ... | @@ -68,9 +70,44 @@ Page({ |
68 | 70 | * 生命周期函数--监听页面显示 |
69 | 71 | */ |
70 | 72 | onShow: function () { |
71 | - this.data.is_summit_ing=0; | |
72 | - ut.fy_back('',0) | |
73 | - t_pay.set_fir(); | |
73 | + | |
74 | + this.data.is_summit_ing=0; | |
75 | + var th=this; | |
76 | + //判断是不是第一次进入 | |
77 | + if(this.data.fir_in){ | |
78 | + this.data.fir_in=0; | |
79 | + }else{ | |
80 | + ut.fy_back('',0) | |
81 | + t_pay.set_fir(); | |
82 | + | |
83 | + //-- 通联的第三方支付的返回优化 -- | |
84 | + ut.is_pay_ok("/packageA/pages/libao_payment/payment?type=2",null,function (){ | |
85 | + if(!th.data.ok_order_sn) return false; | |
86 | + getApp().request.promiseGet("/api/weshop/order/page", | |
87 | + {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ | |
88 | + if(ut.ajax_ok(res)){ | |
89 | + var item=res.data.data.pageData[0]; | |
90 | + if(item.pay_status==1){ | |
91 | + //支付支付,返回首页 | |
92 | + ut.m_toast('支付成功'); | |
93 | + setTimeout(()=>{ | |
94 | + getApp().goto("/packageA/pages/libao_payment/payment?type=2"); | |
95 | + },1000) | |
96 | + | |
97 | + }else{ | |
98 | + //支付支付,返回首页 | |
99 | + ut.m_toast('支付失败'); | |
100 | + setTimeout(()=>{ | |
101 | + getApp().goto("/pages/index/index/index"); | |
102 | + },1000) | |
103 | + } | |
104 | + } | |
105 | + }) | |
106 | + }); | |
107 | + | |
108 | + } | |
109 | + | |
110 | + | |
74 | 111 | getApp().check_can_share(); |
75 | 112 | if(app.globalData.userInfo) { |
76 | 113 | if(!this.data.isLogin) { | ... | ... |