Commit 53e35142887794c6df6528e9558f68f495198966
1 parent
bfb6a525
支付的回调,侧滑返回的优化
Showing
31 changed files
with
342 additions
and
22 deletions
packageA/pages/cart2_ser/cart2_ser.js
... | ... | @@ -274,6 +274,9 @@ Page({ |
274 | 274 | |
275 | 275 | //----------子页返回父页触发---------- |
276 | 276 | onShow: function() { |
277 | + var fy=s.fy_back("/pages/user/order_list/order_list?index=2&tabindex=1",1); | |
278 | + if(fy) return false; | |
279 | + | |
277 | 280 | t_pay.set_fir(); |
278 | 281 | var th = this; |
279 | 282 | if (th.data.isclose == 0) { |
... | ... | @@ -641,6 +644,13 @@ Page({ |
641 | 644 | icon: 'none', |
642 | 645 | duration: 2000 |
643 | 646 | }); |
647 | + | |
648 | + setTimeout(function () { | |
649 | + wx.reLaunch({ | |
650 | + url: "/pages/user/order_list/order_list?index=2&tabindex=1", | |
651 | + }) | |
652 | + }, 1000) | |
653 | + | |
644 | 654 | } |
645 | 655 | ) |
646 | 656 | ... | ... |
packageA/pages/chongzhiDetails/chongzhiDetails.js
... | ... | @@ -106,6 +106,8 @@ Page({ |
106 | 106 | * 生命周期函数--监听页面显示 |
107 | 107 | */ |
108 | 108 | onShow: function () { |
109 | + this.data.is_buying=0; | |
110 | + util.fy_back('',0) | |
109 | 111 | t_pay.set_fir(); |
110 | 112 | getApp().check_can_share(); |
111 | 113 | }, |
... | ... | @@ -167,7 +169,7 @@ Page({ |
167 | 169 | var recharge_type = 6; |
168 | 170 | var buynum = 1; |
169 | 171 | console.log(money, "有进来吗预存劵", advancek, user_id, store_id ); |
170 | - var e = this, | |
172 | + var e = this,th=this, | |
171 | 173 | perpaid = ""; |
172 | 174 | await getApp().request.promiseGet("/api/weshop/users/getPay", { |
173 | 175 | data: { |
... | ... | @@ -196,8 +198,10 @@ Page({ |
196 | 198 | parentSn: parentSn, |
197 | 199 | store_id: store_id |
198 | 200 | }, function () { |
201 | + th.data.is_buying=0; | |
199 | 202 | e.jumpPaymentPage(); |
200 | 203 | }, function (e) { |
204 | + th.data.is_buying=0; | |
201 | 205 | wx.showToast({ |
202 | 206 | title: e, |
203 | 207 | icon: 'none', | ... | ... |
packageA/pages/details_serviceCard/details_serviceCard.js
... | ... | @@ -3,6 +3,7 @@ var t_pay = require("../../../utils/pay2.js"); |
3 | 3 | const app = getApp(); |
4 | 4 | const os = app.globalData.setting; |
5 | 5 | let self = null; |
6 | +var util = require('../../../utils/util.js'); | |
6 | 7 | |
7 | 8 | Page({ |
8 | 9 | |
... | ... | @@ -44,6 +45,8 @@ Page({ |
44 | 45 | * 生命周期函数--监听页面显示 |
45 | 46 | */ |
46 | 47 | onShow: function() { |
48 | + this.data.is_summit_ing=0; | |
49 | + util.fy_back('',0) | |
47 | 50 | t_pay.set_fir(); |
48 | 51 | getApp().check_can_share(); |
49 | 52 | if (app.globalData.userInfo) { |
... | ... | @@ -497,6 +500,11 @@ Page({ |
497 | 500 | |
498 | 501 | // 立即支付 |
499 | 502 | pay() { |
503 | + | |
504 | + if(this.data.is_summit_ing) return false; | |
505 | + this.data.is_summit_ing=1; | |
506 | + | |
507 | + var th=this; | |
500 | 508 | let order_sn = this.data.details.order_sn; |
501 | 509 | let order_id = this.data.details.order_id; |
502 | 510 | let store_id = app.globalData.setting.stoid; |
... | ... | @@ -513,6 +521,7 @@ Page({ |
513 | 521 | }, 1000) |
514 | 522 | |
515 | 523 | }, function (e) { |
524 | + th.data.is_summit_ing=0; | |
516 | 525 | wx.showToast({ |
517 | 526 | title: e, |
518 | 527 | icon: 'none', | ... | ... |
packageA/pages/myGift/myGift.js
... | ... | @@ -3,6 +3,7 @@ const app = getApp(); |
3 | 3 | let self = null; |
4 | 4 | var os = app.globalData.setting; |
5 | 5 | var t_pay = require("../../../utils/pay2.js"); |
6 | +var util = require('../../../utils/util.js'); | |
6 | 7 | |
7 | 8 | Page({ |
8 | 9 | |
... | ... | @@ -18,6 +19,7 @@ Page({ |
18 | 19 | noMore: false, // 检测是否有更多数据,true为没有更多数据,false为还有数据 |
19 | 20 | pageNum: 1, // 当前页数 |
20 | 21 | iurl: os.imghost, //图片前缀网址 |
22 | + is_summit_ing:0 //是不是提交申请 | |
21 | 23 | }, |
22 | 24 | |
23 | 25 | clickTab(e) { |
... | ... | @@ -89,6 +91,9 @@ Page({ |
89 | 91 | * 生命周期函数--监听页面显示 |
90 | 92 | */ |
91 | 93 | onShow: function () { |
94 | + | |
95 | + util.fy_back('',0) | |
96 | + this.data.is_summit_ing=0; | |
92 | 97 | t_pay.set_fir(); |
93 | 98 | getApp().check_can_share(); |
94 | 99 | if(app.globalData.userInfo) { |
... | ... | @@ -275,6 +280,10 @@ Page({ |
275 | 280 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
276 | 281 | var user=getApp().globalData.userInfo; |
277 | 282 | |
283 | + | |
284 | + if(this.data.is_summit_ing) return false; | |
285 | + this.data.is_summit_ing=0; | |
286 | + | |
278 | 287 | my_confirm.open( |
279 | 288 | "是否确定购买该礼包", |
280 | 289 | "取消", |
... | ... | @@ -292,8 +301,10 @@ Page({ |
292 | 301 | }; |
293 | 302 | t_pay.set_pay_url("/api/weshop/libao/libaoFormvip/libaoOrder"); |
294 | 303 | t_pay.pay(json,function (){ |
304 | + th.data.is_summit_ing=0; | |
295 | 305 | getApp().my_warnning("支付成功", 1, th); |
296 | 306 | },function (e){ |
307 | + th.data.is_summit_ing=0; | |
297 | 308 | getApp().my_warnning(e, 0, th); |
298 | 309 | }) |
299 | 310 | // var url = "/api/weshop/libao/libaoFormvip/libaoOrder"; | ... | ... |
packageA/pages/myGiftDetails/myGiftDetails.js
... | ... | @@ -17,6 +17,7 @@ Page({ |
17 | 17 | }, |
18 | 18 | showBtn: true, |
19 | 19 | isClick: false, |
20 | + is_summit_ing: 0, | |
20 | 21 | }, |
21 | 22 | |
22 | 23 | /** |
... | ... | @@ -67,6 +68,8 @@ Page({ |
67 | 68 | * 生命周期函数--监听页面显示 |
68 | 69 | */ |
69 | 70 | onShow: function () { |
71 | + this.data.is_summit_ing=0; | |
72 | + ut.fy_back('',0) | |
70 | 73 | t_pay.set_fir(); |
71 | 74 | getApp().check_can_share(); |
72 | 75 | if(app.globalData.userInfo) { |
... | ... | @@ -210,6 +213,10 @@ Page({ |
210 | 213 | |
211 | 214 | //-- 礼包购买 -- |
212 | 215 | GetBuyPrice: function(e) { |
216 | + | |
217 | + if(this.data.is_summit_ing) return false; | |
218 | + this.data.is_summit_ing=1; | |
219 | + | |
213 | 220 | var th = this,that=th; |
214 | 221 | var item=th.data.details; |
215 | 222 | var id = item.id; //活动id |
... | ... | @@ -239,6 +246,7 @@ Page({ |
239 | 246 | getApp().goto("/packageA/pages/libao_payment/payment?type=2"); |
240 | 247 | },1000) |
241 | 248 | },function (msg){ |
249 | + th.data.is_summit_ing=0; | |
242 | 250 | getApp().my_warnning(msg, 0, th); |
243 | 251 | }) |
244 | 252 | ... | ... |
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
... | ... | @@ -157,6 +157,11 @@ Page({ |
157 | 157 | |
158 | 158 | //----------子页返回父页触发---------- |
159 | 159 | onShow: function () { |
160 | + | |
161 | + //富友支付取消支付强行回去 | |
162 | + var fy=ut.fy_back("/pages/user/order_list/order_list",1); | |
163 | + if(fy) return false; | |
164 | + | |
160 | 165 | util_pay.set_fir(); |
161 | 166 | var th = this; |
162 | 167 | th.setData({ show_submit: 0 }); //让提交先掩藏 |
... | ... | @@ -2838,7 +2843,7 @@ Page({ |
2838 | 2843 | if (cps.length > 1) { |
2839 | 2844 | wx.navigateBack({ delta: 1 }) |
2840 | 2845 | } else { |
2841 | - getApp().goto("/pages/index/index/index"); | |
2846 | + getApp().goto("/pages/user/order_list/order_list"); | |
2842 | 2847 | } |
2843 | 2848 | |
2844 | 2849 | }, 1000) | ... | ... |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js
... | ... | @@ -64,6 +64,11 @@ Page({ |
64 | 64 | }), this.requestOrderDetail(e.order_id), wx.removeStorageSync("order:order_detail:update"); |
65 | 65 | }, |
66 | 66 | onShow: function() { |
67 | + | |
68 | + var fy=ut.fy_back('/pages/user/order_list/order_list',1); | |
69 | + if(fy) return false; | |
70 | + py.set_fir(); | |
71 | + | |
67 | 72 | wx.getStorageSync("order:order_detail:update") && (wx.removeStorageSync("order:order_detail:update"), |
68 | 73 | this.requestOrderDetail(this.data.order.order_id)); |
69 | 74 | }, |
... | ... | @@ -321,6 +326,9 @@ Page({ |
321 | 326 | |
322 | 327 | } |
323 | 328 | |
329 | + if(this.data.paying) return false; | |
330 | + this.data.paying=0; | |
331 | + | |
324 | 332 | var order=this.data.order; |
325 | 333 | var order_goods=order.order_goods; |
326 | 334 | var user_id=order.user_id; |
... | ... | @@ -328,8 +336,9 @@ Page({ |
328 | 336 | |
329 | 337 | |
330 | 338 | py.pay(this.data.order.order_sn, function() { |
331 | - wx.showToast({title: '支付成功'}) | |
332 | - wx.navigateBack(); | |
339 | + th.data.paying=0; | |
340 | + wx.showToast({title: '支付成功'}) | |
341 | + wx.navigateBack(); | |
333 | 342 | },null,os.stoid,1); |
334 | 343 | |
335 | 344 | ... | ... |
packageC/pages/payForAnother/payForAnother.js
... | ... | @@ -150,6 +150,23 @@ Page({ |
150 | 150 | |
151 | 151 | //----------子页返回父页触发---------- |
152 | 152 | onShow: function () { |
153 | + | |
154 | + util_pay.set_fir(); | |
155 | + var fy=ut.fy_back('',0); | |
156 | + if(fy){ | |
157 | + //支付失败 | |
158 | + setTimeout(function () { | |
159 | + var cps=getCurrentPages(); | |
160 | + if(cps.length>1){ | |
161 | + wx.navigateBack({delta: 1}) | |
162 | + }else{ | |
163 | + getApp().goto("/pages/index/index/index"); | |
164 | + } | |
165 | + | |
166 | + }, 1000) | |
167 | + return false; | |
168 | + } | |
169 | + | |
153 | 170 | var th = this; |
154 | 171 | th.setData({show_submit: 0}); //让提交先掩藏 |
155 | 172 | th.data.g_cart_q_time = null; | ... | ... |
packageC/pages/presell/cart/cart.js
... | ... | @@ -157,6 +157,11 @@ Page({ |
157 | 157 | |
158 | 158 | //----------子页返回父页触发---------- |
159 | 159 | onShow: function () { |
160 | + this.data.paying=0; | |
161 | + | |
162 | + var fy= ut.fy_back("/pages/user/order_list/order_list",1); | |
163 | + if(fy) return false; | |
164 | + | |
160 | 165 | util_pay.set_fir(); |
161 | 166 | var th = this; |
162 | 167 | th.setData({ show_submit: 0 }); //让提交先掩藏 |
... | ... | @@ -2853,6 +2858,9 @@ Page({ |
2853 | 2858 | |
2854 | 2859 | } |
2855 | 2860 | |
2861 | + if(this.data.paying) return false; | |
2862 | + this.data.paying=1; | |
2863 | + | |
2856 | 2864 | /*--- |
2857 | 2865 | o.jumpToCart4({ |
2858 | 2866 | order_sn: this.data.order.order_sn, | ... | ... |
packageC/pages/presell/cart/cart2.js
... | ... | @@ -160,6 +160,18 @@ Page({ |
160 | 160 | //----------子页返回父页触发---------- |
161 | 161 | onShow: function () { |
162 | 162 | var th = this; |
163 | + var fy= ut.fy_back('',0,function (){ | |
164 | + var cps = getCurrentPages(); | |
165 | + if (cps.length > 1) { | |
166 | + wx.navigateBack({ delta: 1 }) | |
167 | + } else { | |
168 | + getApp().goto("/pages/index/index/index"); | |
169 | + } | |
170 | + | |
171 | + }) | |
172 | + if(fy) return false; | |
173 | + | |
174 | + | |
163 | 175 | util_pay.set_fir(); |
164 | 176 | th.data.g_cart_q_time = null; |
165 | 177 | if (th.data.isclose == 0) { | ... | ... |
packageC/pages/presell/cart/cart2_pre.js
... | ... | @@ -251,6 +251,10 @@ Page({ |
251 | 251 | |
252 | 252 | //----------子页返回父页触发---------- |
253 | 253 | onShow: function () { |
254 | + | |
255 | + var fy=ut.fy_back("/pages/user/order_list/order_list",1); | |
256 | + if(fy) return false; | |
257 | + | |
254 | 258 | util_pay.set_fir(); |
255 | 259 | var th = this; |
256 | 260 | if (th.data.isclose == 0) { | ... | ... |
packageD/pages/shop/order_detail/order_detail.js
... | ... | @@ -30,6 +30,10 @@ Page({ |
30 | 30 | }), this.requestOrderDetail(e.order_id), wx.removeStorageSync("order:order_detail:update"); |
31 | 31 | }, |
32 | 32 | onShow: function() { |
33 | + this.setData({paying:0}); | |
34 | + ut.fy_back('',0); | |
35 | + py.set_fir(); | |
36 | + | |
33 | 37 | wx.getStorageSync("order:order_detail:update") && (wx.removeStorageSync("order:order_detail:update"), |
34 | 38 | this.requestOrderDetail(this.data.order.order_id)); |
35 | 39 | }, | ... | ... |
packageD/pages/user/deposit/prepaid/prepaid.js
... | ... | @@ -12,7 +12,8 @@ Page({ |
12 | 12 | data: { |
13 | 13 | iurl: o.imghost, |
14 | 14 | showModal: false, //弹框控制器 |
15 | - perpaid: [], //数据 | |
15 | + perpaid: [], //数据, | |
16 | + paying:0 | |
16 | 17 | }, |
17 | 18 | /* 生命周期函数--监听页面初次渲染完成*/ |
18 | 19 | onReady: function() { |
... | ... | @@ -94,10 +95,16 @@ Page({ |
94 | 95 | * 生命周期函数--监听页面显示 |
95 | 96 | */ |
96 | 97 | onShow: function () { |
97 | - wx.setNavigationBarTitle({ | |
98 | - title: "流动资金转预存", | |
99 | - }) | |
100 | - t_pay.set_fir(); | |
98 | + | |
99 | + | |
100 | + | |
101 | + wx.setNavigationBarTitle({ | |
102 | + title: "流动资金转预存", | |
103 | + }) | |
104 | + | |
105 | + this.data.paying=0; | |
106 | + ut.fy_back('',0) | |
107 | + t_pay.set_fir(); | |
101 | 108 | |
102 | 109 | if(getApp().globalData.user_id && !this.data.is_get){ |
103 | 110 | this.yuck(); |
... | ... | @@ -106,6 +113,9 @@ Page({ |
106 | 113 | }, |
107 | 114 | //确定充值 |
108 | 115 | determine: function(e) { |
116 | + if(this.data.paying) return false; | |
117 | + this.data.paying=1; | |
118 | + | |
109 | 119 | var th=this; |
110 | 120 | this.setData({ |
111 | 121 | showModal: false |
... | ... | @@ -122,6 +132,8 @@ Page({ |
122 | 132 | }, |
123 | 133 | //确定接口 |
124 | 134 | async recharge(money, advancek) { |
135 | + | |
136 | + | |
125 | 137 | console.log(money, "有进来吗银行卡", advancek); |
126 | 138 | var user_id = getApp().globalData.user_id; |
127 | 139 | var store_id = os.stoid; |
... | ... | @@ -164,6 +176,8 @@ Page({ |
164 | 176 | }, function () { |
165 | 177 | e.jumpPaymentPage(); |
166 | 178 | }, function (e) { |
179 | + | |
180 | + this.data.paying=0; | |
167 | 181 | wx.showToast({ |
168 | 182 | title: e, |
169 | 183 | icon: 'none', | ... | ... |
packageD/pages/user/integral/integral.js
... | ... | @@ -234,6 +234,10 @@ Page({ |
234 | 234 | |
235 | 235 | //点击确定 |
236 | 236 | determine(event) { |
237 | + | |
238 | + if(this.data.paying) return false; | |
239 | + this.data.paying=1; | |
240 | + | |
237 | 241 | console.log(event.currentTarget.dataset.money); |
238 | 242 | var money = event.currentTarget.dataset.money; |
239 | 243 | var integral = event.currentTarget.dataset.integral; |
... | ... | @@ -260,6 +264,7 @@ Page({ |
260 | 264 | }, function () { |
261 | 265 | th.jumpPaymentPage(); |
262 | 266 | }, function (e) { |
267 | + th.data.paying=0; | |
263 | 268 | wx.showToast({ |
264 | 269 | title: e, |
265 | 270 | icon: 'none', |
... | ... | @@ -325,6 +330,9 @@ Page({ |
325 | 330 | * 生命周期函数--监听页面显示 |
326 | 331 | */ |
327 | 332 | onShow: function () { |
333 | + | |
334 | + ut.fy_back('',0); | |
335 | + this.data.paying=0; | |
328 | 336 | t_pay.set_fir(); |
329 | 337 | getApp().check_can_share(); |
330 | 338 | //--先判断会员状态-- | ... | ... |
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -201,15 +201,12 @@ Page({ |
201 | 201 | |
202 | 202 | //----------子页返回父页触发---------- |
203 | 203 | onShow: function () { |
204 | - | |
205 | - if(getApp().globalData.fuiou_pay){ | |
206 | - getApp().globalData.fuiou_pay=0; | |
207 | - getApp().goto('pages/index/index/index'); | |
208 | - return false; | |
209 | - } | |
210 | - | |
204 | + //富友支付取消支付强行回去 | |
205 | + var fy=ut.fy_back("/pages/user/order_list/order_list",1); | |
206 | + if(fy) return false; | |
211 | 207 | |
212 | 208 | util_pay.set_fir(); |
209 | + | |
213 | 210 | var th = this; |
214 | 211 | th.data.g_cart_q_time = null; |
215 | 212 | |
... | ... | @@ -4515,6 +4512,8 @@ Page({ |
4515 | 4512 | // order_sn: data.data, |
4516 | 4513 | //}, 1); |
4517 | 4514 | |
4515 | + | |
4516 | + | |
4518 | 4517 | util_pay.pay(data.data, async function () { |
4519 | 4518 | //app.my_warnning("支付成功",1,th); |
4520 | 4519 | //setTimeout(function () { | ... | ... |
packageE/pages/user/cardinfo/cardinfo.js
... | ... | @@ -682,6 +682,8 @@ Page({ |
682 | 682 | * 生命周期函数--监听页面显示 |
683 | 683 | */ |
684 | 684 | onShow: function () { |
685 | + this.data.paying=0; | |
686 | + ut.fy_back('',0); | |
685 | 687 | t_pay.set_fir(); |
686 | 688 | //同步初始化 |
687 | 689 | this.init(); |
... | ... | @@ -745,7 +747,10 @@ Page({ |
745 | 747 | |
746 | 748 | |
747 | 749 | //-----立即续费的功能------ |
748 | - xufei:async function(){ | |
750 | + xufei:async function(){ | |
751 | + | |
752 | + | |
753 | + | |
749 | 754 | var th = this,is_card = 0,end_time=0; |
750 | 755 | await getApp().request.promiseGet("/store/storemoduleendtime/page?store_id="+os.stoid+"&type=3", |
751 | 756 | {1:1}).then(res => { |
... | ... | @@ -781,14 +786,20 @@ Page({ |
781 | 786 | return false; |
782 | 787 | } |
783 | 788 | |
789 | + if(this.data.paying) return false; | |
790 | + this.data.paying=1; | |
791 | + | |
792 | + | |
784 | 793 | var item = th.data.user_card; |
785 | 794 | var req = {}; |
786 | 795 | req.cardId = item.CardId; |
787 | 796 | req.rechargeType = 4; |
788 | 797 | //如果不是你导购,也不是等级会员分享 |
789 | 798 | req.storeId = os.stoid; |
790 | - req.userId = getApp().globalData.user_id; | |
791 | - t_pay.pay(req, th.success, function () { | |
799 | + req.userId = getApp().globalData.user_id; | |
800 | + t_pay.set_pay_url('/api/weshop/plus/create/plus/order'); | |
801 | + t_pay.pay(req, th.success, function (e) { | |
802 | + th.data.paying=0; | |
792 | 803 | getApp().my_warnning("支付失败", 0, th); |
793 | 804 | }); |
794 | 805 | |
... | ... | @@ -796,6 +807,7 @@ Page({ |
796 | 807 | |
797 | 808 | //--支付成功,跳转到等级卡续费页面-- |
798 | 809 | success:function (ind) { |
810 | + this.data.paying=0; | |
799 | 811 | if(ind==1){ |
800 | 812 | getApp().my_warnning("升级成功",0,this); |
801 | 813 | }else{ |
... | ... | @@ -845,6 +857,9 @@ Page({ |
845 | 857 | }, |
846 | 858 | |
847 | 859 | sure_pay:function () { |
860 | + if(this.data.paying) return false; | |
861 | + this.data.paying=1; | |
862 | + | |
848 | 863 | var th=this; |
849 | 864 | var req = {}; |
850 | 865 | req.cardId = th.data.s_card_id; |
... | ... | @@ -853,7 +868,9 @@ Page({ |
853 | 868 | req.storeId = os.stoid; |
854 | 869 | req.oldCardId=th.data.user_card.CardId; |
855 | 870 | req.userId = getApp().globalData.user_id; |
871 | + t_pay.set_pay_url('/api/weshop/plus/create/plus/order'); | |
856 | 872 | t_pay.pay(req, th.success, function () { |
873 | + th.data.paying=0; | |
857 | 874 | getApp().my_warnning("支付失败", 0, th); |
858 | 875 | }); |
859 | 876 | }, | ... | ... |
packageE/pages/user/monthgiftbag/giftpackbuy/giftpackbuy.js
... | ... | @@ -139,6 +139,22 @@ Page({ |
139 | 139 | this.getList(); |
140 | 140 | }, |
141 | 141 | onShow: function () { |
142 | + var th=this; | |
143 | + this.setData({submit:0}) | |
144 | + i.fy_back('',0,function (){ | |
145 | + | |
146 | + console.log(getApp().globalData.py_month_bg,'111111'); | |
147 | + console.log(th.data.back_ord,'22222'); | |
148 | + | |
149 | + if(getApp().globalData.py_month_bg && th.data.back_ord){ | |
150 | + var b_ord=th.data.back_ord; | |
151 | + com.reduce(b_ord,os.stoid); | |
152 | + //要进行清空粗粒 | |
153 | + getApp().globalData.py_month_bg=0; | |
154 | + th.data.back_ord=null; | |
155 | + | |
156 | + } | |
157 | + }) | |
142 | 158 | com.set_py_fir(); |
143 | 159 | getApp().check_can_share(); |
144 | 160 | var th=this; |
... | ... | @@ -178,6 +194,9 @@ Page({ |
178 | 194 | openSpecModal:1 |
179 | 195 | }) |
180 | 196 | }else{ |
197 | + | |
198 | + if(this.data.submit) return false; | |
199 | + | |
181 | 200 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
182 | 201 | my_confirm.open( |
183 | 202 | "是否确定购买该礼包", | ... | ... |
packageE/pages/user/monthgiftbag/giftpackinfo/giftpackinfo.js
... | ... | @@ -5,6 +5,7 @@ var e = getApp(), |
5 | 5 | d = e.globalData; |
6 | 6 | var ut = require("../../../../../utils/util.js"); |
7 | 7 | var com = require("../public/buy_com.js"); |
8 | +const i = require("../../../../../utils/util.js"); | |
8 | 9 | |
9 | 10 | Page({ |
10 | 11 | data: { |
... | ... | @@ -198,6 +199,18 @@ Page({ |
198 | 199 | }, |
199 | 200 | |
200 | 201 | onShow: function () { |
202 | + var th=this; | |
203 | + this.setData({submit:0}) | |
204 | + ut.fy_back('',0,function (){ | |
205 | + if(getApp().globalData.py_month_bg && th.data.back_ord){ | |
206 | + var b_ord=th.data.back_ord; | |
207 | + com.reduce(b_ord,os.stoid); | |
208 | + //要进行清空粗粒 | |
209 | + getApp().globalData.py_month_bg=0; | |
210 | + th.data.back_ord=null; | |
211 | + | |
212 | + } | |
213 | + }) | |
201 | 214 | com.set_py_fir(); |
202 | 215 | getApp().check_can_share(); |
203 | 216 | getApp().is_Single_page(this, function () { |
... | ... | @@ -226,6 +239,8 @@ Page({ |
226 | 239 | openSpecModal: 1 |
227 | 240 | }) |
228 | 241 | } else { |
242 | + | |
243 | + if(this.data.submit) return false; | |
229 | 244 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
230 | 245 | my_confirm.open( |
231 | 246 | "是否确定购买该礼包", | ... | ... |
packageE/pages/user/monthgiftbag/giftpacklist/giftpacklist.js
... | ... | @@ -173,6 +173,18 @@ Page({ |
173 | 173 | }, |
174 | 174 | |
175 | 175 | onShow: function () { |
176 | + var th=this; | |
177 | + this.setData({submit:0}) | |
178 | + ut.fy_back('',0,function (){ | |
179 | + if(getApp().globalData.py_month_bg && th.data.back_ord){ | |
180 | + var b_ord=th.data.back_ord; | |
181 | + com.reduce(b_ord,os.stoid); | |
182 | + //要进行清空粗粒 | |
183 | + getApp().globalData.py_month_bg=0; | |
184 | + th.data.back_ord=null; | |
185 | + } | |
186 | + }); | |
187 | + | |
176 | 188 | com.set_py_fir(); |
177 | 189 | getApp().check_can_share(); |
178 | 190 | getApp().is_Single_page(this, function () { |
... | ... | @@ -201,6 +213,10 @@ Page({ |
201 | 213 | openSpecModal: 1 |
202 | 214 | }) |
203 | 215 | } else { |
216 | + | |
217 | + if(this.data.submit) return false; | |
218 | + this.setData({submit:1}) | |
219 | + | |
204 | 220 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
205 | 221 | my_confirm.open( |
206 | 222 | "是否确定购买该礼包", |
... | ... | @@ -234,6 +250,8 @@ Page({ |
234 | 250 | openSpecModal: 1 |
235 | 251 | }) |
236 | 252 | } else { |
253 | + | |
254 | + if(this.data.submit) return false; | |
237 | 255 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
238 | 256 | my_confirm.open( |
239 | 257 | "是否确定兑换该礼包", | ... | ... |
packageE/pages/user/monthgiftbag/public/buy_com.js
... | ... | @@ -215,7 +215,9 @@ module.exports = { |
215 | 215 | } |
216 | 216 | } |
217 | 217 | |
218 | + if(th.data.submit) return false; | |
218 | 219 | th.setData({submit:1}) |
220 | + | |
219 | 221 | var id=th.data.sele_g.id; |
220 | 222 | var that=th; |
221 | 223 | var json = { |
... | ... | @@ -257,11 +259,15 @@ module.exports = { |
257 | 259 | break; |
258 | 260 | case 2://立即购买 |
259 | 261 | var order_sn = res.data.data.orderSn; |
262 | + th.data.back_ord=order_sn; | |
260 | 263 | //res = res.data.data.result; |
261 | 264 | //if (!res) return false; |
262 | 265 | var money=that.data.payMoney; |
263 | 266 | var url = "/packageE/pages/user/monthgiftbag/payment/payment?money=" + money + "&order_sn=" + order_sn; |
267 | + | |
264 | 268 | getApp().globalData.no_clear=1; |
269 | + getApp().globalData.py_month_bg=1; | |
270 | + | |
265 | 271 | |
266 | 272 | t_pay.pay_data(res,function (){ |
267 | 273 | th.setData({submit:0}) | ... | ... |
pages/cart/cart2_inte/cart2_inte.js
... | ... | @@ -161,6 +161,20 @@ Page({ |
161 | 161 | |
162 | 162 | //----------子页返回父页触发---------- |
163 | 163 | onShow: function () { |
164 | + | |
165 | + var fy=ut.fy_back('',1,function (){ | |
166 | + var cps = getCurrentPages(); | |
167 | + if (cps.length > 1) { | |
168 | + wx.navigateBack({ delta: 1 }) | |
169 | + } else { | |
170 | + getApp().goto("/pages/index/index/index"); | |
171 | + } | |
172 | + }); | |
173 | + | |
174 | + if(fy) return false; | |
175 | + | |
176 | + util_pay.set_fir(); | |
177 | + | |
164 | 178 | var th = this; |
165 | 179 | th.data.g_cart_q_time = null; |
166 | 180 | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -532,6 +532,12 @@ Page({ |
532 | 532 | |
533 | 533 | //----------子页返回父页触发---------- |
534 | 534 | onShow: function () { |
535 | + | |
536 | + var fy=ut.fy_back("/pages/user/order_list/order_list",1); | |
537 | + if(fy) return false; | |
538 | + | |
539 | + util_pay.set_fir(); | |
540 | + | |
535 | 541 | var th = this; |
536 | 542 | if (th.data.isclose == 0) { |
537 | 543 | wx.navigateTo({ | ... | ... |
pages/cart/cart_wk/cart_wk.js
pages/giftpack/buygiftpack/giftpackbuy.js
... | ... | @@ -139,6 +139,9 @@ Page({ |
139 | 139 | this.getList(); |
140 | 140 | }, |
141 | 141 | onShow: function () { |
142 | + | |
143 | + this.setData({submit:0}) | |
144 | + i.fy_back('',0); | |
142 | 145 | com.set_py_fir(); |
143 | 146 | getApp().check_can_share(); |
144 | 147 | var th=this; |
... | ... | @@ -158,6 +161,11 @@ Page({ |
158 | 161 | |
159 | 162 | }) |
160 | 163 | this.init(); |
164 | + | |
165 | + setTimeout(()=>{ | |
166 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | |
167 | + },2000) | |
168 | + | |
161 | 169 | }, |
162 | 170 | |
163 | 171 | //购买礼包 |
... | ... | @@ -178,6 +186,9 @@ Page({ |
178 | 186 | openSpecModal:1 |
179 | 187 | }) |
180 | 188 | }else{ |
189 | + | |
190 | + if(this.data.submit) return false; | |
191 | + | |
181 | 192 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
182 | 193 | my_confirm.open( |
183 | 194 | "是否确定购买该礼包", |
... | ... | @@ -214,6 +225,9 @@ Page({ |
214 | 225 | openSpecModal:1 |
215 | 226 | }) |
216 | 227 | }else { |
228 | + | |
229 | + if(this.data.submit) return false; | |
230 | + | |
217 | 231 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
218 | 232 | my_confirm.open( |
219 | 233 | "是否确定兑换该礼包", |
... | ... | @@ -246,7 +260,7 @@ Page({ |
246 | 260 | openSpecModal:1 |
247 | 261 | }) |
248 | 262 | }else { |
249 | - | |
263 | + if(this.data.submit) return false; | |
250 | 264 | |
251 | 265 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
252 | 266 | my_confirm.open( | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.js
... | ... | @@ -74,7 +74,8 @@ Page({ |
74 | 74 | giftImageCover:null, |
75 | 75 | canvasHidden:true, |
76 | 76 | |
77 | - screenWidth: 0 | |
77 | + screenWidth: 0, | |
78 | + submit:0 | |
78 | 79 | }, |
79 | 80 | onLoad: function (options) { |
80 | 81 | |
... | ... | @@ -165,6 +166,8 @@ Page({ |
165 | 166 | }, |
166 | 167 | |
167 | 168 | onShow: function () { |
169 | + this.setData({submit:0}) | |
170 | + ut.fy_back('',0); | |
168 | 171 | com.set_py_fir(); |
169 | 172 | getApp().check_can_share(); |
170 | 173 | getApp().is_Single_page(this, function () { |
... | ... | @@ -176,6 +179,7 @@ Page({ |
176 | 179 | } |
177 | 180 | this.init(); |
178 | 181 | }) |
182 | + th.setData({ submit:0}) | |
179 | 183 | }, |
180 | 184 | GetBuyPrice: function (e) { |
181 | 185 | var that = this.data; |
... | ... | @@ -186,6 +190,10 @@ Page({ |
186 | 190 | return false; |
187 | 191 | } |
188 | 192 | |
193 | + if(th.data.submit) return false; | |
194 | + th.setData({submit:1}) | |
195 | + | |
196 | + | |
189 | 197 | this.data.payMoney = th.data.sele_g.payMoney; |
190 | 198 | th.setData({buyType: 2}) |
191 | 199 | if (th.data.sele_g.is_pickup) { | ... | ... |
pages/user/order_detail/order_detail.js
... | ... | @@ -64,6 +64,8 @@ Page({ |
64 | 64 | }), this.requestOrderDetail(e.order_id), wx.removeStorageSync("order:order_detail:update"); |
65 | 65 | }, |
66 | 66 | onShow: function() { |
67 | + ut.fy_back('',0) | |
68 | + this.setData({paying:0}); | |
67 | 69 | py.set_fir(); |
68 | 70 | wx.getStorageSync("order:order_detail:update") && (wx.removeStorageSync("order:order_detail:update"), |
69 | 71 | this.requestOrderDetail(this.data.order.order_id)); | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -76,6 +76,8 @@ Page({ |
76 | 76 | cardList: [], |
77 | 77 | // 搜索内容 |
78 | 78 | searchContent: '', |
79 | + | |
80 | + ser_paying:0, | |
79 | 81 | }, |
80 | 82 | onLoad: function (t) { |
81 | 83 | |
... | ... | @@ -109,6 +111,12 @@ Page({ |
109 | 111 | s.init(this, "", "orderList"); |
110 | 112 | }, |
111 | 113 | onShow: function () { |
114 | + | |
115 | + | |
116 | + ut.fy_back('',0) | |
117 | + this.setData({ paying: 0 }); | |
118 | + this.data.ser_paying=0; | |
119 | + | |
112 | 120 | t_pay.set_fir(); |
113 | 121 | t.set_fir(); |
114 | 122 | |
... | ... | @@ -2594,6 +2602,9 @@ Page({ |
2594 | 2602 | |
2595 | 2603 | }; |
2596 | 2604 | |
2605 | + if(th.data.ser_paying) return false; | |
2606 | + th.data.ser_paying=1; | |
2607 | + | |
2597 | 2608 | |
2598 | 2609 | if (flag) { |
2599 | 2610 | |
... | ... | @@ -2602,12 +2613,14 @@ Page({ |
2602 | 2613 | parentSn: order_sn, |
2603 | 2614 | store_id: store_id |
2604 | 2615 | }, function () { |
2616 | + th.data.ser_paying=0; | |
2605 | 2617 | wx.showToast({ |
2606 | 2618 | title: '支付成功', |
2607 | 2619 | icon:'success', |
2608 | 2620 | duration: 2000 |
2609 | 2621 | }); |
2610 | 2622 | }, function (e) { |
2623 | + th.data.ser_paying=0; | |
2611 | 2624 | wx.showToast({ |
2612 | 2625 | title: e, |
2613 | 2626 | icon: 'none', | ... | ... |
pages/user/plus/plus.js
... | ... | @@ -127,7 +127,12 @@ Page({ |
127 | 127 | onShow: function () { |
128 | 128 | var user_info = getApp().globalData.userInfo; |
129 | 129 | if (!user_info) return false; |
130 | + ut.fy_back('',0); | |
130 | 131 | |
132 | + th.setData({ | |
133 | + is_select:0, | |
134 | + focus:true, | |
135 | + }) | |
131 | 136 | t_pay.set_fir(); |
132 | 137 | |
133 | 138 | var th = this, |
... | ... | @@ -459,6 +464,7 @@ Page({ |
459 | 464 | // } |
460 | 465 | // }) |
461 | 466 | } else { |
467 | + t_pay.set_pay_url('/api/weshop/plus/create/plus/order'); | |
462 | 468 | t_pay.pay(req, th.success, function () { |
463 | 469 | getApp().my_warnning("支付失败", 0, th); |
464 | 470 | th.setData({ |
... | ... | @@ -492,6 +498,7 @@ Page({ |
492 | 498 | staffNo_arr: res.data.data |
493 | 499 | }) |
494 | 500 | }else{ |
501 | + t_pay.set_pay_url('/api/weshop/plus/create/plus/order'); | |
495 | 502 | t_pay.pay(req, th.success, function () { |
496 | 503 | getApp().my_warnning("支付失败", 0, th); |
497 | 504 | th.setData({ |
... | ... | @@ -522,7 +529,14 @@ Page({ |
522 | 529 | //--支付成功,跳转到等级卡续费页面-- |
523 | 530 | success: function () { |
524 | 531 | //调一次就不再调用了 |
525 | - if (getApp().globalData.is_card_back) return false; | |
532 | + if (getApp().globalData.is_card_back){ | |
533 | + th.setData({ | |
534 | + is_select:0, | |
535 | + focus:true, | |
536 | + }) | |
537 | + return false; | |
538 | + | |
539 | + } | |
526 | 540 | if (getApp().globalData.plus_buy_back) { |
527 | 541 | //值在这里换 |
528 | 542 | getApp().globalData.is_card_back = 1; | ... | ... |
utils/pay2.js
... | ... | @@ -27,6 +27,7 @@ module.exports = { |
27 | 27 | if(t.data.data.is_fuioupay){ |
28 | 28 | const plugin = requirePlugin('fuiou-pay') |
29 | 29 | getApp().globalData.no_clear=1; |
30 | + getApp().globalData.fuiou_pay=1; | |
30 | 31 | |
31 | 32 | var paramsJson={ |
32 | 33 | reqType:"11",//必填 01-商户模式,11-机构模式 |
... | ... | @@ -35,6 +36,7 @@ module.exports = { |
35 | 36 | console.log(plugin, plugin.fuioupay) |
36 | 37 | plugin.fuioupay(parseInt(t.data.data.amt),paramsJson,function (res){ |
37 | 38 | console.log(res); |
39 | + getApp().globalData.fuiou_pay=0; | |
38 | 40 | i.wx_paying=0; |
39 | 41 | "function" == typeof succ && succ(); |
40 | 42 | },function (error){ |
... | ... | @@ -42,6 +44,7 @@ module.exports = { |
42 | 44 | //支付失败的时候 |
43 | 45 | //getApp().confirmBox(error.code+error.message); |
44 | 46 | var msg='取消支付'; |
47 | + getApp().globalData.fuiou_pay=0; | |
45 | 48 | if(error.code){ |
46 | 49 | msg=error.code+":"+error.message; |
47 | 50 | } |
... | ... | @@ -88,12 +91,17 @@ module.exports = { |
88 | 91 | reqData:ob.reqData,//必填 富友加密参数 |
89 | 92 | } |
90 | 93 | getApp().globalData.no_clear=1; |
94 | + getApp().globalData.fuiou_pay=1; | |
95 | + | |
96 | + | |
91 | 97 | console.log(plugin, plugin.fuioupay) |
92 | 98 | plugin.fuioupay(parseInt(ob.amt),paramsJson,function (res){ |
99 | + getApp().globalData.fuiou_pay=0; | |
93 | 100 | console.log(res); |
94 | 101 | th.wx_paying=0; |
95 | 102 | "function" == typeof succ && succ(); |
96 | 103 | },function (error){ |
104 | + getApp().globalData.fuiou_pay=0; | |
97 | 105 | th.wx_paying=0; |
98 | 106 | console.log("插件支付错误",error); |
99 | 107 | //支付失败的时候 | ... | ... |
utils/util.js
... | ... | @@ -763,6 +763,43 @@ module.exports = { |
763 | 763 | }) |
764 | 764 | }, |
765 | 765 | |
766 | + //是不是富友的返回 | |
767 | + fy_back(url,is_need_back,func){ | |
768 | + var fy=getApp().globalData.fuiou_pay; | |
769 | + console.log('cart2-show:'+fy); | |
770 | + if(fy){ | |
771 | + getApp().globalData.fuiou_pay=0; | |
772 | + wx.showToast({ | |
773 | + title:'取消支付', | |
774 | + icon:'none', | |
775 | + duration:2500 | |
776 | + }) | |
777 | + | |
778 | + if(is_need_back){ | |
779 | + if(url){ | |
780 | + setTimeout(()=>{ | |
781 | + getApp().goto(url); | |
782 | + },2000); | |
783 | + }else{ | |
784 | + if(func) { | |
785 | + func(); | |
786 | + }else{ | |
787 | + //支付失败 | |
788 | + setTimeout(function () { | |
789 | + wx.navigateBack({ delta: 1 }) | |
790 | + }, 1000) | |
791 | + } | |
792 | + } | |
793 | + }else{ | |
794 | + if(func) func(); | |
795 | + } | |
796 | + return true ; | |
797 | + | |
798 | + } | |
799 | + return false | |
800 | + }, | |
801 | + | |
802 | + | |
766 | 803 | unserialize: unserialize, |
767 | 804 | _throttle:_throttle, |
768 | 805 | unserialize_o: unserialize_o, | ... | ... |