wkyy 2 лет назад
Родитель
Сommit
0f3304ac07

+ 1 - 1
apis/utils/mixin.js

@@ -92,7 +92,7 @@ var app = {
 		uni.removeStorageSync(prefix + 'personInfoPlus');
 		uni.removeStorageSync(prefix + 'getElderModeClass');
 		//uni.removeStorageSync(prefix+'wx_openId');
-		
+		uni.removeStorageSync(prefix + 'studentId');
 	},
 
 	getToken : (options) => {

+ 10 - 9
components/ParentsTabbar.vue

@@ -30,15 +30,16 @@
 						selectedIconPath: "bookmark-fill",
 						text: '课程',
 						pagePath2: "/pages/parents/course/course",
-					}, {
-						iconPath: "chat",
-						selectedIconPath: "chat-fill",
-						text: '消息',
-						pagePath2: "/pages/parents/messageNotification/messageNotification",
-						count: 99,
-						isDot: false,
-						customIcon: false,
-					},
+					}, 
+					// {
+					// 	iconPath: "chat",
+					// 	selectedIconPath: "chat-fill",
+					// 	text: '消息',
+					// 	pagePath2: "/pages/parents/messageNotification/messageNotification",
+					// 	count: 99,
+					// 	isDot: false,
+					// 	customIcon: false,
+					// },
 					{
 						iconPath: "account",
 						selectedIconPath: "account-fill",

+ 7 - 1
pages.json

@@ -536,5 +536,11 @@
 		"navigationBarTitleText": "加载中...",
 		"enablePullDownRefresh": false
 	},
-	"uniIdRouter": {}
+	"uniIdRouter": {},
+	"tabBar": {
+	    "list": [{
+	      "pagePath": "pages/parents/homePage/homePage",
+	      "text": "首页"
+	    }]
+	  }
 }

+ 351 - 134
pages/parents/course/confirmOrder.vue

@@ -1,6 +1,6 @@
 <template>
 	<view>
-		<u-navbar title="确认订单"></u-navbar>
+		<u-navbar title="课程报名"></u-navbar>
 		<!-- 课程信息 -->
 		<view class="class-infos">
 			<view class="picture">
@@ -8,71 +8,40 @@
 			</view>
 			<view class="infos">
 				<view class="title">
-					夏奕琳中国舞初级一班
+					{{classDetail.className}}
 				</view>
-				<view class="else">
+				<!-- <view class="else">
 					<text>春季班</text>
 					<text>36课时</text>
 					<text>x1</text>
-				</view>
-			</view>
-			
-		</view>
-		<!-- 金额 -->
-		<view class="amount">
-			<view class="amount-payable">
-				<view class="title">
-					应付金额
-				</view>
-				<view class="value">
-					720.00元
-				</view>
-			</view>
-			<view class="discount-amount">
-				<view class="title">
-					优惠金额
-				</view>
-				<view class="value">
-					0.00元
-				</view>
+				</view> -->
 			</view>
-			<view class="amount-paid">
-				<view class="title">
-					实付金额
-				</view>
-				<view class="value">
-					720.00元
-				</view>
-			</view>
-			
 		</view>
+
 		<!-- 班级信息 -->
-		<view class="infos">
+		<view class="infos" style="margin-top: 24rpx;">
 			<view class="item">
 				<view class="title">
 					<text class="asterisk">*</text>
 					<text>报名班级</text>
 				</view>
-				
-				<view class="value">
-					<text>足球体适能班</text>
+				<view class="value" @click="classSelect">
+					<text>{{className}}</text>
 					<text class="icon"><u-icon name="arrow-right" color="#c8c8c8"></u-icon></text>
 				</view>
-				
 			</view>
+			
 			<view class="item">
 				<view class="title">
 					<text class="asterisk">*</text>
-					<text>授课老师</text>
+					<text>选择套餐</text>
 				</view>
