Commit bfb6a525630dc0b3bc51b8dcb1110e25b795973b

Authored by yvan.ni
1 parent 1bbbf3d6

支付回退的事件的优化

packageE/pages/cart/cart2/cart2.js
@@ -201,6 +201,14 @@ Page({ @@ -201,6 +201,14 @@ Page({
201 201
202 //----------子页返回父页触发---------- 202 //----------子页返回父页触发----------
203 onShow: function () { 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 +
  211 +
204 util_pay.set_fir(); 212 util_pay.set_fir();
205 var th = this; 213 var th = this;
206 th.data.g_cart_q_time = null; 214 th.data.g_cart_q_time = null;
utils/pay.js
@@ -52,6 +52,8 @@ module.exports = { @@ -52,6 +52,8 @@ module.exports = {
52 if(t.data.data.is_fuioupay){ 52 if(t.data.data.is_fuioupay){
53 const plugin = requirePlugin('fuiou-pay') 53 const plugin = requirePlugin('fuiou-pay')
54 getApp().globalData.no_clear=1; 54 getApp().globalData.no_clear=1;
  55 + getApp().globalData.fuiou_pay=1;
  56 +
55 57
56 var paramsJson={ 58 var paramsJson={
57 reqType:"11",//必填 01-商户模式,11-机构模式 59 reqType:"11",//必填 01-商户模式,11-机构模式
@@ -60,6 +62,7 @@ module.exports = { @@ -60,6 +62,7 @@ module.exports = {
60 console.log(plugin, plugin.fuioupay) 62 console.log(plugin, plugin.fuioupay)
61 plugin.fuioupay(parseInt(t.data.data.amt),paramsJson,function (res){ 63 plugin.fuioupay(parseInt(t.data.data.amt),paramsJson,function (res){
62 console.log(res); 64 console.log(res);
  65 + getApp().globalData.fuiou_pay=0;
63 i.wx_paying=0; 66 i.wx_paying=0;
64 getApp().showSuccess("支付成功!", e); 67 getApp().showSuccess("支付成功!", e);
65 68
@@ -67,6 +70,7 @@ module.exports = { @@ -67,6 +70,7 @@ module.exports = {
67 console.log("插件支付错误",error); 70 console.log("插件支付错误",error);
68 //支付失败的时候 71 //支付失败的时候
69 i.wx_paying=0; 72 i.wx_paying=0;
  73 + getApp().globalData.fuiou_pay=0;
70 var msg='取消支付'; 74 var msg='取消支付';
71 if(error.code){ 75 if(error.code){
72 msg=error.code+":"+error.message; 76 msg=error.code+":"+error.message;