Sfoglia il codice sorgente

feat:明日预约页面使用亲情卡支付预约费用

zhanghui 2 anni fa
parent
commit
b8bafbad62
3 ha cambiato i file con 75 aggiunte e 59 eliminazioni
  1. 52 39
      components/pay/pay.vue
  2. 5 5
      orderPages/bookService/index.vue
  3. 18 15
      orderPages/storeService/index.vue

+ 52 - 39
components/pay/pay.vue

@@ -7,35 +7,36 @@
 					<text class="payType">请选择支付方式</text>
 					<image class="x" src="/static/common/ox.png" @click="closePayPopup"></image>
 				</view>
-				<view class="payTitle">
-					<text>选择微信支付或余额支付</text>
-				</view>
+<!--				<view class="payTitle">-->
+<!--					<text>选择微信支付或余额支付</text>-->
+<!--				</view>-->
 
 				<view class=" payItemView">
 
-<!--					<view v-if="lovePay && loveCard.totalBalance" class="payItem  flex-row justify-between" @click="payItem(0)">-->
-<!--						<view class="flex-row">-->
-<!--							<u-icon name="/static/me/familyCard_icon.png" color="#38db38" size="36"></u-icon>-->
-<!--							<view class="payName flex-col justify-center">-->
-<!--								<text>亲情卡支付</text>-->
-<!--&lt;!&ndash;								<text class="balance">{{loveCard.presentUserName + loveCard.presentUserNo}}赠送的亲情卡</text>&ndash;&gt;-->
-<!--&lt;!&ndash;								<text class="balance">余额{{loveCard.totalBalance}}</text>&ndash;&gt;-->
-<!--								<view class="select">-->
-<!--									<uni-data-select class="uni-data-select"  :clear="false" v-model="loveCardId" :localdata="loveCardList" @change="change"></uni-data-select>-->
-<!--								</view>-->
-<!--							</view>-->
-<!--						</view>-->
-<!--						<view class="flex-col justify-center">-->
-<!--							<u-icon v-if="curServiceTab === 0" name="checkmark-circle-fill" color="#38db38"-->
-<!--									size="25"></u-icon>-->
-<!--							<u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>-->
-<!--						</view>-->
-<!--					</view>-->
+					<view v-if="lovePay && loveCardList.length>0" class="payItem flex-row" >
+							<u-icon name="/static/me/familyCard_icon.png" color="#38db38" size="36"></u-icon>
+							<view class="payName flex-col justify-center  flex-grow">
+								<text>亲情卡支付</text>
+								<scroll-view scroll-y class="loveCard">
+									<view class="flex-row justify-between loveCardItem " v-for="(item,index) in loveCardList" :key="index" @click="payLoveItem(0,index,item)">
+										<view class="select flex-col" >
+											<text>{{item.presentUserName}}({{item.presentUserNo}})</text>
+											<text class="balance">可用余额:{{item.totalBalance}}</text>
+										</view>
+										<view class="flex-col justify-center">
+											<u-icon v-if="curServiceTab === 0 && item.select" name="checkmark-circle-fill" color="#38db38" size="25"></u-icon>
+											<u-icon v-else name="/static/order/ud9.png" color="green" size="25"></u-icon>
+										</view>
+									</view>
+								</scroll-view>
+
+							</view>
+					</view>
 
 					<view v-if="blPay" class="payItem  flex-row justify-between" @click="payItem(1)">
 						<view class="flex-row">
 							<u-icon name="/static/me/u701.png" color="#38db38" size="36"></u-icon>
-							<view class="payName flex-col justify-center">
+							<view class="payName flex-col justify-center ">
 								<text>余额支付</text>
 								<text class="balance">可用余额{{balance}}</text>
 							</view>
@@ -169,7 +170,7 @@
 			};
 		},
 		created(){
-			// this.getMyReceiveList()
+			this.getMyReceiveList()
 		},
 		methods: {
 
@@ -186,12 +187,23 @@
 				this.password = ''
 				this.$refs.popup.open()
 			},