-				
-				<view class="value">
-					<text>瞿明祥</text>
+				<view class="value" @click="packageSelect">
+					<text class="placeholder" v-if="!packageName">请选择套餐</text>
+					<text v-else>{{packageName}}</text>
 					<text class="icon"><u-icon name="arrow-right" color="#c8c8c8"></u-icon></text>
 				</view>
-				
 			</view>
-			
 		</view>
 		<!-- 学员信息 -->
 		<view class="infos">
@@ -81,123 +50,350 @@
 					<text class="asterisk">*</text>
 					<text>学员姓名</text>
 				</view>
-				
 				<view class="value">
-					<text class="add">请先添加子女信息</text>
+					<text class="add" v-if="!studentId" @click="toAddChildInformation">请先添加子女信息</text>
+					<text v-else @click="studentSelect">{{stuDetail.studentName}}</text>
 					<text class="icon"><u-icon name="arrow-right" color="#c8c8c8"></u-icon></text>
 				</view>
-				
 			</view>
+
+			<u-select v-model="show" mode="single-column" :list="list" @confirm="confirm"></u-select>
+
 			<view class="item">
 				<view class="title">
 					<text>年龄</text>
 				</view>
-				
 				<view class="value">
-					<text class="placeholder">选择学员后自动显示</text>
-					
+					<text class="placeholder" v-if="!studentId">选择学员后自动显示</text>
+					<text v-else>{{stuDetail.age}}</text>
 				</view>
-				
 			</view>
 			<view class="item">
 				<view class="title">
 					<text class="asterisk">*</text>
 					<text>联系人手机号</text>
 				</view>
-				
 				<view class="value">
-					<text >15500001111</text>
-					
+					<text>{{stuDetail.firstContactPhone}}</text>
 				</view>
-				
 			</view>
-			
-		</view>
-		<!-- 家长信息 -->
-		<view class="infos">
+
 			<view class="item">
 				<view class="title">
 					<text>第二联系人手机号</text>
 				</view>
-				
 				<view class="value">
-					<text class="placeholder">
+					<text>
 						<input type="text" placeholder="请填写手机号">
 					</text>
-					
 				</view>
-				
 			</view>
+
 			<view class="item">
 				<view class="title">
-		
 					<text>接送家长姓名</text>
 				</view>
-				
 				<view class="value">
-					<text class="placeholder">
+					<text>
 						<input type="text" placeholder="请填写家长姓名">
 					</text>
-					
 				</view>
-				
 			</view>
+		</view>
+		<!-- 家长信息 -->
+		<!-- <view class="infos">
 			
+
+		</view> -->
+		
+		<!-- 金额 -->
+		<view class="amount" style="margin-top: 12px;">
+			<view class="amount-payable">
+				<view class="title">
+					应付金额
+				</view>
+				<view class="value" v-if="packageId == '1'">
+					1200.00元
+				</view>
+				<view class="value" v-if="packageId == '2'">
+					4600.00元
+				</view>
+			</view>
+			<view class="discount-amount">
+				<view class="title">
+					优惠金额
+				</view>
+				<view class="value" v-if="packageId == '1'">
+					0.00元
+				</view>
+				<view class="value" v-if="packageId == '2'">
+					0.00元
+				</view>
+			</view>
+			<view class="amount-paid">
+				<view class="title">
+					实付金额
+				</view>
+				<view class="value" v-if="packageId == '1'">
+					1200.00元
+				</view>
+				<view class="value" v-if="packageId == '2'">
+					4600.00元
+				</view>
+			</view>
+		
 		</view>
