var t = getApp(), n = t.request; module.exports = { url: "/api/weshop/plus/create/plus/order", pay: function(dd, succ,fail) { var i = this; n.post(this.url, { data: dd, success: function(t) { if(t.data.code==0){ if(t.data.data=="升级成功"){ "function" == typeof succ && succ(1); }else{ i.weixinPay(t.data.data, succ,fail); } }else{ "function" == typeof fail && fail(); } return false; }, fail: function() { "function" == typeof fail && fail(); }, failStatus: function() { "function" == typeof fail && fail(); } }); }, weixinPay: function(n, succ,fail) { if(!n) return false; wx.requestPayment({ timeStamp: String(n.timeStamp), nonceStr: n.nonceStr, package: n.packageValue, signType: n.signType, paySign: n.paySign, success: function(n) { "function" == typeof succ && succ(); }, fail: function(n) { "function" == typeof fail && fail(); } }); } };