ソースを参照

待支付订单-订单支付(选择绑定团队代付),订单详情(支付团队信息信息显示)

gcz 1 週間 前
コミット
4bca15adfb
4 ファイル変更168 行追加55 行削除
  1. 75 15
      center/order.vue
  2. 82 36
      center/orderdetails.vue
  3. 6 4
      center/pay.vue
  4. 5 0
      common/apiurl.js

+ 75 - 15
center/order.vue

@@ -55,6 +55,14 @@
 			</mescroll-body>
 		</view>
 		<u-toast ref="uToast"></u-toast>
+		<u-picker
+			:show="showPayTeamModal"
+			:columns="[bindList]"
+			keyName="bindTeamName"
+			@confirm="onPickerConfirm"
+			@cancel="cancelPayTeam"
+			title="请选择支付团队"
+		></u-picker>
 		<tabbar :tabbarIndexProps="1" />
 	</view>
 </template>
@@ -121,6 +129,10 @@
 					refundNum:0,
 				},
 				templateIdList:[],//微信小程序订阅消息
+				bindList:[],
+				showPayTeamModal: false, // 支付团队选择模态框显示状态
+				selectedTeamId: '', // 选中的团队ID
+				selectedOrderId: '', // 选中的订单ID
 			}
 		},
 		computed: {
@@ -281,22 +293,26 @@
 					console.log('getTemplateIdList',err);
 				})
 			},
-			pay(item){
+			async pay(item){
 				console.log('pay',item);
-				uni.$u.route('/center/pay', {
-					orderId: item.id,
-					// openid: that.vuex_wechatOpenid,
-					payAmount:item.orderPrice
-				});
-				return
-				
-				// #ifdef H5
-				this.gotoPay(item.id);
-				// #endif
-				// #ifdef MP
-				this.setTemplate(item.id);
-				// #endif
+				let bindListData = await this.$u.api.getBindList();
+				let bindList = bindListData.data?.list;
+				this.bindList = bindList;
+				this.selectedOrderId = item.id;
 				
+				// 如果bindList长度大于1,显示模态框让客户选择支付团队
+				if(bindList.length>1){
+					this.showPayTeamModal = true;
+					this.selectedTeamId = bindList[0].bindTeamId; // 默认选中第一个团队
+				} else if(bindList.length === 1) {
+					// 如果只有一个团队,直接使用该团队进行支付
+					this.goToPayPage(item.id, bindList[0].bindTeamId, item.orderPrice);
+				} else {
+					uni.showToast({
+						title: '没有可用的支付团队',
+						icon: 'none'
+					});
+				}
 			},
 			evaluate(item){
 				// console.log('logistics',item);
@@ -566,7 +582,36 @@
 					})
 				})
 				// #endif
-			}
+			},
+			confirmPayTeam() {
+				if(!this.selectedTeamId) {
+					uni.showToast({
+						title: '请选择支付团队',
+						icon: 'none'
+					});
+					return;
+				}
+				this.showPayTeamModal = false;
+				this.goToPayPage(this.selectedOrderId, this.selectedTeamId, this.dataList.find(item => item.id === this.selectedOrderId)?.orderPrice);
+			},
+			cancelPayTeam() {
+				this.showPayTeamModal = false;
+				this.selectedTeamId = '';
+				this.selectedOrderId = '';
+			},
+			onPickerConfirm(e) {
+				const selectedTeam = e.value[0];
+				this.selectedTeamId = selectedTeam.bindTeamId;
+				this.showPayTeamModal = false;
+				this.goToPayPage(this.selectedOrderId, this.selectedTeamId, this.dataList.find(item => item.id === this.selectedOrderId)?.orderPrice);
+			},
+			goToPayPage(orderId, payerId, payAmount) {
+				uni.$u.route('/center/pay', {
+					orderId: orderId,
+					payAmount: payAmount,
+					payerId: payerId
+				});
+			},
 		}
 	}
 </script>
