Commit 078a90fcadfdbd6b46543bae43e8f24b01c27900

Authored by yvan.ni
1 parent cb6de0d9

支付的优化

Showing 1 changed file with 27 additions and 1 deletions
utils/pay.js
... ... @@ -43,7 +43,33 @@ module.exports = {
43 43 success: function(t) {
44 44 wx.hideLoading();
45 45 if(t.data.code==0){
46   - i.weixinPay(t.data.data, e, a);
  46 +
  47 + if(t.data.data.is_fuioupay){
  48 + const plugin = requirePlugin('fuiou-pay')
  49 +
  50 + var paramsJson={
  51 + reqType:"11",//必填 01-商户模式,11-机构模式
  52 + reqData:t.data.data.reqData,//必填 富友加密参数
  53 + }
  54 + plugin.fuioupay(parseInt(t.data.data.amt),paramsJson,function (res){
  55 + wx_paying=0;
  56 + getApp().showSuccess("支付成功!", e);
  57 +
  58 + },function (){
  59 + //支付失败的时候
  60 + setTimeout(function(){
  61 + wx.redirectTo({
  62 + url: "/pages/user/order_list/order_list",
  63 + });
  64 + },1000)
  65 + wx_paying=0;
  66 + })
  67 + }else{
  68 + i.weixinPay(t.data.data, e, a);
  69 + }
  70 +
  71 +
  72 +
47 73 }else{
48 74 getApp().confirmBox(t.data.msg);
49 75 setTimeout(function(){
... ...