Browse Source

会员卡相关

zzp 2 years ago
parent
commit
e17150472f
4 changed files with 112 additions and 6 deletions
  1. 2 0
      config/api.js
  2. 99 4
      pagesMain/couponList.vue
  3. 8 1
      pagesMain/openMember.vue
  4. 3 1
      pagesMember/venueDetail.vue

+ 2 - 0
config/api.js

@@ -81,6 +81,8 @@ module.exports = {
 	getStudentList: API_BASE + '/v2/student/myCenter/selectStudent',
 	//  获取我的优惠券列表
 	getCouponList: API_BASE + '/v2/student/myCenter/getCouponList',
+	//  专用优惠券可使用场馆
+	getCouponExInfo: API_BASE + '/v2/student/myCenter/getCouponExInfo',
 	//  获取分享有礼二维码
 	getShareUrl: API_BASE + '/v2/student/myCenter/share',
 	//  获取二维码信息

+ 99 - 4
pagesMain/couponList.vue

@@ -20,8 +20,15 @@
 					 			<view class="class-info-text">{{site.content}}</view>
 					 			<view class="class-info-text">{{site.endDate}}&nbsp;&nbsp;到期</view>
 					 		</view>
-					 		<view class="card-mask" v-if="index1 == 1"></view>
-					 		<view class="out-date" v-if="index1 == 2">已用</view>
+							<view style="width:40px;">
+								<view class="card-mask" v-if="index1 == 1"></view>
+								<template v-if="index1 == 0">
+									<u-button v-if="site.commonFlag == 2" type="warning" :custom-style="{background: mainColor}" size="mini" shape="circle" :ripple="true"  @click="handleShowClick(site)">查看</u-button>
+									<view class="out-date">{{ site.commonFlag == 1 ? '通用券' : '专用券' }}</view>
+								</template>
+								<view class="out-date" v-if="index1 == 2">已用</view>
+							</view>
+
 					 	</view>
 					 </u-card>
 					 <u-divider v-if="item.isOver" bg-color="transparent">没有更多了</u-divider>
@@ -47,6 +54,24 @@
 				</scroll-view>
 			</swiper-item>
 		</swiper>
+		<!-- 可用场馆 -->
+		<u-popup v-model="couponShow" mode="center" border-radius="30" width="600rpx">
+			<view class="common-title">可用场馆</view>
+			<view class="menber-box" style="overflow-y: auto;min-height: 200px;">
+				<template v-if="Object.keys(venueInfo).length">
+					<view style="font-size: 16px;font-weight: bold;margin-bottom: 5px;">卡种</view>
+					<view style="margin-bottom: 8px;">{{ venueInfo.cardType }}</view>
+					<view style="font-size: 16px;font-weight: bold;margin-bottom: 5px;">场馆</view>
+					<view style="margin-bottom: 8px;">{{ venueInfo.venue }}</view>
+				</template>
+				<template v-else>
+					<u-empty mode="data"></u-empty>
+				</template>
+			</view>
+			<view class="button-box">
+				<u-button type="warning" shape="circle" :ripple="true" :custom-style="customStyle" @click="couponShow = false">确定</u-button>
+			</view>
+		</u-popup>
 		<u-picker mode="selector" v-model="studentShow" :range="studentList" range-key="childName" @confirm="handleStudentClick"></u-picker>
 		<u-top-tips ref="uTips"></u-top-tips>
 	</view>
@@ -102,7 +127,9 @@
 				// 二维码
 				qrcodeUrl: '',
 				// 课时
-				classes: 0
+				classes: 0,
+				couponShow: false,
+				venueInfo: {}
 			}
 		},
 		onLoad() {
@@ -125,6 +152,14 @@
 						}
 					})
 			},
+			//  优惠券可用场馆
+			handleShowClick(site) {
+				NET.request(API.getCouponExInfo, 
+					{id: site.discountCouponId}, 'POST').then( res => {
+						this.venueInfo = res.data
+						this.couponShow = true
+				})
+			},
 			//  选择学生
 			handleStudentClick(args) {
 				this.studentId = this.studentList[args].studentId
@@ -300,7 +335,7 @@
 						}
 
 						.out-date {
-							font-size: 10px;
+							font-size: 14px;
 							color: #ff9900;
 							margin-bottom: 5px;
 							position: absolute;
@@ -335,4 +370,64 @@
 		position: absolute;
 		margin: 0 auto;
 	}
