| | |
| | | // #endif |
| | | //公众号支付 |
| | | // #ifdef H5 |
| | | if(self.isWeixin()){ |
| | | if (self.isWeixin()) { |
| | | WeixinJSBridge.invoke('getBrandWCPayRequest', JSON.parse(result.data.payment), |
| | | function(res) { |
| | | if (res.err_msg == "get_brand_wcpay_request:ok") { |
| | |
| | | } |
| | | } |
| | | ); |
| | | }else{ |
| | | } else { |
| | | window.location.href = result.data.payment.mweb_url + '&redirect_url=' + result.data.return_Url; |
| | | return; |
| | | } |
| | | // #endif |
| | | // #ifdef APP-PLUS |
| | | //微信支付 |
| | | wxAppPay(result, self,success, fail); |
| | | wxAppPay(result, self, success, fail); |
| | | return; |
| | | // #endif |
| | | } |
| | |
| | | // 支付宝支付 |
| | | if (result.data.pay_type == 30) { |
| | | // #ifdef APP-PLUS |
| | | aliAppPay(result, self,success, fail); |
| | | aliAppPay(result, self, success, fail); |
| | | // #endif |
| | | // #ifdef H5 |
| | | const div = document.createElement('formdiv'); |
| | |
| | | |
| | | /*跳到支付成功页*/ |
| | | function paySuccess(result, self, success) { |
| | | if(success){ |
| | | if (success) { |
| | | success(result); |
| | | return; |
| | | } |
| | |
| | | } |
| | | /*跳到支付成功页*/ |
| | | function gotoSuccess(result) { |
| | | uni.reLaunch({ |
| | | url: '/pages/order/pay-success/pay-success?order_id=' + result.data.order_id |
| | | }); |
| | | if (result.data.order_type == 100) { |
| | | uni.reLaunch({ |
| | | url: '/pages/plus/business/detail?business_card_id=' + result.data.business_card_id |
| | | }); |
| | | } else { |
| | | uni.reLaunch({ |
| | | url: '/pages/order/pay-success/pay-success?order_id=' + result.data.order_id |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | /*支付失败跳订单详情*/ |
| | | function payError(result, fail) { |
| | | if(fail){ |
| | | if (fail) { |
| | | fail(result); |
| | | return; |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | function wxAppPay(result, self,success, fail){ |
| | | function wxAppPay(result, self, success, fail) { |
| | | // 获取支付通道 |
| | | plus.payment.getChannels(function(channels) { |
| | | self.channel = channels[0]; |
| | |
| | | }); |
| | | } |
| | | |
| | | function aliAppPay(result, self,success, fail){ |
| | | function aliAppPay(result, self, success, fail) { |
| | | console.log(result.data.payment); |
| | | uni.requestPayment({ |
| | | provider: 'alipay', |