Ver código fonte

大额银联转账

Admin 3 anos atrás
pai
commit
1923b083a8

+ 6 - 0
common/config/caimeiApi.js

@@ -320,6 +320,11 @@ const caimeiApi = {
             url:url
         })
     },
+	navigateBack:function(page){
+	    uni.navigateBack({
+		    delta: page
+	    })
+	},
     isNumber:function(value){//验证是否为数字
 	    var patrn = /^(-)?\d+(\.\d+)?$/
 	    if (patrn.exec(value) == null || value == '') {
@@ -418,6 +423,7 @@ module.exports = {
     reLaunch: caimeiApi.reLaunch,
     redirectTo: caimeiApi.redirectTo,
     switchTabTo: caimeiApi.switchTabTo,
+    navigateBack: caimeiApi.navigateBack,
     formatDate: caimeiApi.formatDate,
     loginStatus: caimeiApi.loginStatus,
     setStorage: caimeiApi.setStorage,

+ 11 - 3
common/css/iconfont.scss

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 1519039 */
-  src: url('//at.alicdn.com/t/font_1519039_k9xk8oyll3o.woff2?t=1647772062384') format('woff2'),
-       url('//at.alicdn.com/t/font_1519039_k9xk8oyll3o.woff?t=1647772062384') format('woff'),
-       url('//at.alicdn.com/t/font_1519039_k9xk8oyll3o.ttf?t=1647772062384') format('truetype');
+  src: url('//at.alicdn.com/t/font_1519039_u43k2sbvzfj.woff2?t=1647842651579') format('woff2'),
+       url('//at.alicdn.com/t/font_1519039_u43k2sbvzfj.woff?t=1647842651579') format('woff'),
+       url('//at.alicdn.com/t/font_1519039_u43k2sbvzfj.ttf?t=1647842651579') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,14 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-shibai:before {
+  content: "\e735";
+}
+
+.icon-wancheng:before {
+  content: "\e734";
+}
+
 .icon-daewangyinzhuanzhang:before {
   content: "\e732";
 }

+ 7 - 0
pages.json

@@ -294,6 +294,13 @@
                         "navigationStyle": "custom"
                     }
                 },
+                {
+                    "path": "order/order-success",
+                    "style": {
+                        "navigationBarTitleText": "支付结果",
+                        "navigationStyle": "custom"
+                    }
+                },
                 {
                     "path": "order/order-payment",
                     "style": {

+ 137 - 4
pages/user/order/order-pay.vue

@@ -76,6 +76,40 @@
 				</view>
 			</view>
 		</view>
+		<!--大额转账弹窗  -->
+		<tui-modal :show="modal" :padding="'30rpx 30rpx'" @cancel="hideMobel(0)" :custom="true" fadeIn >
+			<view class="tui-modal-custom">
+				<view class="tui-prompt-title">大额银联转账信息</view>
+				<view class="tui-prompt-text">
+					<view class="tui-prompt-tips">请使用银行手机app或者网银输入以下信息进行转账。每次发起支付请求,收款账号都会变化,请使用最新的收款账号进行转账。</view>
+					<view class="tui-prompt-item">
+						<text class="text">户名:</text>
+						{{ bigPayInfo.receiveName }}
+					</view>
+					<view class="tui-prompt-item">
+						<text class="text">收款账号:</text>
+						{{ bigPayInfo.receiveAccountNo }}
+						<view class="clipboard" @click.stop="copyClipboard(bigPayInfo)">复制</view>
+					</view>
+					<view class="tui-prompt-item">
+						<text class="text">银行:</text>
+						{{ bigPayInfo.accountName }}
+					</view>
+					<view class="tui-prompt-item">
+						<text class="text">收款方开户地:</text>
+						{{ bigPayInfo.areaInfo }}
+					</view>
+					<view class="tui-prompt-item">
+						<text class="text">收款网点:</text>
+						{{ bigPayInfo.accountName }}
+					</view>
+				</view>
+				<view class="tui-prompt-flex">
+					<view class="btn btn-confirm" @click="handleClick">已完成转账,请点击</view>
+					<view class="btn btn-cancel" @click="hideMobel">关闭</view>
+				</view>	
+			</view>
+		</tui-modal>	
 	</view>
 </template>
 
@@ -113,7 +147,10 @@
 				btnColor:'#09BB07',
 				discernReceipt:[],
 				showDigitKeyboard:false,
-				payHttpUrl:''
+				payHttpUrl:'',
+				bigPayInfo:{},// 大额网银转账
+				mbOrderId:0, // 支付记录订单Id
+				modal:false,
 			}
 		},
 		onLoad(option) {
@@ -206,13 +243,29 @@
 					return
 				}
 				if(this.payAmount <=10){
-					this.$util.msg('网银支付的金额必须大于¥10.00',2000)
+					this.$util.msg('网银支付的金额必须大于¥12.00',2000)
 					return
 				}
-				this.PayService.PayOrderPayLink({unpaidAmount:this.payAmount,orderId:this.orderId,payType:this.payType}).then(response =>{
-					
+				this.PayService.PayOrderTransferUnion({payAmount:this.accMul(this.payAmount,100),orderId:this.orderId}).then(response =>{
+					this.bigPayInfo = JSON.parse(response.data.data.payInfo)
+					this.mbOrderId = response.data.data.mbOrderId;
+					this.modal = true
+					console.log('PayInfo',this.bigPayInfo)
 				})
 			},
+			handleClick(){// 查询是否支付成功
+				this.PayService.PayOrderFindOrderStatus({mbOrderId:this.mbOrderId}).then(response =>{
+					let data =  {
+						  payAmount:this.payAmount,
+						  orderId:this.orderId,
+						  type:response.data.data === '1' ? 'success' : 'error'
+						}
+					this.$api.navigateTo(`/pages/user/order/order-success?data=${JSON.stringify({ data: data })}`)
+				})
+			},
+			hideMobel(){
+				this.modal = false
+			},
 			BuildCatenate(){// 企业网银  个人网银
 				if(this.payAmount == 0){
 					this.$util.msg('请输入本次支付的金额',2000)
@@ -353,7 +406,19 @@
 			toFixedFn(text){//处理小数点后两位数
 				return Number(text).toFixed(2)
 			},
+			copyClipboard(data){
+				//复制账号
+				let thoruiData =  data.receiveName + '' + data.receiveAccountNo
+				thorui.getClipboardData(thoruiData, (res) => {
+					if (res) {
+						this.$util.msg('复制成功',2000,true,'success')
+					} else {
+						this.$util.msg('复制失败',2000,true,'none')
+					}
+				})
+			},
 			clipboard(data) {//复制链接
+				console.log('data',data)
 				thorui.getClipboardData(data, (res) => {
 					if (res) {
 						this.isShowTip = false
@@ -672,4 +737,72 @@
 			}
 		}
 	}
+	.tui-prompt-title{
+		width: 100%;
+		height: 44rpx;
+		line-height: 44rpx;
+		padding: 20rpx 0;
+		text-align: center;
+		color: #333333;
+		border-bottom: 1px solid #E2E7EF;
+	}
+	.tui-prompt-text{
+		padding-top: 20rpx;
+		.tui-prompt-tips{
+			width: 100%;
+			line-height: 36rpx;
+			font-size: $font-size-22;
+			color: #E15616;
+			text-align: justify;
+			margin-bottom: 24rpx;
+		}
+		.tui-prompt-item{
+			width: 100%;
+			line-height: 60rpx;
+			color: #333333;
+			font-size: $font-size-26;
+			.text{
+				font-weight: bold;
+			}
+			.clipboard{
+				height: 38rpx;
+				box-sizing: border-box;
+				padding: 0 24rpx;
+				background:#FFE6DC;
+				text-align: center;
+				font-size: $font-size-22;
+				color: #E15616;
+				border-radius: 18rpx;
+				line-height: 36rpx;
+				display: inline-block;
+				margin-left: 20rpx;
+				border: 1px solid #E15616;
+			}
+		}	
+	}
+	.tui-prompt-flex{
+		width: 100%;
+		height: auto;
+		margin-top: 20rpx;
+		box-sizing: border-box;
+		padding: 0 35rpx;
+		.btn{
+			width: 100%;
+			line-height: 84rpx;
+			font-size: $font-size-26;
+			text-align: center;
+			color: #FFFFFF;
+			border-radius: 44rpx;
+			margin: 20rpx 0;
+			&.btn-cancel{
+				background: #FFFFFF;
+				color: #333333;
+				border: 1px solid #979797;
+			}
+			&.btn-confirm{
+				background: $btn-confirm;
+			}
+		}
+		
+	}
 </style>

+ 7 - 27
pages/user/order/order-payment.vue

@@ -120,27 +120,11 @@
 							<text class="iconfont icon-gantanhao-yuankuang"></text>
 						</view>
 						<view class="pay-text">
-							<text>{{payStatusText}}</text>
+							<view>1.{{payStatusText}}</view>
+							<view>2.大额支付请使用大额银联转账方式进行付款。</view>
 						</view>
 					</view>
 				</view>
-				<view class="pay-bring clearfix" :style="{paddingBottom:isIphoneX ? '68rpx' : '24rpx'}" @click.stop="showTips" v-if="isReceiptStatus">
-					<view class="pay-bring-line"><text class="line"></text></view>
-					<view class="pay-bring-content" v-if="!isShowTip">
-						<view class="text bg-color">查看转账信息</view>
-						<view class="text">除了以上线上支付方式</view>
-						<view class="text">您还可以通过线下转账的方式付款</view>
-					</view>
-					<view class="pay-bring-content" v-else>
-						<view class="text-v title">转账信息</view>
-						<view class="text-v">开户行:中信银行(深圳泰然支行)</view>
-						<view class="text-v">银行卡号:{{bankNumber}}</view>
-						<view class="text-v">户名:周仁声</view>
-						<view class="text-v">订单标识:{{payOrderId}} <text class="clipboard" @click.stop="clipboard(payOrderId)">复制</text></view>
-						<view class="text-v title">特别注意</view>
-						<view class="text-v bg-color">请在转账备注中填写上述订单标识,方便财务快速审核,提高发货速度</view>
-					</view>
-				</view>
 			</view>
 		</template>
 	</view>
@@ -167,7 +151,6 @@
 				isIphoneX:this.$store.state.isIphoneX,
 				CustomBar:this.CustomBar,// 顶部导航栏高度
 				tabCurrentIndex:0,
-				isShowTip:false,
 				isReceiptStatus:false,
 				buttonText:'使用微信支付',
 				btnColor:'#09BB07',
@@ -177,7 +160,7 @@
 				optionType:'',
 				onlinePayFlag:'',
 				payBringTitle:'本次交易暂不支持线上支付,请使用线下转账方式付款',
-				payStatusText:'使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。',
+				payStatusText:'使用任何一种线上支付方式支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。',
 				pageType:''
 			}
 		},
@@ -263,10 +246,10 @@
 						this.onlinePay = response.data.onlinePay
 					}
 					if(data.receiptAmount>0){
-						this.payStatusText = '使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。'
+						this.payStatusText = '使用任何一种线上支付方式支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。'
 						this.isReceiptStatus = false
 					}else{
-						this.payStatusText = '使用微信和网银支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。若着急发货,可以选择使用线下转账进行付款。'
+						this.payStatusText = '使用任何一种线上支付方式支付全部金额后,供应商会在24小时后发货(周末、节假日顺延)。'
 						this.isReceiptStatus = true
 					}
 				}).catch(error =>{
@@ -330,9 +313,6 @@
 					delta: 1
 				})
 			},