@@ -670,4 +715,19 @@ page{
 	&.status-6{.status{color:#FF3C3F;}}
 	&.status-7{.status{color:#FFB100;}}
 }
+.pay-team-content {
+	padding: 20rpx;
+	
+	.radio-item {
+		display: flex;
+		align-items: center;
+		padding: 20rpx 0;
+		
+		.radio-text {
+			margin-left: 20rpx;
+			font-size: 28rpx;
+			color: #363636;
+		}
+	}
+}
 </style>

+ 82 - 36
center/orderdetails.vue

@@ -112,6 +112,14 @@
 						<text class="copy-btn" @click="copyOrderNum(orderDetails[item.key])" v-if="item.key=='id'">复制</text>
 					</text>
 				</view>
+				<view class="order-info-item" v-if="orderDetails.payWay!=='银联支付'">
+					<text class="til">是否他人代付</text>
+					<text class="con">{{orderDetails.ifRepay?'是':'否'}}</text>
+				</view>
+				<view class="order-info-item" v-if="orderDetails.ifRepay">
+					<text class="til">代付者名称</text>
+					<text class="con">{{orderDetails.repayName}}</text>
+				</view>
 			</view>
 			<view class="box order-info refundInfo" v-if="orderDetails.status==4||orderDetails.status==5||orderDetails.status==6">
 				<view class="title u-flex u-row-between">
@@ -159,7 +167,6 @@
 			<view class="singleQR-wrap">
 				<view class="title">
 					详情
-					<!-- <u-icon class="close" @click="closeSingleQR" name="close" color="#333" size="36rpx"></u-icon> -->
 				</view>
 				<view class="single-info">
 					<view class="item">姓名:{{singleInfo.name}}</view>
@@ -169,9 +176,6 @@
 				</view>
 				<template v-if="orderDetails.supportQrcode">
 					<view class="qrcode-tip">本票种需凭「取票码」至前台换票入场</view>
-					<!-- <view class="singleQrcode">
-						<uv-qrcode ref="singleQrcode" size="180px" :options="singleQrOptions" :value="singleQrContent" ></uv-qrcode>
-					</view> -->
 				</template>
 				<template v-else-if="orderDetails.supportIdcard && !orderDetails.supportQrcode">
 					<view class="qrcode-tip">本票种需凭「取票码」至前台换票入场,或凭「身份证原件」入场</view>
@@ -179,9 +183,16 @@
 				<template v-else>
 					<view class="qrcode-tip">本票种需凭「取票码」至前台换票入场</view>
 				</template>
-				<!-- <view class="order-num" :class="{'del-line':singleInfo.qrcodeStatus!==0}">取票码:{{singleInfo.qrcodeNo}}</view> -->
 			</view>
 		</u-popup>
+		<u-picker
+			:show="showPayTeamModal"
+			:columns="[bindList]"
+			keyName="bindTeamName"
+			@confirm="onPickerConfirm"
+			@cancel="cancelPayTeam"
+			title="请选择支付团队"
+		></u-picker>
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
@@ -242,7 +253,9 @@
 				templateIdList:[],//微信小程序订阅消息
 				refundInfo:{status:null},//退款信息
 				isExpanded: false,//展开更多观影人
-				
+				showPayTeamModal: false, // 支付团队选择模态框显示状态
+				selectedTeamId: '', // 选中的团队ID
+				bindList: [], // 绑定的团队列表
 			}
 		},
 		onShow() {
@@ -369,7 +382,6 @@
 				
 				// this.singleQrContent = {};
 				// this.singleQrContent.qrcode = item.qrcodeNo;
-				// this.singleQrContent.time = Date.now();
 				// this.singleQrContent = JSON.stringify(this.singleQrContent);
 				
 				this.singleQrContent = item.qrcodeNo
@@ -524,34 +536,25 @@
 					}  
 				})  
 			},
-			gotoPay(item){
+			async gotoPay(item){
 				console.log('pay',item);
-				uni.$u.route('/center/pay', {
-					orderId: item.id,
-					// openid: that.vuex_wechatOpenid,
-					payAmount:item.orderPrice
-				});
-				return
-				this.$u.api.gotoPay({orderId:orderId,openid:''}).then(res=>{
-					this.payResult = res.data.payInfo;
-					this.payResult.package = res.data.payInfo.packageValue;
-					// #ifdef H5
-					this.initConfig(this.payResult)
-					// #endif 
-					// #ifdef MP
-					this.wxPay()
-					// #endif 
-					// if(this.params.paymentMode==1||this.params.paymentMode==4){
-					// 	this.wxPay()
-					// }else{
-					// 	uni.$u.route('/shopping/paysuccess');
-					// }
-					console.log('gotoPayres',res.data);
-				}).catch(err=>{
-					this.paypass = '';
-					this.checkPassShow = false;
-					console.log('gotoPay',err);
-				})				
+				let bindListData = await this.$u.api.getBindList();
+				let bindList = bindListData.data?.list;
+				this.bindList = bindList;
+				
+				// 如果bindList长度大于1,显示模态框让客户选择支付团队
+				if(bindList.length>1){
+					this.showPayTeamModal = true;
+					this.selectedTeamId = bindList[0].bindTeamId; // 默认选中第一个团队
+				} else if(bindList.length === 1) {
+					// 如果只有一个团队,直接使用该团队进行支付
+					this.goToPayPage(item.id, bindList[0].bindTeamId, item.orderPrice);
+				} else {
+					uni.showToast({
+						title: '没有可用的支付团队',
+						icon: 'none'
+					});
+				}
 			},
 			wxPay(){
 				let that = this;
@@ -680,8 +683,42 @@
 						id: this.orderDetails.id
 					});
 				}
