Commit 4bd67de609553ddc76cf11e95f178a7d42369d7a
1 parent
20bfba57
~~ 尾款支付的优化 ~~
Showing
3 changed files
with
56 additions
and
27 deletions
packageC/pages/presell/cart/cart.js
| @@ -2397,22 +2397,40 @@ Page({ | @@ -2397,22 +2397,40 @@ Page({ | ||
| 2397 | 2397 | ||
| 2398 | //---用微信支付--- | 2398 | //---用微信支付--- |
| 2399 | if (dd.tail_pay_type == 0) { | 2399 | if (dd.tail_pay_type == 0) { |
| 2400 | - var n = t.data.data; | ||
| 2401 | - th.weixinPay(n, | ||
| 2402 | - function () { | ||
| 2403 | - //---用余额支付--- | ||
| 2404 | - getApp().my_warnning("支付成功", 1, th); | ||
| 2405 | - var send_time = th.data.pre_arr.delivery_date; | ||
| 2406 | - if (th.data.pre_arr.delivery_type == 2) { | ||
| 2407 | - send_time = th.data.pre_arr.delivery_daynum * 3600; | ||
| 2408 | - } | ||
| 2409 | - th.setData({ isclose: 0, 'order.order_status': 1, 'order.pay_status': 1, 'wait_wk': 0, 'presell.tail_pay_state': 1, 'wait_fh': 1, send_time: send_time }); | ||
| 2410 | - this.data.paying=0; | ||
| 2411 | - | ||
| 2412 | - }, function () { | ||
| 2413 | - this.data.paying=0; | ||
| 2414 | - getApp().my_warnning("支付失败", 0, th); | ||
| 2415 | - }) | 2400 | + util_pay.pay_data(t,function (){ |
| 2401 | + //---用余额支付--- | ||
| 2402 | + getApp().my_warnning("支付成功", 1, th); | ||
| 2403 | + var send_time = th.data.pre_arr.delivery_date; | ||
| 2404 | + if (th.data.pre_arr.delivery_type == 2) { | ||
| 2405 | + send_time = th.data.pre_arr.delivery_daynum * 3600; | ||
| 2406 | + } | ||
| 2407 | + th.setData({ isclose: 0, 'order.order_status': 1, 'order.pay_status': 1, 'wait_wk': 0, 'presell.tail_pay_state': 1, 'wait_fh': 1, send_time: send_time }); | ||
| 2408 | + th.data.paying=0; | ||
| 2409 | + | ||
| 2410 | + },function (e){ | ||
| 2411 | + th.data.paying=0; | ||
| 2412 | + wx.showToast({ | ||
| 2413 | + title:e, | ||
| 2414 | + icon: 'none', | ||
| 2415 | + duration: 2500 | ||
| 2416 | + }) | ||
| 2417 | + }) | ||
| 2418 | + // var n = t.data.data; | ||
| 2419 | + // th.weixinPay(n, | ||
| 2420 | + // function () { | ||
| 2421 | + // //---用余额支付--- | ||
| 2422 | + // getApp().my_warnning("支付成功", 1, th); | ||
| 2423 | + // var send_time = th.data.pre_arr.delivery_date; | ||
| 2424 | + // if (th.data.pre_arr.delivery_type == 2) { | ||
| 2425 | + // send_time = th.data.pre_arr.delivery_daynum * 3600; | ||
| 2426 | + // } | ||
| 2427 | + // th.setData({ isclose: 0, 'order.order_status': 1, 'order.pay_status': 1, 'wait_wk': 0, 'presell.tail_pay_state': 1, 'wait_fh': 1, send_time: send_time }); | ||
| 2428 | + // th.data.paying=0; | ||
| 2429 | + // | ||
| 2430 | + // }, function () { | ||
| 2431 | + // this.data.paying=0; | ||
| 2432 | + // getApp().my_warnning("支付失败", 0, th); | ||
| 2433 | + // }) | ||
| 2416 | } else { | 2434 | } else { |
| 2417 | if (t.data.code == 0) { | 2435 | if (t.data.code == 0) { |
| 2418 | var send_time = th.data.pre_arr.delivery_date; | 2436 | var send_time = th.data.pre_arr.delivery_date; |
| @@ -2426,7 +2444,7 @@ Page({ | @@ -2426,7 +2444,7 @@ Page({ | ||
| 2426 | } else { | 2444 | } else { |
| 2427 | getApp().my_warnning(t.data.msg, 1, th); | 2445 | getApp().my_warnning(t.data.msg, 1, th); |
| 2428 | } | 2446 | } |
| 2429 | - this.data.paying=0; | 2447 | + th.data.paying=0; |
| 2430 | } | 2448 | } |
| 2431 | } | 2449 | } |
| 2432 | }); | 2450 | }); |
packageE/pages/cart/cart2/cart2.js
| @@ -1291,7 +1291,7 @@ Page({ | @@ -1291,7 +1291,7 @@ Page({ | ||
| 1291 | wx.showToast({ | 1291 | wx.showToast({ |
| 1292 | title: "视频号仅支持物流", | 1292 | title: "视频号仅支持物流", |
| 1293 | icon: 'none', | 1293 | icon: 'none', |
| 1294 | - duration: 2000 | 1294 | + duration: 2500 |
| 1295 | }) | 1295 | }) |
| 1296 | 1296 | ||
| 1297 | setTimeout(function () { | 1297 | setTimeout(function () { |
pages/cart/cart_wk/cart_wk.js
| @@ -3,6 +3,7 @@ var t = getApp(), | @@ -3,6 +3,7 @@ var t = getApp(), | ||
| 3 | oo = t.globalData.setting, | 3 | oo = t.globalData.setting, |
| 4 | os=oo; | 4 | os=oo; |
| 5 | var ut=require("../../../utils/util.js"); | 5 | var ut=require("../../../utils/util.js"); |
| 6 | +var util_pay=require("../../../utils/pay.js"); | ||
| 6 | var regeneratorRuntime = require('../../../utils/runtime.js'); | 7 | var regeneratorRuntime = require('../../../utils/runtime.js'); |
| 7 | 8 | ||
| 8 | Page({ | 9 | Page({ |
| @@ -86,6 +87,7 @@ Page({ | @@ -86,6 +87,7 @@ Page({ | ||
| 86 | * 生命周期函数--监听页面显示 | 87 | * 生命周期函数--监听页面显示 |
| 87 | */ | 88 | */ |
| 88 | onShow: function () { | 89 | onShow: function () { |
| 90 | + util_pay.set_fir(); | ||
| 89 | getApp().check_can_share(); | 91 | getApp().check_can_share(); |
| 90 | var th = this; | 92 | var th = this; |
| 91 | if (th.data.isclose == 0) { | 93 | if (th.data.isclose == 0) { |
| @@ -606,15 +608,24 @@ Page({ | @@ -606,15 +608,24 @@ Page({ | ||
| 606 | 608 | ||
| 607 | //---用微信支付--- | 609 | //---用微信支付--- |
| 608 | if (dd.tail_pay_type == 0) { | 610 | if (dd.tail_pay_type == 0) { |
| 609 | - var n = t.data.data; | ||
| 610 | - th.weixinPay(n, | ||
| 611 | - function () { | ||
| 612 | - var allmoney = th.data.allpice; | ||
| 613 | - th.jumpPaymentPage(th.data.order.order_sn, allmoney); | ||
| 614 | - }, function () { | ||
| 615 | - th.data.paying=0; | ||
| 616 | - getApp().my_warnning("支付失败", 0, th); | ||
| 617 | - }) | 611 | + |
| 612 | + util_pay.pay_data(t,function (){ | ||
| 613 | + var allmoney = th.data.allpice; | ||
| 614 | + th.jumpPaymentPage(th.data.order.order_sn, allmoney); | ||
| 615 | + },function (){ | ||
| 616 | + th.data.paying=0; | ||
| 617 | + getApp().my_warnning("支付失败", 0, th); | ||
| 618 | + }) | ||
| 619 | + | ||
| 620 | + //var n = t.data.data; | ||
| 621 | + // th.weixinPay(n, | ||
| 622 | + // function () { | ||
| 623 | + // var allmoney = th.data.allpice; | ||
| 624 | + // th.jumpPaymentPage(th.data.order.order_sn, allmoney); | ||
| 625 | + // }, function () { | ||
| 626 | + // th.data.paying=0; | ||
| 627 | + // getApp().my_warnning("支付失败", 0, th); | ||
| 628 | + // }) | ||
| 618 | } else { | 629 | } else { |
| 619 | if (t.data.code == 0) { | 630 | if (t.data.code == 0) { |
| 620 | //---用余额支付--- | 631 | //---用余额支付--- |