quanwei
2025-10-31 7a27a1d4d0038abe2115adb1753f897f56d66323
mobile/common/pay.js
@@ -30,7 +30,7 @@
      // #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") {
@@ -46,14 +46,14 @@
               }
            }
         );
      }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
   }
@@ -64,7 +64,7 @@
   // 支付宝支付
   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');
@@ -78,7 +78,7 @@
/*跳到支付成功页*/
function paySuccess(result, self, success) {
   if(success){
   if (success) {
      success(result);
      return;
   }
@@ -86,14 +86,21 @@
}
/*跳到支付成功页*/
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;
   }
@@ -102,7 +109,7 @@
   });
}
function wxAppPay(result, self,success, fail){
function wxAppPay(result, self, success, fail) {
   // 获取支付通道  
   plus.payment.getChannels(function(channels) {
      self.channel = channels[0];
@@ -125,7 +132,7 @@
   });
}
function aliAppPay(result, self,success, fail){
function aliAppPay(result, self, success, fail) {
   console.log(result.data.payment);
   uni.requestPayment({
      provider: 'alipay',