zhengjinyi 3 лет назад
Родитель
Сommit
a8844068d7

+ 16 - 341
src/main/resources/static/js/pay/caimei-hlbpay.js

@@ -3,6 +3,7 @@
  */
 var payContainer = new Vue({
     el:"#payContainer",
+    mixins: [hlbPayMixin],
     data: {
         isSubMitStatus:false,
         payInfo:{
@@ -12,7 +13,7 @@ var payContainer = new Vue({
             payAmount: 0,//本次支付金额
             payMobileUrl: '',//二维码生成链接
             payData:{},       //支付数据
-            payUserType:'ENTERPRISE',
+            payUserType:'B2B',
             payType:'',
         },
         iframe:'',
@@ -194,19 +195,19 @@ var payContainer = new Vue({
                     }
                     if(_self.payInfo.payBankNum == "WEIXIN"){// 微信
                         if(_self.pageType === '1'){ // 二手
-                            _self.PaySecondMiniWxPay();
+                            _self.hlb_PaySecondMiniWxPay();
                         }else if(_self.pageType === '2'){ // 会员
-                            _self.payVipMiniWxPay();
+                            _self.hlb_PayVipMiniWxPay();
                         }else{ // 正常订单
-                            _self.PayOrderMiniWxPay();
+                            _self.hlb_PayOrderMiniWxPay();
                         }
                     }else if(_self.payInfo.payBankNum == "ALIPAY"){// 支付宝
                         if(_self.pageType === '1'){// 二手
-                            _self.PayOrdersecondScanAliPay();
+                            _self.hlb_PayOrdersecondScanAliPay();
                         }else if(_self.pageType === '2'){ // 会员
-                            _self.PayVipScanAliPay();
+                            _self.hlb_PayVipScanAliPay();
                         }else{// 正常订单
-                            _self.PayOrderPcScanAliPay();
+                            _self.hlb_PayOrderPcScanAliPay();
                         }
                     }
                 }
@@ -219,7 +220,7 @@ var payContainer = new Vue({
                 return;
             }
             if(_self.pageType === '3'){// 网银支付优惠券
-                _self.PayCouponUnionPayFn();
+                _self.hlb_PayCouponUnionPayFn();
             }else{
                 if(_self.onlinePay == 2){
                     _self.layerConfirm();
@@ -233,349 +234,23 @@ var payContainer = new Vue({
                         return;
                     }
                     if(_self.pageType === '1'){// 二手
-                        _self.PayOrdersecondUnion();
+                        _self.hlb_PayOrdersecondUnion();
                     } else if (_self.pageType === '2') { // 会员
-                        _self.payVipPcMallPay();
+                        _self.hlb_PayVipPcMallPay();
                     } else {// 正常订单
-                        _self.PayOrderPcMallPay();
+                        _self.hlb_PayOrderPcMallPay();
                     }
                 }
             }
         },
-        PayOrderMiniWxPay:function (){// 正常订单微信支付通道
-            var _self = this;
-            if(!isPC){
-                var orderInfo = {//正常订单微信二维码参数
-                    pageType:0,
-                    orderID:_self.payInfo.payOrderId,
-                    payAmount:_self.payAmount
-                };
-                _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
-                location.href = _self.payInfo.payMobileUrl;
-            }else{
-                _self.payInfo.payData = {//正常订单
-                    type:_self.payInfo.payBankNum,
-                    orderid:_self.payInfo.payOrderId,
-                    amount:_self.payAmount,
-                    url:_self.payInfo.payMobileUrl
-                };
-                CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                window.open("/pay/caimei-paymobile.html?pageType=0");
-                _self.isPayAlert = true;
-            }
-        },
-        PayOrderPcScanAliPay:function (){// 正常订单支付宝通道
-            var _self = this;
-            var params = {//正常订单
-                payType:'ZFBEWM',
-                payAmount:_self.payAmount,
-                returnUrl:'https://www.caimei365.com/',
-                orderId:_self.payInfo.payOrderId
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrderPcScanAliPay(params,function(response){
-                if(response.code == 0){
-                    console.log('data',response.data)
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus=false;
-                    _self.mbOrderId = response.data.rt5_orderId;
-                    _self.payInfo.payMobileUrl = response.data.rt8_qrcode;
-                    _self.payInfo.payData = {
-                        mbOrderId:_self.mbOrderId,
-                        type:_self.payInfo.payBankNum,
-                        orderid:_self.payInfo.payOrderId,
-                        amount:_self.payAmount,
-                        url:_self.payInfo.payMobileUrl
-                    };
-                    CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                    if(!isPC){
-                        location.href = _self.payInfo.payMobileUrl;
-                    }else{
-                        window.open("/pay/caimei-paymobile.html?pageType=1");
-                    }
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                    _self.isSubMitStatus=false;
-                }
-            })
-        },
-        PayOrderPcMallPay:function(){// 正常订单网银支付通道
-            var _self = this;
-            var params = {//正常订单
-                payType:'YL',
-                payAmount:_self.payAmount,
-                bankCode:_self.payInfo.payBankNum,
-                returnUrl:'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
-                orderId:_self.payInfo.payOrderId,
-                userType:_self.payInfo.payUserType
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrderPcMallPay(params,function(response){
-                if(response.code == 0){
-                    // _self.isPayAlert = true;
-                    _self.iframe = response.data
-                    setTimeout(function () {
-                        var onlineForm = document.getElementById('onlineForm');
-                        _self.isSubMitStatus=false;
-                        onlineForm.submit();
-                    },2000)
-                }else{
-                    _self.isSubMitStatus=false;
-                    CAIMEI.Alert(response.msg,'确定',false);
-                }
-            })
-        },
-        PaySecondMiniWxPay:function (){//二手发布微信支付通道
-            var _self = this;
-            if(!isPC){// h5跳 H5支付页
-                var orderInfo = {//二手微信二维码参数
-                    pageType:1,
-                    productId:_self.productID,
-                    payAmount:_self.payAmount
-                };
-                _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
-                location.href = _self.payInfo.payMobileUrl;
-            }else{// PC 跳扫码支付页
-                _self.payInfo.payData = {//二手
-                    type:_self.payInfo.payBankNum,
-                    productId:_self.productID,
-                    amount:_self.payAmount,
-                    url:_self.payInfo.payMobileUrl
-                };
-                CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                window.open("/pay/caimei-paymobile.html?pageType=1");
-                _self.isPayAlert = true;
-            }
-        },
-        PayOrdersecondScanAliPay:function (){// 二手发布支付宝通道
-            var _self = this;
-            var params = {//二手
-                payType:'ZFBEWM',
-                returnUrl:'https://www.caimei365.com/',
-                productId:_self.productID,
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrdersecondScanAliPay(params,function(response){
-                if(response.code == 0){
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus=false;
-                    _self.mbOrderId = response.data.rt5_orderId;
-                    _self.payInfo.payMobileUrl = response.data.rt8_qrcode;
-                    _self.payInfo.payData = {
-                        mbOrderId:_self.mbOrderId,
-                        type:_self.payInfo.payBankNum,
-                        productId:_self.productID,
-                        amount:_self.payAmount,
-                        url:_self.payInfo.payMobileUrl
-                    };
-                    CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                    window.open("/pay/caimei-paymobile.html?pageType=1");
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                    _self.isSubMitStatus=false;
-                }
-            })
-        },
-        PayOrdersecondUnion:function (){// 二手发布网银支付通道
-            var _self = this;
-            var params = {//二手
-                payType:'YL',
-                bankCode:_self.payInfo.payBankNum,
-                returnUrl:'https://www.caimei365.com/pay/success.html?pageType=second&type=success&payAmount='+_self.payAmount,
-                productId:_self.productID,
-                userType:_self.payInfo.payUserType,
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrdersecondUnion(params,function(response){
-                if(response.code == 0){
-                    _self.iframe = response.data
-                    setTimeout(function () {
-                        var onlineForm = document.getElementById('onlineForm');
-                        _self.isSubMitStatus=false;
-                        onlineForm.submit();
-                    },2000)
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                    _self.isSubMitStatus=false;
-                }
-            })
-        },
-        payVipMiniWxPay: function(){ // 超级会员微信支付通道
-            var _self = this;
-            if (!isPC) {
-                var orderInfo = {//普通订单微信二维码参数
-                    pageType: 2,
-                    vipId: _self.comboInfo.id,
-                    vipRecordId: _self.vipRecordId,
-                    payAmount: _self.payAmount
-                };
-                _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
-                location.href = _self.payInfo.payMobileUrl;
-            } else {
-                _self.payInfo.payData = {
-                    type: _self.payInfo.payBankNum,
-                    vipId: _self.comboInfo.id,
-                    vipRecordId: _self.vipRecordId,
-                    amount: _self.payAmount,
-                    duration: _self.comboInfo.duration,
-                };
-                CAIMEI.Storage.setItem('payData', JSON.stringify(_self.payInfo.payData));
-                window.open("/pay/caimei-paymobile.html?pageType=2");
-                _self.isPayAlert = true;
-            }
-        },
-        PayVipScanAliPay: function(){ // 超级会员支付宝通道
-            var _self = this;
-            var params = {
-                bankCode: _self.payInfo.payBankNum,
-                returnUrl: 'https://www.caimei365.com/',
-                userType: _self.payInfo.payUserType,
-                vipRecordId: _self.vipRecordId
-            };
-            _self.isSubMitStatus = true;
-            PayApi.PayVipScanAliPay(params, function(response){
-                console.log(response);
-                if (response.code === 0) {
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus = false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    _self.payInfo.payMobileUrl = response.data.data.payUrl;
-                    _self.payInfo.payData = {
-                        mbOrderId: _self.mbOrderId,
-                        type: _self.payInfo.payBankNum,
-                        amount: _self.payAmount,
-                        url: _self.payInfo.payMobileUrl,
-                    };
-                    CAIMEI.Storage.setItem('payData', JSON.stringify(_self.payInfo.payData));
-                    if (!isPC) {
-                        location.href = _self.payInfo.payMobileUrl;
-                    } else {
-                        window.open("/pay/caimei-paymobile.html?pageType=2&duration=" + _self.comboInfo.duration);
-                    }
-                } else {
-                    CAIMEI.Alert(response.msg, '确定', false);
-                    _self.isSubMitStatus = false;
-                }
-            });
-        },
-        payVipPcMallPay: function(){// 超级会员网银支付通道
-            var _self = this;
-            var params = {
-                payType:'YL',
-                bankCode: this.payInfo.payBankNum,
-                returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=vip&type=success&payAmount='+_self.payAmount,
-                userType: _self.payInfo.payUserType,
-                vipRecordId: _self.vipRecordId
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayVipPcMallPay(params, function (response) {
-                if (response.code == 0) {
-                    _self.iframe = response.data
-                    setTimeout(function () {
-                        var onlineForm = document.getElementById('onlineForm');
-                        _self.isSubMitStatus=false;
-                        onlineForm.submit();
-                    },2000)
-                } else {
-                    _self.isSubMitStatus = false;
-                    CAIMEI.Alert(response.msg, '确定', false);
-                }
-            });
-        },
-        PayCouponUnionPayFn:function () { // 网银支付购买优惠券
-            console.log('网银支付购买优惠券');
-            var _self = this;
-            var params = {
-                bankCode: this.payInfo.payBankNum,
-                returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.couponInfo.moneyCouponPrice,
-                userType: _self.payInfo.payUserType,
-                couponId: _self.couponId,
-                couponRecordId:_self.couponRecordId,
-                userId:_self.userId,
-                source:2 //支付来源 1 小程序 2 WWW
-            };
-            PayApi.PayCouponUnionPay(params, function (response) {
-                if (response.code == 0) {
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus = false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    window.open(response.data.data.payUrl);
-                } else {
-                    _self.isSubMitStatus = false;
-                    CAIMEI.Alert(response.msg, '确定', false);
-                }
-            });
-        },
         PayCouponMiniPayFn:function () {  // 移动支付购买优惠券
             var _self = this;
             if(_self.payInfo.payBankNum == "WEIXIN"){
-                _self.payCouponMiniWxPay();
+                _self.hlb_PayCouponMiniWxPay();
             }else if(_self.payInfo.payBankNum == "ALIPAY"){//支付宝支付
-                _self.payCouponAliPay();
+                _self.hlb_PayCouponAliPay();
             }
         },
-        payCouponMiniWxPay: function(){ // 微信支付优惠券
-            console.log('微信支付优惠券');
-            if (!isPC) {
-                var orderInfo = {//普通订单微信二维码参数
-                    pageType: 3,
-                    payAmount: this.couponInfo.moneyCouponPrice,
-                    couponRecordId:this.couponRecordId,
-                    couponId: this.couponId,
-                    userId : this.userId
-                };
-                this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
-                location.href = this.payInfo.payMobileUrl;
-            } else {
-                this.payInfo.payData = {
-                    type: this.payInfo.payBankNum,
-                    amount: this.couponInfo.moneyCouponPrice,
-                    url: this.payInfo.payMobileUrl,
-                    couponId:this.couponId,
-                    couponRecordId:this.couponRecordId,
-                    userId:this.userId
-                };
-                CAIMEI.Storage.setItem('payData', JSON.stringify(this.payInfo.payData));
-                window.open("/pay/caimei-paymobile.html?pageType=3");
-                this.isPayAlert = true;
-            }
-        },
-        payCouponAliPay: function(){ // 支付宝支付优惠券
-            var _self = this;
-            console.log('支付宝支付优惠券');
-            var params = {
-                returnUrl: 'https://www.caimei365.com/',
-                couponId: _self.couponInfo.couponId,
-                userId:_self.userId,
-                couponRecordId:_self.couponRecordId,
-                source:2 //支付来源 1 小程序 2 WWW
-            };
-            PayApi.PayCouponMiniAliPay(params, function(response){
-                console.log(response);
-                if (response.code === 0) {
-                    _self.isPayAlert = true;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    _self.payInfo.payMobileUrl = response.data.data.payUrl;
-                    _self.payInfo.payData = {
-                        type: _self.payInfo.payBankNum,
-                        mbOrderId: _self.mbOrderId,
-                        amount: _self.couponInfo.moneyCouponPrice,
-                        url: _self.payInfo.payMobileUrl,
-                        couponId:_self.couponId,
-                        userId:_self.userId
-                    };
-                    CAIMEI.Storage.setItem('payData', JSON.stringify(_self.payInfo.payData));
-                    if (!isPC) {
-                        location.href = _self.payInfo.payMobileUrl;
-                    } else {
-                        window.open("/pay/caimei-paymobile.html?pageType=3");
-                    }
-                } else {
-                    CAIMEI.Alert(response.msg, '确定', false);
-                    _self.isSubMitStatus = false;
-                }
-            });
-        },
         changePayAmount:function(event){//输入支付金额控制
             var _self = this;
             var value = event.target.value;
@@ -618,12 +293,12 @@ var payContainer = new Vue({
                 case 2:// 企业网银
                     _self.bankTabIndex = 0
                     _self.payInfo.payType = '1';
-                    _self.payInfo.payUserType = 'ENTERPRISE';
+                    _self.payInfo.payUserType = 'B2B';
                     break;
                 case 3:// 个人网银
                     _self.bankTabIndex = 0
                     _self.payInfo.payType = '2';
-                    _self.payInfo.payUserType = 'USER';
+                    _self.payInfo.payUserType = 'B2C';
                     break;
             }
         },

+ 14 - 365
src/main/resources/static/js/pay/caimei-paycash.js

@@ -3,6 +3,7 @@
  */
 var payContainer = new Vue({
     el:"#payContainer",
+    mixins: [mhPayMixin],
     data: {
         isSubMitStatus:false,
         payInfo:{
@@ -194,19 +195,19 @@ var payContainer = new Vue({
                     }
                     if(_self.payInfo.payBankNum == "WEIXIN"){// 微信
                         if(_self.pageType === '1'){ // 二手
-                            _self.PaySecondMiniWxPay();
+                            _self.mh_PaySecondMiniWxPay();
                         }else if(_self.pageType === '2'){ // 会员
-                            _self.payVipMiniWxPay();
+                            _self.mh_PayVipMiniWxPay();
                         }else{ // 正常订单
-                            _self.PayOrderMiniWxPay();
+                            _self.mh_PayOrderMiniWxPay();
                         }
                     }else if(_self.payInfo.payBankNum == "ALIPAY"){// 支付宝
                         if(_self.pageType === '1'){// 二手
-                            _self.PayOrdersecondAliPay();
+                            _self.mh_PayOrdersecondAliPay();
                         }else if(_self.pageType === '2'){ // 会员
-                            _self.PayVipAliPay();
+                            _self.mh_PayVipAliPay();
                         }else{// 正常订单
-                            _self.PayOrderPcMallAlipay();
+                            _self.mh_PayOrderPcMallAlipay();
                         }
                     }
                 }
@@ -219,7 +220,7 @@ var payContainer = new Vue({
                 return;
             }
             if(_self.pageType === '3'){// 网银支付优惠券
-                _self.PayCouponUnionPayFn();
+                _self.mh_PayCouponUnionPayFn();
             }else{
                 if(_self.onlinePay == 2){
                     _self.layerConfirm();
@@ -233,379 +234,27 @@ var payContainer = new Vue({
                         return;
                     }
                     if(_self.pageType === '1'){
-                        _self.PayOrdersecondUnion()
+                        _self.mh_PayOrdersecondUnion()
                     } else if (_self.pageType === '2') { // 网银付会员
-                        _self.payVipPcMallPay();
+                        _self.mh_PayVipPcMallPay();
                     } else {
                         if(_self.mobileTabIndex === 4){
-                            var params = {
-                                payAmount:Math.round(_self.payAmount*100),
-                                orderId:_self.payInfo.payOrderId
-                            }
-                            _self.PayOrderTransferUnion(params);
+                            _self.mh_PayOrderTransferUnion();
                         }else{
-                            _self.PayOrderPcMallPay();
+                            _self.mh_PayOrderPcMallPay();
                         }
                     }
                 }
             }
         },
-        PayOrderMiniWxPay:function () {// 正常订单微信支付
-            var _self = this;
-            if(!isPC){
-                var orderInfo = {//普通订单微信二维码参数
-                    pageType:0,
-                    orderID:_self.payInfo.payOrderId,
-                    payAmount:_self.payAmount
-                };
-                _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
-                location.href = _self.payInfo.payMobileUrl;
-            }else{
-                _self.payInfo.payData = {//正常订单
-                    type:_self.payInfo.payBankNum,
-                    orderid:_self.payInfo.payOrderId,
-                    amount:_self.payAmount,
-                    url:_self.payInfo.payMobileUrl
-                };
-                CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                window.open("/pay/caimei-paymobile.html?pageType=0");
-                _self.isPayAlert = true;
-            }
-        },
-        PaySecondMiniWxPay:function () {// 二手发布微信支付
-            var _self = this;
-            if(!isPC){
-                var orderInfo = {//二手微信二维码参数
-                    pageType:1,
-                    productId:_self.productID,
-                    payAmount:_self.payAmount
-                };
-                _self.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
-                location.href = _self.payInfo.payMobileUrl;
-            }else{
-                _self.payInfo.payData = {//二手
-                    type:_self.payInfo.payBankNum,
-                    productId:_self.productID,
-                    amount:_self.payAmount,
-                    url:_self.payInfo.payMobileUrl
-                };
-                CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                window.open("/pay/caimei-paymobile.html?pageType=1");
-                _self.isPayAlert = true;
-            }
-        },
-        PayOrdersecondScanAliPay:function () {// 二手发布支付宝支付
-            var _self = this;
-            var params = {//二手
-                bankCode:_self.payInfo.payBankNum,
-                returnUrl:'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
-                productId:_self.productID,
-                userType:_self.payInfo.payUserType,
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrdersecondUnion(params,function(response){
-                if(response.code == 0){
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus=false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    window.open(response.data.data.payUrl);
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                    _self.isSubMitStatus=false;
-                }
-            })
-        },
-        PayOrderPcMallAlipay:function (){// 正常订单支付宝支付
-            var _self = this;
-            var params = {//正常订单
-                payAmount:Math.round(_self.payAmount*100),
-                returnUrl:'https://www.caimei365.com/',
-                orderId:_self.payInfo.payOrderId
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrderPcMallAlipay(params,function(response){
-                if(response.code == 0){
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus=false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    _self.payInfo.payMobileUrl = response.data.data.payUrl;
-                    _self.payInfo.payData = {
-                        mbOrderId:_self.mbOrderId,
-                        type:_self.payInfo.payBankNum,
-                        orderid:_self.payInfo.payOrderId,
-                        amount:_self.payAmount,
-                        url:_self.payInfo.payMobileUrl
-                    };
-                    CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                    if(!isPC){
-                        location.href = _self.payInfo.payMobileUrl;
-                    }else{
-                        window.open("/pay/caimei-paymobile.html?pageType=1");
-                    }
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                    _self.isSubMitStatus=false;
-                }
-            })
-        },
-        PayOrderPcMallPay:function(){// 正常订单网银支付
-            var _self = this;
-            var params = {//正常订单
-                payAmount:Math.round(_self.payAmount*100),
-                bankCode:_self.payInfo.payBankNum,
-                returnUrl:'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
-                orderId:_self.payInfo.payOrderId,
-                userType:_self.payInfo.payUserType
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrderPcMallPay(params,function(response){
-                if(response.code == 0){
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus=false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    window.open(response.data.data.payUrl);
-                }else{
-                    _self.isSubMitStatus=false;
-                    CAIMEI.Alert(response.msg,'确定',false);
-                }
-            })
-        },
-        PayOrderTransferUnion:function (params) {// 大额网银转账
-            var _self = this;
-            _self.isSubMitStatus=true;
-            PayApi.PayOrderTransferUnion(params,function(response){
-                if(response.code == 0){
-                    _self.isPayBigAlert = true;
-                    _self.isSubMitStatus=false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    _self.bigPayInfo = JSON.parse(response.data.data.payInfo)
-                    console.log('bigPayInfo',_self.bigPayInfo)
-                }else{
-                    _self.isSubMitStatus=false;
-                    CAIMEI.Alert(response.msg,'确定',false);
-                }
-            })
-        },
-        PayOrdersecondAliPay:function (){// 二手支付宝支付
-            var _self = this;
-            var params = {//二手
-                returnUrl:'https://www.caimei365.com/',
-                productId:_self.productID,
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrdersecondAliPay(params,function(response){
-                if(response.code == 0){
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus=false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    _self.payInfo.payMobileUrl = response.data.data.payUrl;
-                    _self.payInfo.payData = {
-                        mbOrderId:_self.mbOrderId,
-                        type:_self.payInfo.payBankNum,
-                        productId:_self.productID,
-                        amount:_self.payAmount,
-                        url:_self.payInfo.payMobileUrl
-                    };
-                    CAIMEI.Storage.setItem('payData',JSON.stringify(_self.payInfo.payData));
-                    window.open("/pay/caimei-paymobile.html?pageType=1");
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                    _self.isSubMitStatus=false;
-                }
-            })
-        },
-        PayOrdersecondUnion:function (){// 二手网银支付
-            var _self = this;
-            var params = {//二手
-                payWay:_self.payInfo.payBankNum,
-                returnUrl:'https://www.caimei365.com/',
-                productId:_self.productID,
-            };
-            _self.isSubMitStatus=true;
-            PayApi.PayOrdersecondUnion(params,function(response){
-                if(response.code == 0){
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus=false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    window.open(response.data.data.payUrl);
-                }else{
-                    CAIMEI.Alert(response.msg,'确定',false);
-                    _self.isSubMitStatus=false;
-                }
-            })
-        },
-        payVipPcMallPay: function(){ // 网银支付会员
-            console.log('网银支付会员');
-            var _self = this;
-            var params = {
-                bankCode: this.payInfo.payBankNum,
-                returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount,
-                userType: _self.payInfo.payUserType,
-                vipRecordId: _self.vipRecordId
-            };
-            PayApi.PayVipPcMallPay(params, function (response) {
-                if (response.code == 0) {
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus = false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    window.open(response.data.data.payUrl);
-                } else {
-                    _self.isSubMitStatus = false;
-                    CAIMEI.Alert(response.msg, '确定', false);
-                }
-            });
-        },
-        PayVipAliPay: function(){ // 支付宝支付会员
-            console.log('支付宝支付会员');
-            var _self = this;
-            var params = {
-                bankCode: _self.payInfo.payBankNum,
-                returnUrl: 'https://www.caimei365.com/',
-                userType: _self.payInfo.payUserType,
-                vipRecordId: _self.vipRecordId
-            };
-            console.log(params);
-            PayApi.PayVipAliPay(params, function(response){
-                console.log(response);
-                if (response.code === 0) {
-                    _self.isPayAlert = true;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    _self.payInfo.payMobileUrl = response.data.data.payUrl;
-                    _self.payInfo.payData = {
-                        mbOrderId: _self.mbOrderId,
-                        type: _self.payInfo.payBankNum,
-                        amount: _self.payAmount,
-                        url: _self.payInfo.payMobileUrl,
-                    };
-                    CAIMEI.Storage.setItem('payData', JSON.stringify(_self.payInfo.payData));
-                    if (!isPC) {
-                        location.href = _self.payInfo.payMobileUrl;
-                    } else {
-                        window.open("/pay/caimei-paymobile.html?pageType=2&duration=" + _self.comboInfo.duration);
-                    }
-                } else {
-                    CAIMEI.Alert(response.msg, '确定', false);
-                    _self.isSubMitStatus = false;
-                }
-            });
-        },
-        payVipMiniWxPay: function(){ // 微信支付会员
-            if (!isPC) {
-                var orderInfo = {//普通订单微信二维码参数
-                    couponId: 2,
-                    vipId: this.comboInfo.id,
-                    vipRecordId: this.vipRecordId,
-                    payAmount: this.payAmount
-                };
-                this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
-                location.href = this.payInfo.payMobileUrl;
-            } else {
-                this.payInfo.payData = {
-                    type: this.payInfo.payBankNum,
-                    vipId: this.comboInfo.id,
-                    vipRecordId: this.vipRecordId,
-                    amount: this.payAmount,
-                    duration: this.comboInfo.duration,
-                };
-                CAIMEI.Storage.setItem('payData', JSON.stringify(this.payInfo.payData));
-                window.open("/pay/caimei-paymobile.html?pageType=2");
-                this.isPayAlert = true;
-            }
-        },
-        PayCouponUnionPayFn:function () {  // 网银支付购买优惠券
-            console.log('网银支付购买优惠券');
-            var _self = this;
-            var params = {
-                bankCode: this.payInfo.payBankNum,
-                returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_self.couponInfo.moneyCouponPrice,
-                userType: _self.payInfo.payUserType,
-                couponId: _self.couponId,
-                couponRecordId:_self.couponRecordId,
-                userId:_self.userId,
-                source:2 //支付来源 1 小程序 2 WWW
-            };
-            PayApi.PayCouponUnionPay(params, function (response) {
-                if (response.code == 0) {
-                    _self.isPayAlert = true;
-                    _self.isSubMitStatus = false;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    window.open(response.data.data.payUrl);
-                } else {
-                    _self.isSubMitStatus = false;
-                    CAIMEI.Alert(response.msg, '确定', false);
-                }
-            });
-        },
         PayCouponMiniPayFn:function () {  // 移动支付购买优惠券
             var _self = this;
             if(_self.payInfo.payBankNum == "WEIXIN"){
-                _self.payCouponMiniWxPay();
+                _self.mh_PayCouponMiniWxPay();
             }else if(_self.payInfo.payBankNum == "ALIPAY"){//支付宝支付
-                _self.payCouponAliPay();
+                _self.mh_PayCouponAliPay();
             }
         },
-        payCouponMiniWxPay: function(){// 微信支付优惠券
-            console.log('微信支付优惠券');
-            if (!isPC) {
-                var orderInfo = {//普通订单微信二维码参数
-                    pageType: 3,
-                    payAmount: this.couponInfo.moneyCouponPrice,
-                    couponRecordId:this.couponRecordId,
-                    couponId: this.couponId,
-                    userId : this.userId
-                };
-                this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
-                location.href = this.payInfo.payMobileUrl;
-            } else {
-                this.payInfo.payData = {
-                    type: this.payInfo.payBankNum,
-                    amount: this.couponInfo.moneyCouponPrice,
-                    url: this.payInfo.payMobileUrl,
-                    couponId:this.couponId,
-                    couponRecordId:this.couponRecordId,
-                    userId:this.userId
-                };
-                CAIMEI.Storage.setItem('payData', JSON.stringify(this.payInfo.payData));
-                window.open("/pay/caimei-paymobile.html?pageType=3");
-                this.isPayAlert = true;
-            }
-        },
-        payCouponAliPay: function(){// 支付宝支付优惠券
-            var _self = this;
-            console.log('支付宝支付优惠券');
-            var params = {
-                returnUrl: 'https://www.caimei365.com/',
-                couponId: _self.couponInfo.couponId,
-                userId:_self.userId,
-                couponRecordId:_self.couponRecordId,
-                source:2 //支付来源 1 小程序 2 WWW
-            };
-            PayApi.PayCouponMiniAliPay(params, function(response){
-                console.log(response);
-                if (response.code === 0) {
-                    _self.isPayAlert = true;
-                    _self.mbOrderId = response.data.data.mbOrderId;
-                    _self.payInfo.payMobileUrl = response.data.data.payUrl;
-                    _self.payInfo.payData = {
-                        type: _self.payInfo.payBankNum,
-                        mbOrderId: _self.mbOrderId,
-                        amount: _self.couponInfo.moneyCouponPrice,
-                        url: _self.payInfo.payMobileUrl,
-                        couponId:_self.couponId,
-                        userId:_self.userId
-                    };
-                    CAIMEI.Storage.setItem('payData', JSON.stringify(_self.payInfo.payData));
-                    if (!isPC) {
-                        location.href = _self.payInfo.payMobileUrl;
-                    } else {
-                        window.open("/pay/caimei-paymobile.html?pageType=3");
-                    }
-                } else {
-                    CAIMEI.Alert(response.msg, '确定', false);
-                    _self.isSubMitStatus = false;
-                }
-            });
-        },
         changePayAmount:function(event){//输入支付金额控制
             var _self = this;
             var value = event.target.value;

+ 337 - 0
src/main/resources/static/js/pay/mixin/hlb_payMixin.js

@@ -0,0 +1,337 @@
+'use strict';
+
+var hlbPayMixin = function () {// 合利宝支付渠道
+	return {
+		methods: {
+			hlb_PayOrderPcMallPay:function(){// 正常订单网银支付通道
+				var _this = this;
+				var params = {//正常订单
+					payType:'YL',
+					payAmount:_this.payAmount,
+					bankCode:_this.payInfo.payBankNum,
+					returnUrl:'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_this.payAmount,
+					orderId:_this.payInfo.payOrderId,
+					userType:_this.payInfo.payUserType
+				};
+				_this.isSubMitStatus=true;
+				console.log('正常订单网银支付通道',params)
+				PayApi.PayOrderPcMallPay(params,function(response){
+					if(response.code == 0){
+						// _this.isPayAlert = true;
+						_this.iframe = response.data
+						setTimeout(function () {
+							var onlineForm = document.getElementById('onlineForm');
+							_this.isSubMitStatus=false;
+							onlineForm.submit();
+						},2000)
+					}else{
+						_this.isSubMitStatus=false;
+						CAIMEI.Alert(response.msg,'确定',false);
+					}
+				})
+			},
+			hlb_PayOrderPcScanAliPay:function (){// 正常订单支付宝通道
+				var _this = this;
+				var params = {//正常订单
+					payType:'ZFBEWM',
+					payAmount:_this.payAmount,
+					returnUrl:'https://www.caimei365.com/',
+					orderId:_this.payInfo.payOrderId
+				};
+				_this.isSubMitStatus=true;
+				console.log('正常订单支付宝通道',params)
+				PayApi.PayOrderPcScanAliPay(params,function(response){
+					if(response.code == 0){
+						console.log('data',response.data)
+						_this.isPayAlert = true;
+						_this.isSubMitStatus=false;
+						_this.mbOrderId = response.data.rt5_orderId;
+						_this.payInfo.payMobileUrl = response.data.rt8_qrcode;
+						_this.payInfo.payData = {
+							mbOrderId:_this.mbOrderId,
+							type:_this.payInfo.payBankNum,
+							orderid:_this.payInfo.payOrderId,
+							amount:_this.payAmount,
+							url:_this.payInfo.payMobileUrl
+						};
+						CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData));
+						if(!isPC){
+							location.href = _this.payInfo.payMobileUrl;
+						}else{
+							window.open("/pay/caimei-paymobile.html?pageType=1");
+						}
+					}else{
+						CAIMEI.Alert(response.msg,'确定',false);
+						_this.isSubMitStatus=false;
+					}
+				})
+			},
+			hlb_PayOrderMiniWxPay:function (){// 正常订单微信支付通道
+				console.log('正常订单微信支付通道')
+				var _this = this;
+				if(!isPC){
+					var orderInfo = {//正常订单微信二维码参数
+						pageType:0,
+						orderID:_this.payInfo.payOrderId,
+						payAmount:_this.payAmount
+					};
+					_this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
+					location.href = _this.payInfo.payMobileUrl;
+				}else{
+					_this.payInfo.payData = {//正常订单
+						type:_this.payInfo.payBankNum,
+						orderid:_this.payInfo.payOrderId,
+						amount:_this.payAmount,
+						url:_this.payInfo.payMobileUrl
+					};
+					CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData));
+					window.open("/pay/caimei-paymobile.html?pageType=0");
+					_this.isPayAlert = true;
+				}
+			},
+			hlb_PayCouponUnionPayFn:function () { // 网银支付购买优惠券
+				console.log('网银支付购买优惠券');
+				var _this = this;
+				var params = {
+					bankCode: this.payInfo.payBankNum,
+					returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_this.couponInfo.moneyCouponPrice,
+					userType: _this.payInfo.payUserType,
+					couponId: _this.couponId,
+					couponRecordId:_this.couponRecordId,
+					userId:_this.userId,
+					source:2 //支付来源 1 小程序 2 WWW
+				};
+				PayApi.PayCouponUnionPay(params, function (response) {
+					if (response.code == 0) {
+						_this.isPayAlert = true;
+						_this.isSubMitStatus = false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						window.open(response.data.data.payUrl);
+					} else {
+						_this.isSubMitStatus = false;
+						CAIMEI.Alert(response.msg, '确定', false);
+					}
+				});
+			},
+			hlb_PayCouponMiniWxPay: function(){ // 微信支付优惠券
+				console.log('微信支付优惠券');
+				if (!isPC) {
+					var orderInfo = {//普通订单微信二维码参数
+						pageType: 3,
+						payAmount: this.couponInfo.moneyCouponPrice,
+						couponRecordId:this.couponRecordId,
+						couponId: this.couponId,
+						userId : this.userId
+					};
+					this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
+					location.href = this.payInfo.payMobileUrl;
+				} else {
+					this.payInfo.payData = {
+						type: this.payInfo.payBankNum,
+						amount: this.couponInfo.moneyCouponPrice,
+						url: this.payInfo.payMobileUrl,
+						couponId:this.couponId,
+						couponRecordId:this.couponRecordId,
+						userId:this.userId
+					};
+					CAIMEI.Storage.setItem('payData', JSON.stringify(this.payInfo.payData));
+					window.open("/pay/caimei-paymobile.html?pageType=3");
+					this.isPayAlert = true;
+				}
+			},
+			hlb_PayCouponAliPay: function(){ // 支付宝支付优惠券
+				var _this = this;
+				console.log('支付宝支付优惠券');
+				var params = {
+					returnUrl: 'https://www.caimei365.com/',
+					couponId: _this.couponInfo.couponId,
+					userId:_this.userId,
+					couponRecordId:_this.couponRecordId,
+					source:2 //支付来源 1 小程序 2 WWW
+				};
+				PayApi.PayCouponMiniAliPay(params, function(response){
+					console.log(response);
+					if (response.code === 0) {
+						_this.isPayAlert = true;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						_this.payInfo.payMobileUrl = response.data.data.payUrl;
+						_this.payInfo.payData = {
+							type: _this.payInfo.payBankNum,
+							mbOrderId: _this.mbOrderId,
+							amount: _this.couponInfo.moneyCouponPrice,
+							url: _this.payInfo.payMobileUrl,
+							couponId:_this.couponId,
+							userId:_this.userId
+						};
+						CAIMEI.Storage.setItem('payData', JSON.stringify(_this.payInfo.payData));
+						if (!isPC) {
+							location.href = _this.payInfo.payMobileUrl;
+						} else {
+							window.open("/pay/caimei-paymobile.html?pageType=3");
+						}
+					} else {
+						CAIMEI.Alert(response.msg, '确定', false);
+						_this.isSubMitStatus = false;
+					}
+				});
+			},
+			hlb_PayVipPcMallPay: function(){// 超级会员网银支付通道
+				var _this = this;
+				var params = {
+					payType:'YL',
+					bankCode: this.payInfo.payBankNum,
+					returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=vip&type=success&payAmount='+_this.payAmount,
+					userType: _this.payInfo.payUserType,
+					vipRecordId: _this.vipRecordId
+				};
+				_this.isSubMitStatus=true;
+				PayApi.PayVipPcMallPay(params, function (response) {
+					if (response.code == 0) {
+						_this.iframe = response.data
+						setTimeout(function () {
+							var onlineForm = document.getElementById('onlineForm');
+							_this.isSubMitStatus=false;
+							onlineForm.submit();
+						},2000)
+					} else {
+						_this.isSubMitStatus = false;
+						CAIMEI.Alert(response.msg, '确定', false);
+					}
+				});
+			},
+			hlb_PayVipScanAliPay: function(){ // 超级会员支付宝通道
+				var _this = this;
+				var params = {
+					bankCode: _this.payInfo.payBankNum,
+					returnUrl: 'https://www.caimei365.com/',
+					userType: _this.payInfo.payUserType,
+					vipRecordId: _this.vipRecordId
+				};
+				_this.isSubMitStatus = true;
+				PayApi.PayVipScanAliPay(params, function(response){
+					console.log(response);
+					if (response.code === 0) {
+						_this.isPayAlert = true;
+						_this.isSubMitStatus = false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						_this.payInfo.payMobileUrl = response.data.data.payUrl;
+						_this.payInfo.payData = {
+							mbOrderId: _this.mbOrderId,
+							type: _this.payInfo.payBankNum,
+							amount: _this.payAmount,
+							url: _this.payInfo.payMobileUrl,
+						};
+						CAIMEI.Storage.setItem('payData', JSON.stringify(_this.payInfo.payData));
+						if (!isPC) {
+							location.href = _this.payInfo.payMobileUrl;
+						} else {
+							window.open("/pay/caimei-paymobile.html?pageType=2&duration=" + _this.comboInfo.duration);
+						}
+					} else {
+						CAIMEI.Alert(response.msg, '确定', false);
+						_this.isSubMitStatus = false;
+					}
+				});
+			},
+			hlb_PayVipMiniWxPay: function(){ // 超级会员微信支付通道
+				var _this = this;
+				if (!isPC) {
+					var orderInfo = {//普通订单微信二维码参数
+						pageType: 2,
+						vipId: _this.comboInfo.id,
+						vipRecordId: _this.vipRecordId,
+						payAmount: _this.payAmount
+					};
+					_this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
+					location.href = _this.payInfo.payMobileUrl;
+				} else {
+					_this.payInfo.payData = {
+						type: _this.payInfo.payBankNum,
+						vipId: _this.comboInfo.id,
+						vipRecordId: _this.vipRecordId,
+						amount: _this.payAmount,
+						duration: _this.comboInfo.duration,
+					};
+					CAIMEI.Storage.setItem('payData', JSON.stringify(_this.payInfo.payData));
+					window.open("/pay/caimei-paymobile.html?pageType=2");
+					_this.isPayAlert = true;
+				}
+			},
+			hlb_PayOrdersecondUnion:function (){// 二手发布网银支付通道
+				var _this = this;
+				var params = {//二手
+					payType:'YL',
+					bankCode:_this.payInfo.payBankNum,
+					returnUrl:'https://www.caimei365.com/pay/success.html?pageType=second&type=success&payAmount='+_this.payAmount,
+					productId:_this.productID,
+					userType:_this.payInfo.payUserType,
+				};
+				_this.isSubMitStatus=true;
+				PayApi.PayOrdersecondUnion(params,function(response){
+					if(response.code == 0){
+						_this.iframe = response.data
+						setTimeout(function () {
+							var onlineForm = document.getElementById('onlineForm');
+							_this.isSubMitStatus=false;
+							onlineForm.submit();
+						},2000)
+					}else{
+						CAIMEI.Alert(response.msg,'确定',false);
+						_this.isSubMitStatus=false;
+					}
+				})
+			},
+			hlb_PayOrdersecondScanAliPay:function (){// 二手发布支付宝通道
+				var _this = this;
+				var params = {//二手
+					payType:'ZFBEWM',
+					returnUrl:'https://www.caimei365.com/',
+					productId:_this.productID,
+				};
+				_this.isSubMitStatus=true;
+				PayApi.PayOrdersecondScanAliPay(params,function(response){
+					if(response.code == 0){
+						_this.isPayAlert = true;
+						_this.isSubMitStatus=false;
+						_this.mbOrderId = response.data.rt5_orderId;
+						_this.payInfo.payMobileUrl = response.data.rt8_qrcode;
+						_this.payInfo.payData = {
+							mbOrderId:_this.mbOrderId,
+							type:_this.payInfo.payBankNum,
+							productId:_this.productID,
+							amount:_this.payAmount,
+							url:_this.payInfo.payMobileUrl
+						};
+						CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData));
+						window.open("/pay/caimei-paymobile.html?pageType=1");
+					}else{
+						CAIMEI.Alert(response.msg,'确定',false);
+						_this.isSubMitStatus=false;
+					}
+				})
+			},
+			hlb_PaySecondMiniWxPay:function (){// 二手发布微信支付通道
+				var _this = this;
+				if(!isPC){// h5跳 H5支付页
+					var orderInfo = {//二手微信二维码参数
+						pageType:1,
+						productId:_this.productID,
+						payAmount:_this.payAmount
+					};
+					_this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
+					location.href = _this.payInfo.payMobileUrl;
+				}else{// PC 跳扫码支付页
+					_this.payInfo.payData = {//二手
+						type:_this.payInfo.payBankNum,
+						productId:_this.productID,
+						amount:_this.payAmount,
+						url:_this.payInfo.payMobileUrl
+					};
+					CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData));
+					window.open("/pay/caimei-paymobile.html?pageType=1");
+					_this.isPayAlert = true;
+				}
+			},
+		}
+	};
+}();

+ 0 - 0
src/main/resources/static/js/pay/mixin/hlb_mixin.js → src/main/resources/static/js/pay/mixin/hlb_wxMixin.js


+ 340 - 0
src/main/resources/static/js/pay/mixin/mh_payMixin.js

@@ -0,0 +1,340 @@
+'use strict';
+
+var mhPayMixin = function () {// 米花支付渠道
+	return {
+		methods: {
+			mh_PayOrderTransferUnion:function () {// 正常订单大额网银转账
+				var _this = this;
+				var params = {
+					payAmount:Math.round(_this.payAmount*100),
+					orderId:_this.payInfo.payOrderId
+				}
+				_this.isSubMitStatus=true;
+				PayApi.PayOrderTransferUnion(params,function(response){
+					if(response.code == 0){
+						_this.isPayBigAlert = true;
+						_this.isSubMitStatus=false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						_this.bigPayInfo = JSON.parse(response.data.data.payInfo)
+						console.log('bigPayInfo',_this.bigPayInfo)
+					}else{
+						_this.isSubMitStatus=false;
+						CAIMEI.Alert(response.msg,'确定',false);
+					}
+				})
+			},
+			mh_PayOrderPcMallPay:function(){// 正常订单网银支付
+				var _this = this;
+				var params = {//正常订单
+					payAmount:Math.round(_this.payAmount*100),
+					bankCode:_this.payInfo.payBankNum,
+					returnUrl:'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_this.payAmount,
+					orderId:_this.payInfo.payOrderId,
+					userType:_this.payInfo.payUserType
+				};
+				_this.isSubMitStatus=true;
+				PayApi.PayOrderPcMallPay(params,function(response){
+					if(response.code == 0){
+						_this.isPayAlert = true;
+						_this.isSubMitStatus=false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						window.open(response.data.data.payUrl);
+					}else{
+						_this.isSubMitStatus=false;
+						CAIMEI.Alert(response.msg,'确定',false);
+					}
+				})
+			},
+			mh_PayOrderPcMallAlipay:function (){// 正常订单支付宝支付
+				var _this = this;
+				var params = {//正常订单
+					payAmount:Math.round(_this.payAmount*100),
+					returnUrl:'https://www.caimei365.com/',
+					orderId:_this.payInfo.payOrderId
+				};
+				_this.isSubMitStatus=true;
+				PayApi.PayOrderPcMallAlipay(params,function(response){
+					if(response.code == 0){
+						_this.isPayAlert = true;
+						_this.isSubMitStatus=false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						_this.payInfo.payMobileUrl = response.data.data.payUrl;
+						_this.payInfo.payData = {
+							mbOrderId:_this.mbOrderId,
+							type:_this.payInfo.payBankNum,
+							orderid:_this.payInfo.payOrderId,
+							amount:_this.payAmount,
+							url:_this.payInfo.payMobileUrl
+						};
+						CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData));
+						if(!isPC){
+							location.href = _this.payInfo.payMobileUrl;
+						}else{
+							window.open("/pay/caimei-paymobile.html?pageType=1");
+						}
+					}else{
+						CAIMEI.Alert(response.msg,'确定',false);
+						_this.isSubMitStatus=false;
+					}
+				})
+			},
+			mh_PayOrderMiniWxPay:function () {// 正常订单微信支付
+				var _this = this;
+				if(!isPC){
+					var orderInfo = {//普通订单微信二维码参数
+						pageType:0,
+						orderID:_this.payInfo.payOrderId,
+						payAmount:_this.payAmount
+					};
+					_this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
+					location.href = _this.payInfo.payMobileUrl;
+				}else{
+					_this.payInfo.payData = {//正常订单
+						type:_this.payInfo.payBankNum,
+						orderid:_this.payInfo.payOrderId,
+						amount:_this.payAmount,
+						url:_this.payInfo.payMobileUrl
+					};
+					CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData));
+					window.open("/pay/caimei-paymobile.html?pageType=0");
+					_this.isPayAlert = true;
+				}
+			},
+			mh_PayCouponUnionPayFn:function () {  // 网银支付购买优惠券
+				console.log('网银支付购买优惠券');
+				var _this = this;
+				var params = {
+					bankCode: this.payInfo.payBankNum,
+					returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_this.couponInfo.moneyCouponPrice,
+					userType: _this.payInfo.payUserType,
+					couponId: _this.couponId,
+					couponRecordId:_this.couponRecordId,
+					userId:_this.userId,
+					source:2 //支付来源 1 小程序 2 WWW
+				};
+				PayApi.PayCouponUnionPay(params, function (response) {
+					if (response.code == 0) {
+						_this.isPayAlert = true;
+						_this.isSubMitStatus = false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						window.open(response.data.data.payUrl);
+					} else {
+						_this.isSubMitStatus = false;
+						CAIMEI.Alert(response.msg, '确定', false);
+					}
+				});
+			},
+			mh_PayCouponAliPay: function(){// 支付宝支付优惠券
+				var _this = this;
+				console.log('支付宝支付优惠券');
+				var params = {
+					returnUrl: 'https://www.caimei365.com/',
+					couponId: _this.couponInfo.couponId,
+					userId:_this.userId,
+					couponRecordId:_this.couponRecordId,
+					source:2 //支付来源 1 小程序 2 WWW
+				};
+				PayApi.PayCouponMiniAliPay(params, function(response){
+					console.log(response);
+					if (response.code === 0) {
+						_this.isPayAlert = true;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						_this.payInfo.payMobileUrl = response.data.data.payUrl;
+						_this.payInfo.payData = {
+							type: _this.payInfo.payBankNum,
+							mbOrderId: _this.mbOrderId,
+							amount: _this.couponInfo.moneyCouponPrice,
+							url: _this.payInfo.payMobileUrl,
+							couponId:_this.couponId,
+							userId:_this.userId
+						};
+						CAIMEI.Storage.setItem('payData', JSON.stringify(_this.payInfo.payData));
+						if (!isPC) {
+							location.href = _this.payInfo.payMobileUrl;
+						} else {
+							window.open("/pay/caimei-paymobile.html?pageType=3");
+						}
+					} else {
+						CAIMEI.Alert(response.msg, '确定', false);
+						_this.isSubMitStatus = false;
+					}
+				});
+			},
+			mh_PayCouponMiniWxPay: function(){// 微信支付优惠券
+				console.log('微信支付优惠券');
+				if (!isPC) {
+					var orderInfo = {//普通订单微信二维码参数
+						pageType: 3,
+						payAmount: this.couponInfo.moneyCouponPrice,
+						couponRecordId:this.couponRecordId,
+						couponId: this.couponId,
+						userId : this.userId
+					};
+					this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
+					location.href = this.payInfo.payMobileUrl;
+				} else {
+					this.payInfo.payData = {
+						type: this.payInfo.payBankNum,
+						amount: this.couponInfo.moneyCouponPrice,
+						url: this.payInfo.payMobileUrl,
+						couponId:this.couponId,
+						couponRecordId:this.couponRecordId,
+						userId:this.userId
+					};
+					CAIMEI.Storage.setItem('payData', JSON.stringify(this.payInfo.payData));
+					window.open("/pay/caimei-paymobile.html?pageType=3");
+					this.isPayAlert = true;
+				}
+			},
+			mh_PayVipPcMallPay: function(){ // 网银支付会员
+				console.log('网银支付会员');
+				var _this = this;
+				var params = {
+					bankCode: this.payInfo.payBankNum,
+					returnUrl: 'https://www.caimei365.com/pay/success.html?pageType=www&type=success&payAmount='+_this.payAmount,
+					userType: _this.payInfo.payUserType,
+					vipRecordId: _this.vipRecordId
+				};
+				PayApi.PayVipPcMallPay(params, function (response) {
+					if (response.code == 0) {
+						_this.isPayAlert = true;
+						_this.isSubMitStatus = false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						window.open(response.data.data.payUrl);
+					} else {
+						_this.isSubMitStatus = false;
+						CAIMEI.Alert(response.msg, '确定', false);
+					}
+				});
+			},
+			mh_PayVipAliPay: function(){ // 支付宝支付会员
+				console.log('支付宝支付会员');
+				var _this = this;
+				var params = {
+					bankCode: _this.payInfo.payBankNum,
+					returnUrl: 'https://www.caimei365.com/',
+					userType: _this.payInfo.payUserType,
+					vipRecordId: _this.vipRecordId
+				};
+				console.log(params);
+				PayApi.PayVipAliPay(params, function(response){
+					console.log(response);
+					if (response.code === 0) {
+						_this.isPayAlert = true;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						_this.payInfo.payMobileUrl = response.data.data.payUrl;
+						_this.payInfo.payData = {
+							mbOrderId: _this.mbOrderId,
+							type: _this.payInfo.payBankNum,
+							amount: _this.payAmount,
+							url: _this.payInfo.payMobileUrl,
+						};
+						CAIMEI.Storage.setItem('payData', JSON.stringify(_this.payInfo.payData));
+						if (!isPC) {
+							location.href = _this.payInfo.payMobileUrl;
+						} else {
+							window.open("/pay/caimei-paymobile.html?pageType=2&duration=" + _this.comboInfo.duration);
+						}
+					} else {
+						CAIMEI.Alert(response.msg, '确定', false);
+						_this.isSubMitStatus = false;
+					}
+				});
+			},
+			mh_PayVipMiniWxPay: function(){ // 微信支付会员
+				if (!isPC) {
+					var orderInfo = {//普通订单微信二维码参数
+						couponId: 2,
+						vipId: this.comboInfo.id,
+						vipRecordId: this.vipRecordId,
+						payAmount: this.payAmount
+					};
+					this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state=" + JSON.stringify(orderInfo) + "#wechat_redirect";
+					location.href = this.payInfo.payMobileUrl;
+				} else {
+					this.payInfo.payData = {
+						type: this.payInfo.payBankNum,
+						vipId: this.comboInfo.id,
+						vipRecordId: this.vipRecordId,
+						amount: this.payAmount,
+						duration: this.comboInfo.duration,
+					};
+					CAIMEI.Storage.setItem('payData', JSON.stringify(this.payInfo.payData));
+					window.open("/pay/caimei-paymobile.html?pageType=2");
+					this.isPayAlert = true;
+				}
+			},
+			mh_PayOrdersecondUnion:function (){// 二手网银支付
+				var _this = this;
+				var params = {//二手
+					payWay:_this.payInfo.payBankNum,
+					returnUrl:'https://www.caimei365.com/',
+					productId:_this.productID,
+				};
+				_this.isSubMitStatus=true;
+				PayApi.PayOrdersecondUnion(params,function(response){
+					if(response.code == 0){
+						_this.isPayAlert = true;
+						_this.isSubMitStatus=false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						window.open(response.data.data.payUrl);
+					}else{
+						CAIMEI.Alert(response.msg,'确定',false);
+						_this.isSubMitStatus=false;
+					}
+				})
+			},
+			mh_PayOrdersecondAliPay:function (){// 二手支付宝支付
+				var _this = this;
+				var params = {//二手
+					returnUrl:'https://www.caimei365.com/',
+					productId:_this.productID,
+				};
+				_this.isSubMitStatus=true;
+				PayApi.PayOrdersecondAliPay(params,function(response){
+					if(response.code == 0){
+						_this.isPayAlert = true;
+						_this.isSubMitStatus=false;
+						_this.mbOrderId = response.data.data.mbOrderId;
+						_this.payInfo.payMobileUrl = response.data.data.payUrl;
+						_this.payInfo.payData = {
+							mbOrderId:_this.mbOrderId,
+							type:_this.payInfo.payBankNum,
+							productId:_this.productID,
+							amount:_this.payAmount,
+							url:_this.payInfo.payMobileUrl
+						};
+						CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData));
+						window.open("/pay/caimei-paymobile.html?pageType=1");
+					}else{
+						CAIMEI.Alert(response.msg,'确定',false);
+						_this.isSubMitStatus=false;
+					}
+				})
+			},
+			mh_PaySecondMiniWxPay:function () {// 二手发布微信支付
+				var _this = this;
+				if(!isPC){
+					var orderInfo = {//二手微信二维码参数
+						pageType:1,
+						productId:_this.productID,
+						payAmount:_this.payAmount
+					};
+					_this.payInfo.payMobileUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx91c4152b60ca91a3&redirect_uri=https://www.caimei365.com/pay/wechatpay.html&response_type=code&scope=snsapi_base&state="+JSON.stringify(orderInfo)+"#wechat_redirect";
+					location.href = _this.payInfo.payMobileUrl;
+				}else{
+					_this.payInfo.payData = {//二手
+						type:_this.payInfo.payBankNum,
+						productId:_this.productID,
+						amount:_this.payAmount,
+						url:_this.payInfo.payMobileUrl
+					};
+					CAIMEI.Storage.setItem('payData',JSON.stringify(_this.payInfo.payData));
+					window.open("/pay/caimei-paymobile.html?pageType=1");
+					_this.isPayAlert = true;
+				}
+			},
+
+		}
+	};
+}();

+ 0 - 0
src/main/resources/static/js/pay/mixin/mh_mixin.js → src/main/resources/static/js/pay/mixin/mh_wxMixin.js


+ 1 - 1
src/main/resources/templates/activity/beautyTopic.html

@@ -825,7 +825,7 @@
 <script charset="utf-8" type="text/javascript" th:src="@{/js/activity/beautyTopic/base.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/activity/beautyTopic/utils.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/activity/beautyTopic/layout.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/activity/beautyTopic/mh_mixin.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/activity/beautyTopic/mixin.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/activity/beautyTopic.js(v=${version})}"></script>
 <script>
     var isFormal = window.location.href.indexOf('www.caimei365.com') !== -1;

+ 1 - 0
src/main/resources/templates/pay/caimei-hlbpay.html

@@ -181,6 +181,7 @@
 <script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/product.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/pay.service.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/pay/caimei-bank.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/pay/mixin/hlb_payMixin.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/pay/caimei-hlbpay.js(v=${version})}"></script>
 </body>
 </html>

+ 2 - 2
src/main/resources/templates/pay/caimei-wechatpay.html

@@ -33,8 +33,8 @@
 <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/lib/js/viewport-sitting.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/common/serviceapi/pay.service.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/pay/mixin/hlb_mixin.js(v=${version})}"></script>
-<script charset="utf-8" type="text/javascript" th:src="@{/js/pay/mixin/mh_mixin.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/pay/mixin/hlb_wxMixin.js(v=${version})}"></script>
+<script charset="utf-8" type="text/javascript" th:src="@{/js/pay/mixin/mh_wxMixin.js(v=${version})}"></script>
 <script charset="utf-8" type="text/javascript" th:src="@{/js/pay/caimei-wechatpay.js(v=${version})}"></script>
 </body>
 </html>