+	.menber-box {
+		width: 100%;
+		// float: left;
+		padding: 10px 15px;
+		// margin-bottom: 10px;
+		
+		.menber-col {
+			width: 100%;
+			padding: 15px;
+			margin-bottom: 10px;
+			display: inline-block;
+			background-color: #FFFFFF;
+			border-radius: 15px;
+			box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
+			position: relative;
+			overflow: hidden;
+			box-sizing: border-box;
+			
+			.menber-label {
+				width: 100%;
+				margin-bottom: 5px;
+				float: left;
+				font-size: 14px;
+				// line-height: 20px;
+			}
+	
+			.menber-num {
+				width: 100%;
+				float: left;
+				font-size: 26px;
+				line-height: 28px;
+				color: $mainColor;
+			}
+	
+			.menber-icon {
+				font-size: 100px;
+				color: $mainColor;
+				position: absolute;
+				right: -5px;
+				bottom: -30px;
+				opacity: 0.5;
+			}
+		}
+	}
+	.common-title {
+		width:100%;
+		text-align: center;
+		font-size: 20px;
+		margin: 10px 0;
+	}
+	.fix-add-icon {
+		position: fixed;
+		bottom: 15px;
+		right: 15px;
+	}
+	.button-box {
+		// width: 100%;
+		padding: 10px 15px;
+		box-sizing: border-box;
+	}
 </style>

+ 8 - 1
pagesMain/openMember.vue

@@ -2,7 +2,8 @@
 	<view class="content">
 		<template v-if="memberCardList.length">
 			<view class="card-list" v-for="(item,index) in memberCardList" :key="index">
-				<view class="card-label" style="height:20rpx;">卡名: {{item.typeValue}}</view>
+				<view class="card-label" style="height:20rpx;">卡名: {{item.cardName}}</view>
+				<view class="card-label" style="height:20rpx;">类型: {{item.typeValue}}</view>
 				<view class="card-label">使用时间: {{ item.startDate }}~{{ item.endDate }}</view>
 				<view class="card-num">¥{{ item.sellingPrice }}</view>
 				<view class="card-icon iconfont iconzu4931"></view>
@@ -275,6 +276,7 @@
 			},
 			//  选择优惠券
 			handleCouponClick() {
+				// 是否选择了学生
 				if(!this.studentId) {
 					this.$refs.uTips.show({
 						title: '请先选择学员~',
@@ -282,6 +284,11 @@
 					})
 					return
 				}
+				//  选择一种卡,显示满减券和赠课券;多种卡,只显示满减券    
+				//   discountType 1和2  满减券  3和4 赠课券
+				if(this.memberCardList.length > 1) {
+					this.couponList = Object.assign([],this.couponList.filter(item => item.discountType < 3))
+				}
 				this.couponShow = true
 			},
 			// 选择优惠券

+ 3 - 1
pagesMember/venueDetail.vue

@@ -15,7 +15,8 @@
 		<u-section title="会员开通" font-size="32" :right="false" :show-line="false" class="title-box"></u-section>
 		<view class="menber-box">
 			<view class="menber-col" v-for="(item, index) in menberList" :key="index" @click.stop="checkBox(item)" :style="{background:item.checked?'#ffd5c7':'#fff'}">
-				<view class="menber-label">卡名: {{ item.typeValue }}</view>
+				<view class="menber-label">卡名: {{ item.cardName }}</view>
+				<view class="menber-label">类型: {{ item.typeValue }}</view>
 				<view class="menber-label">售价: ¥ {{ item.sellingPrice }}</view>
 				<view class="menber-label">使用时间: {{ item.startDate }}~{{ item.endDate }}</view>
 				<!-- <u-button type="warning" shape="circle" :ripple="true" :custom-style="{...handleCustomStyle, float: 'left', marginLeft: ''}" size="mini" @click="goToPay(item)">点击开通</u-button> -->
@@ -216,6 +217,7 @@
 						return {
 							id: item.id,
 							type: item.type,
+							cardName: item.cardName,
 							typeValue: item.typeValue,
 							sellingPrice: item.sellingPrice,
 							startDate: item.startDate,