Quellcode durchsuchen

网银支付调整

zhengjinyi vor 3 Jahren
Ursprung
Commit
9c1698436c

+ 2 - 2
src/main/resources/static/css/pay/caimei-paymobile.css

@@ -18,7 +18,7 @@
     .pay-codecontent .pay-amount{width: 278px;height: 100%;float: left;}
     .pay-codecontent .pay-amount .pay-amount-text{width: 100%;height: auto;float: left;margin-bottom: 40px;}
     .pay-codecontent .pay-amount .pay-amount-text p{font-size: 16px;text-align: left;color: #333;line-height: 34px;}
-    .pay-codecontent .pay-amount .pay-amount-text p span{margin-left: 5px;}
+    .pay-codecontent .pay-amount .pay-amount-text p span{margin-left: 5px;color: #E15616;}
     .pay-codecontent .pay-amount .pay-amount-icon{width: 278px;height: 205px;float: left;}
     .pay-codecontent .pay-amount .pay-amount-icon img{width: 100%;height: 100%;display: block;}
     .pay-codecontent .pay-codemain{width: 300px;height: auto;float: right;position: relative;}
@@ -77,7 +77,7 @@
     .pay-codecontent .pay-amount{width:  100%;height: auto;float: left;}
     .pay-codecontent .pay-amount .pay-amount-text{width: 100%;height: auto;float: left;margin-bottom: 4vw;}
     .pay-codecontent .pay-amount .pay-amount-text p{font-size: 4vw;text-align: center;color: #333;line-height: 8vw;}
-    .pay-codecontent .pay-amount .pay-amount-text p span{margin-left: 5px;}
+    .pay-codecontent .pay-amount .pay-amount-text p span{margin-left: 5px;color: #E15616;}
     .pay-codecontent .pay-amount .pay-amount-icon{display: none;}
     .pay-codecontent .pay-codemain{width: 100%;height: auto;float: right;position: relative;}
     .pay-codecontent .pay-codemain .code-title{width: 100%;height:8vw;line-height:8vw;font-size: 4vw;color: #333333;margin-bottom: 20px;text-align: center;font-weight: bold;}

+ 12 - 0
src/main/resources/static/js/common/serviceapi/pay.service.js

@@ -148,6 +148,18 @@ var PayApi = {
                 callback(res);
             });
         },
+        PayOrderUnionStatus: function (params, callback) {//查询网银判断是否已完成支付
+            Http.AjaxService({
+                url:'/order/pay/result/union',
+                type:'GET',
+                data:params,
+                json:true,
+                isHost:true
+            })
+            .then(function(res){
+                callback(res);
+            });
+        },
         PayOrderPayLink: function (params, callback) {//生成网银支付链接
             Http.AjaxService({
                 url:'/order/pay/link',

+ 32 - 30
src/main/resources/static/js/pay/caimei-hlbpay.js

@@ -7,7 +7,7 @@ var payContainer = new Vue({
     data: {
         isSubMitStatus:false,
         payInfo:{
-            payBankNum: 'ICBC_B2B', //支付类型
+            payBankNum: '', //支付类型
             shopOrderId: '',  //订单ID
             obligation: '', //待支付金额
             payAmount: 0,//本次支付金额
@@ -17,6 +17,7 @@ var payContainer = new Vue({
             payType:'1',
         },
         iframe:'',
+        orderFlag:1,// 是否是订单  0非订单 1订单
         couponInfo:{},
         bankListB2BData:[],// 企业网银银行列表
         bankListB2CData:[],// 个人网银银行列表
@@ -121,11 +122,6 @@ var payContainer = new Vue({
                 if(response.code == 0){
                     _self.bankListB2BData = response.data.B2B;
                     _self.bankListB2CData = response.data.B2C;
-                    if(   _self.payInfo.payType == '1'){
-                        _self.payInfo.payBankNum = _self.bankListB2BData[0].b2B;
-                    }else{
-                        _self.payInfo.payBankNum = _self.bankListB2CData[0].b2C;
-                    }
                 }else{
                     console.log('获取网银支付银行列表异常')
                 }
@@ -365,7 +361,7 @@ var payContainer = new Vue({
                         }
                     });
                 }else{
-                    PayApi.PayOrderPayWhetherSuccess({orderId: _self.payInfo.shopOrderId, paySuccessCounter:_self.paySuccessCounter},function(response){
+                    PayApi.PayOrderPayWhetherSuccess({shopOrderId: _self.payInfo.shopOrderId, paySuccessCounter:_self.paySuccessCounter},function(response){
                         _self.isPayAlert = false;
                         if(response.code === 0){
                             _self.windowLocationHref('success');
@@ -374,34 +370,36 @@ var payContainer = new Vue({
                         }
                     });
                 }
-            }else{
-                PayApi.PayOrderFindOrderStatus({mbOrderId:_self.mbOrderId},function(response){
-                    _self.isPayAlert = false;
-                    var data = response.data.data;
-                    if(data.status === '1'){
-                        _self.windowLocationHref('success');
+            }else if(_self.payInfo.payBankNum == 'ALIPAY'){// 校验支付宝支付成功
+                PayApi.PayOrderFindOrderStatus({mbOrderId:_self.mbOrderId,orderFlag:_self.orderFlag,shopOrderId:_self.payInfo.shopOrderId},function(response){
+                    if(response.code === 0){
+                        _self.isPayAlert = false;
+                        var data = response.data;
+                        if(data.rt7_orderStatus === 'SUCCESS'){
+                            _self.windowLocationHref('success');
+                        }else{
+                            _self.windowLocationHref('error');
+                        }
                     }else{
-                        _self.windowLocationHref('error');
+                        CAIMEI.Alert(response.msg,'确定',false);
+                    }
+                });
+            }else{// 校验网银支付成功
+                PayApi.PayOrderUnionStatus({mbOrderId:_self.mbOrderId,orderFlag:_self.orderFlag,shopOrderId:_self.payInfo.shopOrderId},function(response){
+                    if(response.code === 0){
+                        _self.isPayAlert = false;
+                        var data = response.data;
+                        if(data.rt10_orderStatus === 'SUCCESS'){
+                            _self.windowLocationHref('success');
+                        }else{
+                            _self.windowLocationHref('error');
+                        }
+                    }else{
+                        CAIMEI.Alert(response.msg,'确定',false);
                     }
                 });
             }
         },
-        RefreshBigBody:function () {// 校验是否完成银联支付
-            var _self = this;
-            PayApi.PayOrderFindOrderStatus({mbOrderId:_self.mbOrderId},function(response){
-                _self.isPayBigAlert = false;
-                var data = response.data.data;
-                if(data.status === '1'){
-                    setTimeout(()=>{
-                        window.location.href = '/pay/success.html?pageType=www&type=success&payAmount='+_self.payAmount;
-                    },1000)
-                }else{
-                    setTimeout(()=>{
-                        window.location.href = '/pay/success.html?pageType=unionPay&type=error&payAmount='+_self.payAmount+'&orderId='+_self.payInfo.shopOrderId;
-                    },1000)
-                }
-            });
-        },
         windowLocationHref:function(state){
             var _self = this;
             if( _self.pageType === '1'){
@@ -444,7 +442,9 @@ var payContainer = new Vue({
             this.payAmount = _self.toFixedFn(100);
             this.isRequest = true;
             this.payStatusText = '';
+            this.orderFlag = 0;
         } else if (this.pageType === '2') { // 支付会员
+            this.orderFlag = 0;
             this.vipRecordId = parseInt(CAIMEI.getUrlParam('vipRecordId'));
             this.PayOrderOnLineSwitch();
             // 从本地获取选中的svip套餐信息后删除本地信息
@@ -455,12 +455,14 @@ var payContainer = new Vue({
             // 获取银行列表
             this.getBankList();
         } else if(this.pageType === '3') {// 支付优惠券
+            this.orderFlag = 0;
             this.couponId = parseInt(CAIMEI.getUrlParam('couponId'));
             this.couponRecordId = parseInt(CAIMEI.getUrlParam('couponRecordId'));
             this.initCouponDetail(this.couponId);
             this.PayOrderOnLineSwitch();
             this.getBankList();
         }else{
+            this.orderFlag = 1;
             this.payInfo.shopOrderId = CAIMEI.getUrlParam('shopOrderId');
             // 获取银行列表
             this.getBankList();

+ 24 - 19
src/main/resources/static/js/pay/caimei-pay.js

@@ -19,6 +19,7 @@ var payContainer = new Vue({
             payLinkTypeText:'',//文案
         },
         iframe:'',
+        orderFlag:1,// 是否是订单  0非订单 1订单
         bankListB2BData:[],// 企业网银银行列表
         bankListB2CData:[],// 个人网银银行列表
         userName :'',
@@ -77,12 +78,13 @@ var payContainer = new Vue({
             var _self = this;
             PayApi.PayOrderLinkData({linkLogo:linkLogo},function(response){
                 if(response.code == 0){
-                    var _data = response.data;
-                    console.log(_data);
-                    _self.payInfo.shopOrderId = _data.orderPayLink.shopOrderId;
-                    _self.payInfo.payUnpaidAmount = _self.payAmount = _data.orderPayLink.unpaidAmount;
-                    _self.payInfo.payTime = decodeURI(_data.time);
-                    _self.payInfo.payLinkType = _data.orderPayLink.payType;
+                    var data = response.data;
+                    console.log(data);
+                    _self.payInfo.shopOrderId = data.orderPayLink.shopOrderId;
+                    _self.orderFlag = data.orderFlag;
+                    _self.payInfo.payUnpaidAmount = _self.payAmount = data.orderPayLink.unpaidAmount;
+                    _self.payInfo.payTime = decodeURI(data.time);
+                    _self.payInfo.payLinkType = data.orderPayLink.payType;
                     _self.payInfo.payLinkTypeText =  _self.payInfo.payLinkType == 1 ? '企业网银' : '个人网银';
                     if(_self.paymentChannel == 'HLB'){
                         _self.payInfo.payUserType =  _self.payInfo.payLinkType == 1 ? 'B2B' : 'B2C';
@@ -90,9 +92,9 @@ var payContainer = new Vue({
                         _self.payInfo.payUserType =  _self.payInfo.payLinkType == 1 ? 'ENTERPRISE' : 'USER';
                     }
                     _self.getBankList();
-                    _self.unpaidAmount = _data.orderPayLink.unpaidAmount;
-                    _self.type = _data.type;
-                    if(_data.code == 0){
+                    _self.unpaidAmount = data.orderPayLink.unpaidAmount;
+                    _self.type = data.type;
+                    if(data.code == 0){
                         setTimeout(function () {  //支付倒计时
                             _self.countTime(_self.payInfo.payTime)
                         }, 1000);
@@ -100,9 +102,9 @@ var payContainer = new Vue({
                             _self.infoPayOrderCheckoutCounter();
                         }else{
                             console.log('本次支付链接是支付超级会员');
-                            _self.userName = _data.userName;
-                            _self.vipMonth = _data.orderPayLink.vipMonth;
-                            _self.vipRecordId = _data.orderPayLink.vipRecordId;
+                            _self.userName = data.userName;
+                            _self.vipMonth = data.orderPayLink.vipMonth;
+                            _self.vipRecordId = data.orderPayLink.vipRecordId;
                             _self.isRequest = true;
                         }
                     }else{
@@ -199,13 +201,16 @@ var payContainer = new Vue({
         },
         RefreshBody:function(){//刷新弹窗
             var _self = this;
-            _self.isPayAlert = false;
-            PayApi.PayOrderFindOrderStatus({mbOrderId:_self.mbOrderId},function(response){
-                _self.isPayAlert = false;
-                var data = response.data.data;
-                var pageType = _self.type === 1 ? 'www' : 'vip&payFlag=1'; // 1 普通订单 2 vip订单
-                var type = data.status === '1' ? 'success' : 'error'; // 成功 or 失败
-                window.location.href = '/pay/success.html?pageType='+ pageType +'&type='+ type +'&payAmount=' + _self.payInfo.payUnpaidAmount;
+            PayApi.PayOrderUnionStatus({mbOrderId:_self.mbOrderId,orderFlag:_self.orderFlag,shopOrderId:_self.payInfo.shopOrderId},function(response){
+                if(response.code === 0){
+                    _self.isPayAlert = false;
+                    var data = response.data;
+                    var pageType = _self.type === 1 ? 'www' : 'vip&payFlag=1'; // 1 普通订单 2 vip订单
+                    var type = data.rt10_orderStatus === 'SUCCESS' ? 'success' : 'error'; // 成功 or 失败
+                    window.location.href = '/pay/success.html?pageType='+ pageType +'&type='+ type +'&payAmount=' + _self.payInfo.payUnpaidAmount;
+                }else{
+                    CAIMEI.Alert(response.msg,'确定',false);
+                }
             });
         },
         checkBankPay:function(index,item){// 选择银行

+ 6 - 2
src/main/resources/static/js/pay/mixin/hlb_payMixin.js

@@ -17,8 +17,8 @@ var hlbPayMixin = function () {// 合利宝支付渠道
 				console.log('正常订单合利宝网银支付通道',params)
 				PayApi.PayOrderPcMallPay(params,function(response){
 					if(response.code == 0){
-						// _this.isPayAlert = true;
-						_this.iframe = response.data
+						_this.isPayAlert = true;
+						_this.iframe = response.data;
 						_this.$nextTick(() => {
 							var onlineForm = document.getElementById('onlineForm');
 							onlineForm.setAttribute('target', '_blank')
@@ -26,6 +26,7 @@ var hlbPayMixin = function () {// 合利宝支付渠道
 							console.log('mbOrderId',_this.mbOrderId)
 							_this.isSubMitStatus=false;
 							onlineForm.submit();
+							document.getElementById('onlineForm').remove();
 						})
 					}else{
 						_this.isSubMitStatus=false;
@@ -107,6 +108,7 @@ var hlbPayMixin = function () {// 合利宝支付渠道
 				};
 				PayApi.PayCouponUnionPay(params, function (response) {
 					if (response.code == 0) {
+						_this.isPayAlert = true;
 						_this.iframe = response.data
 						_this.$nextTick(() => {
 							var onlineForm = document.getElementById('onlineForm');
@@ -197,6 +199,7 @@ var hlbPayMixin = function () {// 合利宝支付渠道
 				_this.isSubMitStatus=true;
 				PayApi.PayVipPcMallPay(params, function (response) {
 					if (response.code == 0) {
+						_this.isPayAlert = true;
 						_this.iframe = response.data
 						_this.$nextTick(() => {
 							var onlineForm = document.getElementById('onlineForm');
@@ -283,6 +286,7 @@ var hlbPayMixin = function () {// 合利宝支付渠道
 				_this.isSubMitStatus=true;
 				PayApi.PayOrdersecondUnion(params,function(response){
 					if(response.code == 0){
+						_this.isPayAlert = true;
 						_this.iframe = response.data
 						_this.$nextTick(() => {
 							var onlineForm = document.getElementById('onlineForm');

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

@@ -24,7 +24,7 @@
             <div class="pay-codecontent">
                 <div class="pay-amount">
                     <div class="pay-amount-text">
-                        <p v-if="pageType == '2'">超级会员套餐:{{ duration }}个月 </p>
+                        <p v-if="pageType == '2'">超级会员套餐:<span>{{ duration }}个月</span></p>
                         <p>交易金额: <span>¥{{payAmount | NumFormat}}</span> </p>
                         <template>
                             <p v-if="pageType == '2' || pageType == '3'">收款方: <span>深圳市采美信息技术有限公司</span> </p>
@@ -55,7 +55,7 @@
             <div class="pay-codecontent">
                 <div class="pay-amount">
                     <div class="pay-amount-text">
-                        <p v-if="pageType == '2'">超级会员套餐:{{ duration }}个月 </p>
+                        <p v-if="pageType == '2'">超级会员套餐:<span>{{ duration }}个月</span> </p>
                         <p>交易金额: <span>¥{{payAmount | NumFormat}}</span> </p>
                         <template>
                             <p v-if="pageType == '2' || pageType == '3'">收款方: <span>深圳市采美信息技术有限公司</span> </p>