-	
-	<!-- 确认订单 -->
-	<view class="confirm">
-			   <view class="money">
-			   	 <view class="title">实付金额</view>
-				 <view class="value">720.00元</view>
-			   </view>
-			   <view class="pay">
-			   	<button>去支付</button>
-			   </view>
-	</view>
-	
+		
+		<view class="amount">
+			<view class="amount-paid">
+				<view class="title">
+					老师信息
+				</view>
+				<view class="value">
+					{{classDetail.teacherName}}
+				</view>
+			</view>
+			<view class="amount-paid">
+				<view class="title">
+					教室
+				</view>
+				<view class="value">
+					三楼{{className}}
+				</view>
+			</view>
+			<view class="amount-paid">
+				<view class="title">
+					上课时间
+				</view>
+				<view class="value" v-if="classId == '1'">
+					周一 周三 周五
+				</view>
+				<view class="value" v-if="classId == '2'">
+					周二 周四 周六
+				</view>
+			</view>
+			<view class="amount-paid">
+				<view class="title">
+					联系电话
+				</view>
+				<view class="value" v-if="classDetail.consultPhone != null">
+					{{classDetail.consultPhone.slice(0,11)}}
+				</view>
+			</view>
+		</view>
+
+		<!-- 确认订单 -->
+		<view class="confirm">
+			<view class="money">
+				<view class="title">实付金额</view>
+				<view class="value" v-if="packageId == '1'">1200.00元</view>
+				<view class="value" v-if="packageId == '2'">4600.00元</view>
+			</view>
+			<view class="pay">
+				<button @click="topayResult">去支付</button>
+			</view>
+		</view>
+
 	</view>
 </template>
 
 <script>