+
+			payLoveItem(num,index,loveCard){
+				console.log(loveCard.totalBalance*1, this.totalAmount*1)
+				if (loveCard.totalBalance*1 < this.totalAmount*1 && num == 0){
+					console.log(this.totalAmount)
+					uni.$u.toast('余额不足')
+					return
+				}
+				this.curServiceTab = num
+				this.loveCardList.forEach(item=>{
+					item.select = false
+				})
+				loveCard.select=true
+				this.loveCardId = loveCard.id
+				this.$set(this.loveCardList,index,loveCard)
+			},
 			payItem(num) {
-				// if (this.loveCard.totalBalance*1 < this.totalAmount*1 && num == 0){
-				// 	console.log(this.totalAmount)
-				// 	uni.$u.toast('余额不足')
-				// 	return
-				// }
 				if (!this.selectBlPay) {
 					uni.$u.toast('余额不足')
 					return
@@ -255,10 +267,12 @@
 				});
 			},
 
+
 			familyCardPay(){
+				//亲情卡支付预约费用
 				this.$api.familyCardPay({
 					orderNo: this.orderNo,
-					loveCardId: this.loveCard.id
+					loveCardId: this.loveCardId
 				}).then(res=>{
 					this.$emit('payResult',{
 						payResult:true,
@@ -343,16 +357,7 @@
 			//查询我的亲情卡
 			getMyReceiveList(){
 				this.$api.getMyReceiveList().then(res=>{
-					if (this.loveCardList){
-						this.loveCardId = res.data.data[0].id
-						res.data.data.forEach(item=>{
-							let tempItem = {
-								value:item.id,
-								text:item.presentUserName + item.presentUserNo + '亲情卡,余额:'+item.totalBalance
-							}
-							this.loveCardList.push(tempItem)
-						})
-					}
+					this.loveCardList = res.data.data
 				})
 			}
 		}
@@ -452,4 +457,12 @@
 		width: 400rpx;
 	}
 
+	.loveCard{
+		flex-grow: 1;
+		max-height: 300rpx;
+	}
+	.loveCardItem{
+		margin-top: 15rpx;
+		background: #FFFFFF;
+	}
 </style>

+ 5 - 5
orderPages/bookService/index.vue

@@ -631,17 +631,17 @@
 						return;
 					}
 					this.requestStatus = true
-          uni.showLoading({
-            title: '加载中'
-          });
+					  uni.showLoading({
+						title: '加载中'
+					  });
 					this.$api.commonGeneralOrder(this.orderParam).then(res => {
 						console.log('++++++++++++++++++订单提交+++++++++++', res)
 						if (res.data.data.subOrderNo) {
-              uni.hideLoading();
+             			 uni.hideLoading();
 							this.subOrderNo = res.data.data.subOrderNo
 							this.$refs.myPay.openPopup()
 						} else {
-              uni.hideLoading();
+             				 uni.hideLoading();
 							uni.$u.toast('预约成功')
 							setTimeout(() => {
 								uni.switchTab({

+ 18 - 15
orderPages/storeService/index.vue

@@ -178,27 +178,30 @@
 				this.$forceUpdate()
 			},
 
-			// 查询服务对信息列表
+			// 查询服务对信息列表
 			listServiceObject() {
 				this.$api.listServiceObject(this.reqParm).then((res) => {
 					console.log(res)
 					this.serviceObjectList = res.data.data
 					this.getImgUrlByBannerOssId(this.serviceObjectList);
-					this.orderParam.childService = [],
-					this.serviceObjectList[0].select = true
-					let periodTimeList = JSON.parse(JSON.stringify(this.periodTimeList))
-					let childService = {
-						periodDate: '',
-						serviceObjectId: this.serviceObjectList[0].id,
-						facePhotoUrl: this.serviceObjectList[0].facePhotoUrl,
-						nickName: this.serviceObjectList[0].nickName,
-						serviceUserId: -1,
-						fee: '',
-						serviceStartTime: periodTimeList[0].label,
-						periodTimeList:periodTimeList
+					if (this.periodTimeList.length >0){
+						this.orderParam.childService = [],
+								this.serviceObjectList[0].select = true
+						let periodTimeList = JSON.parse(JSON.stringify(this.periodTimeList))
+						periodTimeList[0].select = true
+						let childService = {
+							periodDate: '',
+							serviceObjectId: this.serviceObjectList[0].id,
+							facePhotoUrl: this.serviceObjectList[0].facePhotoUrl,
+							nickName: this.serviceObjectList[0].nickName,
+							serviceUserId: -1,
+							fee: '',
+							serviceStartTime: periodTimeList[0].label,
+							periodTimeList:periodTimeList
+						}
+						this.orderParam.childService.push(childService)
 					}
-					periodTimeList[0].select = true
-					this.orderParam.childService.push(childService)
+
 				})
 			},
 			// 获取图片