-			}
-
+			},
+			confirmPayTeam() {
+				if(!this.selectedTeamId) {
+					uni.showToast({
+						title: '请选择支付团队',
+						icon: 'none'
+					});
+					return;
+				}
+				this.showPayTeamModal = false;
+				this.goToPayPage(this.orderDetails.id, this.selectedTeamId, this.orderDetails.orderPrice);
+			},
+			cancelPayTeam() {
+				this.showPayTeamModal = false;
+				this.selectedTeamId = '';
+			},
+			onPickerConfirm(e) {
+				const selectedTeam = e.value[0];
+				this.selectedTeamId = selectedTeam.bindTeamId;
+				this.showPayTeamModal = false;
+				this.goToPayPage(this.orderDetails.id, this.selectedTeamId, this.orderDetails.orderPrice);
+			},
+			goToPayPage(orderId, payerId, payAmount) {
+				uni.$u.route('/center/pay', {
+					orderId: orderId,
+					payAmount: payAmount,
+					payerId: payerId
+				});
+				
+				// #ifdef H5
+				// this.gotoPay(orderId);
+				// #endif
+				// #ifdef MP
+				// this.setTemplate(orderId);
+				// #endif
+			},
 		}
 	}
 </script>
@@ -951,4 +988,13 @@
 	font-weight: 400;
 	color: #7F7F7F;
 }
+.pay-team-content {
+	padding: 20rpx;
+}
+.radio-item {
+	margin-bottom: 10rpx;
+}
+.radio-text {
+	margin-left: 10rpx;
+}
 </style>

+ 6 - 4
center/pay.vue

@@ -100,6 +100,7 @@
 				},
 				cansubmit:true,
 				needPayQuery:0,
+				payerId:'',
 			}
 		},
 		onShow(page) {	
@@ -125,6 +126,7 @@
 			this.params.payAmount = page.payAmount;
 			this.params.paymentMode = page.paymentMode;
 			this.needPayQuery = page.needPayQuery;
+			this.payerId = page.payerId;
 			if(page.needPayQuery){
 				this.cansubmit = false;
 				this.payQuery();
@@ -145,7 +147,7 @@
 				});
 			},
 			getBalanceInfo(){
-				this.$u.api.balanceInfo({id:this.vuex_user_info.userid}).then(res=>{
+				this.$u.api.balanceInfo({id:this.vuex_user_info.userid,payerId:this.payerId}).then(res=>{
 					this.balanceInfo= res.data;
 				}).catch(err=>{
 					console.log('balanceInfo',err.data);
@@ -211,7 +213,7 @@
 				})
 			},
 			gotoPay() {
-				this.$u.api.gotoPay(this.params).then(res => {
+				this.$u.api.gotoPay({...this.params,payerId:this.payerId}).then(res => {
 					// this.payResult = res.data.payInfo;
 					// this.payResult.package = res.data.payInfo.packageValue;
 					
@@ -253,7 +255,7 @@
 			},
 			gotoBalancePay(){
 				let that = this;
-				this.$u.api.balancePay({orderId:this.params.orderId}).then(res=>{
+				this.$u.api.balancePay({orderId:this.params.orderId,payerId:this.payerId}).then(res=>{
 					// console.log('res',res);
 					uni.showToast({
 						title:res.msg,
@@ -270,7 +272,7 @@
 			},
 			gotoQuotaPay(){
 				let that = this;
-				this.$u.api.quotaPay({orderId:this.params.orderId}).then(res=>{
+				this.$u.api.quotaPay({orderId:this.params.orderId,payerId:this.payerId}).then(res=>{
 					// console.log('res',res);
 					uni.showToast({
 						title:res.msg,

+ 5 - 0
common/apiurl.js

@@ -137,6 +137,11 @@ const apiurl = {
 		url: '/order/orderInfo/gotoPay',
 		type: 'post'
 	},
+	// 查询绑定团队
+	getBindList: {
+		url: '/member/marketTeam/getBindList',
+		type: 'get'
+	},
 	// 支付查询
 	payQuery: {
 		url: '/order/orderInfo/payQuery',