+	import * as mineApi from '@/apis/parents/mine.js'
+	import * as homePageApi from '@/apis/parents/homePage.js'
+
 	export default {
 		data() {
 			return {
-				
+				studentId: '',
+				stuDetail: {},
+				show: false,
+				list: [],
+				studentList: [],
+				classList: [
+					{
+						value: '1',
+						label: ''
+					},
+					{
+						value: '2',
+						label: ''
+					}
+				],
+				packageList: [
+					{
+						value: '1',
+						label: '暑期班 24课时'
+					},
+					{
+						value: '2',
+						label: '全年 92课时'
+					}
+				],
+				selectNum: '',
+				packageId: '',
+				packageName: '',
+				classId: '1',
+				className: '',
+				classDetail: {},
+				id: ''
 			}
 		},
+		onLoad(op) {
+			if(op.id) {
+				this.id = op.id;
+				this.getReCoursesList();
+			}
+		},
+		onReady() {
+			if (this.carhelp.getStudentId()) {
+				this.studentId = this.carhelp.getStudentId().studentId;
+				this.getStudentDetail();
+			}
+			this.getStudentList();
+		},
 		methods: {
-			
+			topayResult() {
+				uni.navigateTo({
+					url: '/pages/parents/course/payResult'
+				})
+			},
+			getReCoursesList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				homePageApi.loadCoursesForHomeShow({
+					tag: '',
+					pageNum: 1,
+					pageSize: 10000
+				}).then((res) => {
+					uni.hideLoading();
+					var list = res.data.data;
+					for (var i = 0; i < list.length; i++) {
+						if(list[i].class_id == this.id) {
+							this.classDetail = list[i];
+						}
+					}
+					this.classList[0].label = this.classDetail.className + '一班';
+					this.classList[1].label = this.classDetail.className + '二班';
+					this.className = this.classList[0].label;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			classSelect() {
+				this.selectNum = 'class';
+				this.list = this.classList;
+				this.show = true;
+			},
+			packageSelect() {
+				this.selectNum = 'package';
+				this.list = this.packageList;
+				this.show = true;
+			},
+			studentSelect() {
+				this.selectNum = 'student';
+				this.list = this.studentList;
+				this.show = true;
+			},
+			confirm(e) {
+				if(this.selectNum == 'class') {
+					this.classId = e[0].value;
+					this.className = e[0].label;
+				} else if(this.selectNum == 'package') {
+					this.packageId = e[0].value;
+					this.packageName = e[0].label;
+				} else if(this.selectNum == 'student') {
+					this.studentId = e[0].value;
+					this.getStudentDetail();
+				} else {
+					
+				}
+			},
+			getStudentList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				mineApi.studentList().then((res) => {
+					uni.hideLoading();
+					var list1 = res.data.studentList;
+					var list2 = [];
+					for (var i = 0; i < list1.length; i++) {
+						list2.push({
+							value: list1[i].studentId,
+							label: list1[i].studentName
+						})
+					}
+					this.studentList = list2;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			toAddChildInformation() {
+				uni.navigateTo({
+					url: '/pages/parents/mine/addChildInformation'
+				})
+			},
+			getStudentDetail() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				mineApi.getStudentDtl({
+					studentId: this.studentId
+				}).then((response) => {
+					uni.hideLoading();
+					this.stuDetail = response.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
 	// 课程信息
-	.class-infos{
+	.class-infos {
 		padding: 24rpx 32rpx;
 		background-color: #fff;
 		display: flex;
-		.picture{
+
+		.picture {
 			width: 160rpx;
 			height: 160rpx;
 			border-radius: 8rpx;
 			overflow: hidden;
-			img{
+
+			img {
 				width: 100%;
 				height: 100%;
 			}
 		}
-		.infos{
+
+		.infos {
 			margin-left: 16rpx;
-			.title{
+
+			.title {
 				color: rgba(51, 51, 51, 1);
 				font-size: 36rpx;
 				font-weight: bold;
 			}
-			.else{
+
+			.else {
 				margin-top: 8rpx;
-				text{
+
+				text {
 					margin-right: 8rpx;
 					color: #8c8c8c;
 					font-size: 12px;
@@ -206,78 +402,95 @@
 		}
 	}
 
-// 金额
-.amount{
-	background-color: #fff;
-	padding: 20rpx 32rpx ;
-	border-top: 1px solid rgba(244, 244, 244, 1);
-	.title{
-		color: #777777;
-	}
-	.amount-payable,.discount-amount,.amount-paid{
-		display: flex;
-		justify-content: space-between;
-		margin-bottom: 16rpx;
-		.value{
-			color: rgba(119, 119, 119, 1);
+	// 金额
+	.amount {
+		background-color: #fff;
+		padding: 20rpx 32rpx;
+		border-top: 1px solid rgba(244, 244, 244, 1);
+
+		.title {
+			color: #777777;
 		}
-	}
-	.discount-amount{
-		.value{
-			color: #E60012;
+
+		.amount-payable,
+		.discount-amount,
+		.amount-paid {
+			display: flex;
+			justify-content: space-between;
+			margin-bottom: 16rpx;
+
+			.value {
+				color: rgba(119, 119, 119, 1);
+			}
 		}
-	}
-	.amount-paid{
-		margin-bottom: 0;
-		.value{
-			color:#101010
+
+		.discount-amount {
+			.value {
+				color: #E60012;
+			}
+		}
+
+		.amount-paid {
+			margin-bottom: 0;
+
+			.value {
+				color: #101010
+			}
 		}
 	}
-}
 
 
-.infos{
+	.infos {
 		padding: 0px 30rpx;
 		background-color: #fff;
-		margin-top: 24rpx;
-		.item{
+		// margin-top: 24rpx;
+
+		.item {
 			display: flex;
 			justify-content: space-between;
 			border-bottom: 1px solid rgba(244, 244, 244, 1);
 			padding: 24rpx 0;
-			.title{
+
+			.title {
 				color: #333333;
 				font-weight: bold;
-				.asterisk{
+
+				.asterisk {
 					color: rgba(244, 68, 68, 1);
 				}
 			}
-			.value{
+
+			.value {
 				color: rgba(51, 51, 51, 1);
 				font-weight: bold;
-				.icon{
+
+				.icon {
 					margin-left: 8rpx;
 				}
-				.add{
+
+				.add {
 					color: #FF3D00;
 				}
-				.placeholder{
-					color: #CCCCCC ;
+
+				.placeholder {
+					color: #CCCCCC;
 				}
 			}
 		}
 	}
-	
-	/deep/uni-input{
+
+	/deep/uni-input {
 		width: 300rpx;
 		text-align: right !important;
-		
+
 	}
-	/deep/.uni-input-placeholder{
+
+	/deep/.uni-input-placeholder {
 		color: #cccccc !important;
 	}
+
 	// 确认订单
-	.confirm{
+	.confirm {
 		background-color: #fff;
 		display: flex;
 		justify-content: space-between;
@@ -286,21 +499,25 @@
 		left: 0;
 		right: 0;
 		padding: 40rpx 32rpx;
-		.money{
+
+		.money {
 			display: flex;
 			font-size: 18px;
 			align-items: center;
 			font-weight: bold;
-			.title{
+
+			.title {
 				color: #101010;
 			}
-			.value{
+
+			.value {
 				color: #0DBAC7;
 				margin-left: 8rpx;
-				
+
 			}
 		}
-		uni-button{
+
+		uni-button {
 			width: 256rpx;
 			height: 80rpx;
 			border-radius: 50px;
@@ -309,4 +526,4 @@
 			font-size: 16px;
 		}
 	}
-</style>
+</style>

+ 24 - 13
pages/parents/course/courseDetails.vue

@@ -1,18 +1,18 @@
 <template>
 	<view>
 		<u-navbar></u-navbar>
-		<!-- <view class="picture">
-			<view class="icon">
+		<view class="picture">
+			<!-- <view class="icon" @click="backHomePage">
 				<u-icon name="arrow-left" color="#ffffff"></u-icon>
+			</view> -->
+			<view class="wrap">
+				<u-swiper :list="list" mode="number" indicator-pos="bottomRight" :autoplay="false"
+					height="550"></u-swiper>
 			</view>
-			<img src="../../../assets/img/courseD.png" alt="">
+			<!-- <img src="../../../assets/img/courseD.png" alt="">
 			<view class="tag">
 				1/5
-			</view>
-		</view> -->
-		<view class="picture">
-			<u-swiper :list="list" mode="number" indicator-pos="bottomRight" :autoplay="false"
-				height="560"></u-swiper>
+			</view> -->
 		</view>
 		<view class="space">
 
@@ -164,9 +164,7 @@
 		</view>
 
 		<view class="bottom">
-			<button>仅剩9席 立即报名
-
-			</button>
+			<button @click="gotoUrl('pages/parents/course/confirmOrder')">仅剩9席 立即报名</button>
 		</view>
 	</view>
 </template>
@@ -178,11 +176,22 @@
 				list: [{
 						image: 'https://cdn.uviewui.com/uview/swiper/1.jpg'
 					}
-				]
+				],
+				background: {
+					backgroundColor: 'none',
+					// 导航栏背景图
+					// background: 'url(https://cdn.uviewui.com/uview/swiper/1.jpg) no-repeat',
+					// 还可以设置背景图size属性
+					// backgroundSize: 'cover',
+					// 渐变色
+					// backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
+				}
 			}
 		},
 		methods: {
-
+			backHomePage() {
+				uni.navigateBack()
+			}
 		}
 	}
 </script>
@@ -201,6 +210,8 @@
 			position: absolute;
 			left: 10px;
 			top: 10px;
+			z-index: 1;
+			font-size: 20px;
 		}
 
 		.tag {

+ 12 - 3
pages/parents/course/payResult.vue

@@ -7,8 +7,8 @@
 				支付成功
 			</view>
 			<view class="btn">
-				<button class="back">返回主页</button>
-				<button class="view">查看缴费记录</button>
+				<button class="back" @click="toHome">返回主页</button>
+				<button class="view" @click="toPaymentRecord">查看缴费记录</button>
 			</view>
 		</view>
 		
@@ -23,7 +23,16 @@
 			}
 		},
 		methods: {
-			
+			toHome() {
+				uni.switchTab({
+					url: '/pages/parents/homePage/homePage'
+				});
+			},
+			toPaymentRecord() {
+				uni.navigateTo({
+					url: '/pages/parents/course/paymentRecords'
+				})
+			},
 		}
 	}
 </script>

+ 27 - 14
pages/parents/homePage/homePage.vue

@@ -169,7 +169,7 @@
 			</view>
 
 			<view class="infos-box" v-for="(item,index) in reCoursesList" :key="index"
-				@click="gotoUrl('pages/parents/course/courseDetails')">
+				@click="gotoUrl('pages/parents/course/confirmOrder?id='+item.class_id)">
 				<view class="picture" v-if="item.posterUrl != null">
 					<img :src="item.posterUrl" alt="">
 				</view>
@@ -191,16 +191,19 @@
 					<view class="teacher-price">
 						<view class="teacher">
 							<view class="photo">
-								<img src="../../../assets/img/teacher.png" alt="">
+								<u-avatar class="avatar"
+									:src="item.headPhoto != null ? item.headPhoto : '../../assets/img/head.png'" size="64">
+								</u-avatar>
+								<!-- <img src="../../../assets/img/teacher.png" alt=""> -->
 							</view>
-							<view class="name">
+							<view class="name-teacher">
 								{{item.teacherName}}
 							</view>
-							<view class="img">
+							<!-- <view class="img">
 								<img src="../../../assets/img/riLine-smartphone-line@1x.png" alt="">
-							</view>
-							<view>
-								{{item.consultPhone}}
+							</view> -->
+							<view class="phone-teacher" v-if="item.consultPhone != null">
+								{{item.consultPhone.slice(0,11)}}
 							</view>
 						</view>
 						<!-- <view class="price">
@@ -761,6 +764,16 @@
 					color: rgba(51, 51, 51, 1);
 					font-size: 16px;
 				}
+				
+				.name-teacher {
+					color: rgba(51, 51, 51, 1);
+					font-size: 16px;
+					width: 55%;
+				}
+				
+				.phone-teacher {
+					margin-right: 8px;
+				}
 
 				.tips {
 					display: flex;
@@ -779,19 +792,19 @@
 
 				.teacher-price {
 					margin-top: 44rpx;
-					display: flex;
-					justify-content: space-between;
-					align-items: center;
+					// display: flex;
+					// justify-content: space-between;
+					// align-items: center;
 
 					.teacher {
 						display: flex;
 						align-items: center;
 
 						.photo {
-							width: 32px;
-							height: 32px;
-							border-radius: 50px;
-							overflow: hidden;
+							// width: 32px;
+							// height: 32px;
+							// border-radius: 50px;
+							// overflow: hidden;
 							margin-right: 8px;
 
 							img {

+ 1 - 1
pages/parents/mine/mine.vue

@@ -191,7 +191,7 @@
 		</view>
 
 
-		<ParentsTabbar :current="3" ref="tabbarMain"></ParentsTabbar>
+		<ParentsTabbar :current="2" ref="tabbarMain"></ParentsTabbar>
 	</view>
 </template>
 

+ 4 - 4
pages/teacher/homePage/homePage.vue

@@ -205,7 +205,7 @@
 						班级信息
 					</view>
 				</view>
-				<view class="item">
+				<!-- <view class="item">
 					<view class="icon-box"
 						style="background: linear-gradient(180deg, rgba(89,222,232,1) 1%,rgba(13,186,199,1) 100%);">
 						<img src="../../../assets/img/riFill-quill-pen-fill@1x.png" alt="">
@@ -213,8 +213,8 @@
 					<view class="text">
 						学员点评
 					</view>
-				</view>
-				<view class="item">
+				</view> -->
+				<!-- <view class="item">
 					<view class="icon-box"
 						style="background: linear-gradient(180deg, rgba(255,189,96,1) 1%,rgba(255,150,0,1) 100%);">
 						<img src="../../../assets/img/riFill-star-fill@1x.png" alt="">
@@ -222,7 +222,7 @@
 					<view class="text">
 						学员秀
 					</view>
-				</view>
+				</view> -->
 				<!-- <view class="item" @click="gotoUrl('pages/teacher/leaveApproval/leaveApproval')">
 					<view class="icon-box"
 						style="background: linear-gradient(180deg, rgba(91,160,242,1) 1%,rgba(26,118,226,1) 100%);">