-			showTips(){
-				this.isShowTip=!this.isShowTip
-			},
 			clipboard(data) {
 				thorui.getClipboardData(data, (res) => {
 					if (res) {
@@ -527,7 +507,7 @@
 		}
 		.pay-statustext{
 			width: 100%;
-			height: 120rpx;
+			height: auto;
 			float: left;
 			margin-top:40rpx;
 			.pay-statustext-inner{
@@ -550,7 +530,7 @@
 					height: 100%;
 					float: left;
 					line-height: 40rpx;
-					font-size: $font-size-26;
+					font-size: $font-size-24;
 					color: #FF2A2A;
 					text-align: justify;
 				}

+ 169 - 0
pages/user/order/order-success.vue

@@ -0,0 +1,169 @@
+<template>
+	<view class="container cashier">
+		<cu-custom :navbar-data='nvabarData'></cu-custom>
+		<view class="container-cash clearfix" :style="{marginTop:CustomBar+'px'}">
+			<view class="container-wrapper">
+				<view class="cash-icon">
+					<text class="iconfont" :class="payStatus ? 'icon-wancheng' : 'icon-shibai'"></text>
+				</view>
+				<view class="cash-text">
+					<text>{{ successText }}</text>
+				</view>
+			</view>
+			<view class="container-amount">
+				<view class="amount-label">支付金额</view>
+				<view class="amount-money">{{ amuntMoney | NumFormat }}</view>
+			</view>
+			<view class="container-button">
+				<view class="btn btn-home" v-if="payStatus" @click="this.$api.switchTabTo('/pages/tabBar/home/index')">回到首页</view>
+				<view class="btn btn-home" v-else @click="toAgainPay">重新支付</view>
+				<view class="btn btn-open" @click="details">查看订单</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default{
+		data(){
+			return{
+				orderId:0,
+				nvabarData: {		//顶部自定义导航
+					haveBack:false,
+					haveHome:true,
+					showCapsule:1, // 是否显示左上角图标  1表示显示  0表示不显示,
+					showSearch: 0,
+					title: '支付结果',  // 导航栏 中间的标题
+					textLeft:this.$store.state.isIphone
+				},
+				payType:'',
+				payStatus:false,
+				amuntMoney:0,
+				successText:'本次支付失败',
+				isIphoneX:this.$store.state.isIphoneX,
+				CustomBar:this.CustomBar,// 顶部导航栏高度
+				
+			}
+		},
+		filters:{
+			NumFormat(value) {
+			    //处理金额
+			    if (value) {
+			        return Number(value).toFixed(2)
+			    } else {
+			        return '0.00'
+			    }
+			}
+		},
+		onLoad(option) {
+			this.initData(option)
+		},
+		methods:{
+			initData(option){
+				const data = JSON.parse(option.data);
+				this.orderId = data.data.orderId
+				this.payType = data.data.type
+				this.amuntMoney = data.data.payAmount
+				if(this.payType == 'success'){
+					this.payStatus = true
+					this.successText = '本次支付成功'
+				}else{
+					this.payStatus = false
+					this.successText = '本次支付失败'
+				}
+				console.log(this.orderId)
+			},
+			toAgainPay(){
+				this.$api.navigateBack(2)
+			},
+			details(){
+				this.$api.redirectTo('/pages/user/order/order-details?type=share&orderId='+this.orderId)
+			}
+		},
+		onShow() {
+			
+		}
+	}
+</script>
+
+<style lang="scss">
+	page{
+		height: auto !important;
+	}
+	.container-cash{
+		width: 100%;
+		.container-wrapper{
+			width:100%;
+			height: auto;
+			padding: 120rpx 24rpx 0 24rpx;
+			box-sizing: border-box;
+			.cash-icon{
+				width: 100%;
+				height: 90rpx;
+				text-align: center;
+				.iconfont{
+					font-size: 80rpx;
+					&.icon-wancheng{
+						color:#00BE6F ;
+					}
+					&.icon-shibai{
+						color:#F94B4B ;
+					}
+				}
+			}
+			.cash-text{
+				width: 100%;
+				height: 90rpx;
+				text-align: center;
+				font-size: $font-size-28;
+				color: $text-color;
+				line-height: 90rpx;
+				padding-bottom: 40rpx;
+			}
+		}
+		.container-amount{
+			width: 100%;
+			height: 130rpx;
+			box-sizing: border-box;
+			padding: 0 24rpx;
+			margin-bottom: 24rpx;
+			font-size: $font-size-28;
+			color: #333333;
+			line-height: 90rpx;
+			border-top: 20rpx solid #F7F7F7;
+			border-bottom: 20rpx solid #F7F7F7;
+			.amount-label{
+				float: left;
+				font-weight: bold;
+			}
+			.amount-money{
+				float: right;
+				text-align: right;
+			}
+		}
+		.container-button{
+			width: 100%;
+			box-sizing: border-box;
+			padding: 80rpx 75rpx;
+			.btn{
+				width: 100%;
+				height: 90rpx;
+				border-radius: 50rpx;
+				line-height: 90rpx;
+				box-sizing: border-box;
+				text-align: center;
+				font-size: $font-size-26;
+				color: #FFFFFF;
+				margin: 24rpx 0;
+				&.btn-open{
+					background:#FFFFFF;
+					border: 1px solid $color-system;
+					color: $color-system;
+				}
+				&.btn-home{
+					background:$btn-confirm;
+				}
+			}
+		}
+	}
+</style>

+ 25 - 0
services/pay.service.js

@@ -129,4 +129,29 @@ export default class PayService {
               
         })
     } 
+    /**
+	 *@param 订单支付大额网银转账
+	 *@param  payAmount  转账金额
+	 *@param  orderId 订单ID
+	 */
+    PayOrderTransferUnion (data = {}) {
+        return this.AjaxService.post({
+            url:'/order/pay/transfer/union', 
+            data, 
+            isLoading: true ,
+              
+        })
+    } 
+    /**
+	 *@param 校验是否网银转账成功
+	 *@param  mbOrderId  交易订单号
+	 */
+    PayOrderFindOrderStatus (data = {}) {
+        return this.AjaxService.get({
+            url:'/order/pay/result/json', 
+            data, 
+            isLoading: true ,
+              
+        })
+    } 
 }