Commit df6da6c27e1698cfd560051d7ed4e1b053939107

Authored by yvan.ni
1 parent f856251d

等级卡bug的优化

pages/user/plus/plus.js
@@ -531,8 +531,20 @@ Page({ @@ -531,8 +531,20 @@ Page({
531 } else { 531 } else {
532 t_pay.set_pay_url('/api/weshop/plus/create/plus/order'); 532 t_pay.set_pay_url('/api/weshop/plus/create/plus/order');
533 t_pay.pay(req, th.success, function (msg) { 533 t_pay.pay(req, th.success, function (msg) {
534 - if(!msg) msg='支付失败';  
535 - getApp().my_warnning(msg, 0, th); 534 +
  535 + if( typeof msg === 'object' && msg !== null && msg.code==-2){
  536 + wx.showModal({
  537 + title: msg.msg,
  538 + showCancel: !1,
  539 + complete: function () {
  540 + getApp().goto('/packageE/pages/user/cardinfo/cardinfo');
  541 + }
  542 + });
  543 + }else{
  544 + if(!msg) msg='支付失败';
  545 + getApp().my_warnning(msg, 0, th);
  546 + }
  547 +
536 th.setData({ 548 th.setData({
537 is_select:0, 549 is_select:0,
538 focus:true, 550 focus:true,
utils/pay2.js
@@ -88,7 +88,12 @@ module.exports = { @@ -88,7 +88,12 @@ module.exports = {
88 i.weixinPay(t.data.data, succ, fail); 88 i.weixinPay(t.data.data, succ, fail);
89 } 89 }
90 } 90 }
91 - }else{ 91 + }
  92 + else if(t.data.code==-2 && dd.rechargeType==3){
  93 + i.wx_paying=0;
  94 + "function" == typeof fail && fail(t.data);
  95 + }
  96 + else{
92 i.wx_paying=0; 97 i.wx_paying=0;
93 "function" == typeof fail && fail(t.data.msg); 98 "function" == typeof fail && fail(t.data.msg);
94 } 99 }