瀏覽代碼

课程报名

wkyy 2 年之前
父節點
當前提交
bc18f6e893

+ 1 - 0
pages/parents/course/confirmOrder.vue

@@ -212,6 +212,7 @@
 		},
 		onLoad(op) {
 			if(op.id) {
+				console.log(op)
 				this.courseId = op.id;
 				this.getCourseDetail();
 			}

+ 23 - 13
pages/parents/course/course.vue

@@ -18,7 +18,7 @@
 				
 				<view class="details">
 					<view class="infos-box" v-for="(item,index) in reCoursesList" :key="index"
-						@click="gotoUrl('pages/parents/course/confirmOrder?id='+item.course_id)">
+						@click="gotoUrl('pages/parents/course/courseDetails?id='+item.course_id+'&classId='+item.class_id)">
 						<!-- <view class="picture" v-if="item.posterUrl != null">
 							<img :src="item.posterUrl" alt="">
 						</view>
@@ -39,19 +39,19 @@
 							</view>
 							<view class="teacher-price">
 								<view class="teacher">
-									<view class="photo">
+									<!-- <view class="photo">
 										<u-avatar class="avatar"
 											:src="item.headPhoto != null ? item.headPhoto : '../../assets/img/head.png'" size="64">
 										</u-avatar>
+									</view> -->
+									<view class="name-teacher">
+										咨询电话:
 									</view>
-									<view class="name">
-										{{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">
+										{{item.consultPhone != null ? item.consultPhone : '暂无'}}
 									</view>
 								</view>
 								<!-- <view class="price">
@@ -281,14 +281,24 @@
 				
 						.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;
-				
+
+								.name-teacher {
+									color: rgba(51, 51, 51, 1);
+									font-size: 16px;
+									width: 60%;
+								}
+								
+								.phone-teacher {
+									margin-right: 8px;
+								}
+								
 								.photo {
 									// width: 32px;
 									// height: 32px;

+ 92 - 49
pages/parents/course/courseDetails.vue

@@ -1,12 +1,12 @@
 <template>
 	<view>
-		<u-navbar></u-navbar>
+		<u-navbar :title="classDetail.className"></u-navbar>
 		<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"
+				<u-swiper :list="swiperList" mode="number" indicator-pos="bottomRight" :autoplay="false"
 					height="550"></u-swiper>
 			</view>
 			<!-- <img src="../../../assets/img/courseD.png" alt="">
@@ -20,11 +20,11 @@
 		<view class="main">
 			<view class="infos">
 				<view class="title">
-					足球体适能班
+					{{classDetail.className}}
 				</view>
-				<view class="price">
+				<!-- <view class="price">
 					<text>¥1000元</text> / 36课次(春季班)
-				</view>
+				</view> -->
 				<view class="time">
 					<view class="name">
 						时间
@@ -51,7 +51,7 @@
 						教室
 					</view>
 					<view class="content">
-						原足球场
+						{{classDetail.classRoomN}}
 
 					</view>
 				</view>
@@ -64,29 +64,16 @@
 					授课老师
 				</view>
 				<view class="teacher-card">
-					<view class="item">
-						<view class="photo">
-							<img src="../../../assets/img/teachercard.png" alt="">
-						</view>
-						<view class="teacher-name">
-							<view class="name">
-								翟老师
-							</view>
-							<view class="status">
-								主讲老师
-							</view>
-						</view>
-						<view class="more">
-							<u-icon name="arrow-right" color="#cccccc"></u-icon>
-						</view>
-					</view>
-					<view class="item">
+					<view class="item"
+						@click="gotoUrl('pages/parents/teacherHomepage/teacherHomepage?id=' + classDetail.courseTeachers)">
 						<view class="photo">
-							<img src="../../../assets/img/teachercard.png" alt="">
+							<u-avatar class="avatar"
+								src="'../../assets/img/head.png'" size="96">
+							</u-avatar>
 						</view>
 						<view class="teacher-name">
 							<view class="name">
-								翟老师
+								{{classDetail.courseTeachersN}}
 							</view>
 							<view class="status">
 								主讲老师
@@ -96,21 +83,22 @@
 							<u-icon name="arrow-right" color="#cccccc"></u-icon>
 						</view>
 					</view>
-
 				</view>
-
 			</view>
 
 			<view class="tag">
 				<view class="item">
-					<view class="icon">
+					<!-- <view class="icon">
 						<u-icon name="phone" color="#0DBAC7" size="48"></u-icon>
-					</view>
+					</view> -->
 					<view class="name">
-						免费试听
+						咨询电话:
+					</view>
+					<view class="phone-teacher">
+						{{classDetail.consultPhone != null ? item.consultPhone : '暂无'}}
 					</view>
 				</view>
-				<u-line color="#0DBAC7" direction="col" length="24" />
+				<!-- <u-line color="#0DBAC7" direction="col" length="24" />
 				<view class="item">
 					<view class="icon">
 						<u-icon name="email" color="#0DBAC7" size="48"></u-icon>
@@ -127,7 +115,7 @@
 					<view class="name">
 						品质保障
 					</view>
-				</view>
+				</view> -->
 			</view>
 
 			<view class="class-detail">
@@ -140,9 +128,8 @@
 				<view class="img">
 					<img src="../../../assets/img/detaiimg.png" alt="">
 				</view>
-
 			</view>
-			<view class="school-age">
+			<!-- <view class="school-age">
 				<view class="title">
 					适学年龄
 				</view>
@@ -159,39 +146,91 @@
 				<view class="content">
 					了解足球相关基础知识,培养兴趣。
 				</view>
-			</view>
+			</view> -->
 
 		</view>
 
 		<view class="bottom">
-			<button @click="gotoUrl('pages/parents/course/confirmOrder')">仅剩9席 立即报名</button>
+			<button>加入购物车</button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import * as mineApi from '@/apis/parents/mine.js'
+	import * as courseApi from '@/apis/parents/course.js'
+	
 	export default {
 		data() {
 			return {
-				list: [{
+				swiperList: [{
 						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))'
-				}
+				courseId: '',
+				classId: '',
+				courseBase: {},
+				coursePackageList: [],
+				tclassList: [],
+				packageList: [],
+				classList: [],
+				classDetail: {},
+				packageDetail: {},
+				studentId: '',
+				stuDetail: {},
+				show: false,
+				list: [],
+				studentList: [],
 			}
 		},
-		methods: {
-			backHomePage() {
-				uni.navigateBack()
+		onLoad(op) {
+			if(op.id) {
+				this.courseId = op.id;
+				this.classId = op.classId;
+				this.getCourseDetail();
 			}
+		},
+		methods: {
+			getCourseDetail() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				courseApi.getCourseDetail({
+					courseId: this.courseId
+				}).then((res) => {
+					uni.hideLoading();
+					this.courseBase = res.data.courseBase;
+					this.coursePackageList = res.data.coursePackageList;
+					this.tclassList = res.data.tclassList;
+					var list1 = [];
+					var list2 = [];
+					for (var i = 0; i < this.coursePackageList.length; i++) {
+						list1.push({
+							value: this.coursePackageList[i].packageId,
+							label: this.coursePackageList[i].packageName
+						})
+					}
+					this.packageList = list1;
+					
+					for (var j = 0; j < this.tclassList.length; j++) {
+						list2.push({
+							value: this.tclassList[j].classId,
+							label: this.tclassList[j].className
+						})
+						
+						if(this.tclassList[j].classId == this.classId) {
+							this.classDetail = this.tclassList[j];
+						}
+					}
+					this.classList = list2;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 		}
 	}
 </script>
@@ -375,6 +414,10 @@
 					margin-left: 8rpx;
 					color: rgba(16, 16, 16, 1);
 				}
+				
+				.phone-teacher {
+					margin-left: 8px;
+				}
 			}
 		}
 

+ 6 - 7
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/confirmOrder?id='+item.course_id)">
+				@click="gotoUrl('pages/parents/course/courseDetails?id='+item.course_id+'&classId='+item.class_id)">
 				<view class="picture" v-if="item.posterUrl != null">
 					<img :src="item.posterUrl" alt="">
 				</view>
@@ -190,20 +190,19 @@
 					</view>
 					<view class="teacher-price">
 						<view class="teacher">
-							<view class="photo">
+							<!-- <view class="photo">
 								<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> -->
 							<view class="name-teacher">
-								{{item.teacherName}}
+								咨询电话:
 							</view>
 							<!-- <view class="img">
 								<img src="../../../assets/img/riLine-smartphone-line@1x.png" alt="">
 							</view> -->
-							<view class="phone-teacher" v-if="item.consultPhone != null">
-								{{item.consultPhone.slice(0,11)}}
+							<view class="phone-teacher">
+								{{item.consultPhone != null ? item.consultPhone : '暂无'}}
 							</view>
 						</view>
 						<!-- <view class="price">

+ 19 - 8
pages/parents/search/searchResult.vue

@@ -2,11 +2,11 @@
 	<view>
 		<view class="search">
 			<u-icon name="arrow-left" @click="backCourse"></u-icon>
-			<u-search placeholder="魔方" action-text="查询" v-model="className" @custom="searchClass"></u-search>
+			<u-search placeholder="输入关键字搜索课程" action-text="查询" v-model="className" @custom="searchClass"></u-search>
 		</view>
 		<view class="main">
 			<view class="result-box" v-for="(item,index) in reCoursesList" :key="index"
-				@click="gotoUrl('pages/parents/course/confirmOrder?id='+item.course_id)">
+				@click="gotoUrl('pages/parents/course/courseDetails?id='+item.course_id+'&classId='+item.class_id)">
 				<view class="picture">
 					<img src="../../../assets/img/resultP.png" alt="">
 				</view>
@@ -23,13 +23,16 @@
 						</view>
 					</view>
 					<view class="teacher">
-						<view class="photo">
+						<!-- <view class="photo">
 							<u-avatar class="avatar"
 								:src="item.headPhoto != null ? item.headPhoto : '../../assets/img/head.png'" size="64">
 							</u-avatar>
-						</view>
+						</view> -->
 						<view class="name">
-							{{item.teacherName}}
+							咨询电话:
+						</view>
+						<view class="phone-teacher">
+							{{item.consultPhone != null ? item.consultPhone : '暂无'}}
 						</view>
 					</view>
 				</view>
@@ -50,7 +53,9 @@
 		},
 		methods: {
 			searchClass() {
-				this.getReCoursesList();
+				if(this.className) {
+					this.getReCoursesList();
+				}
 			},
 			backCourse() {
 				uni.navigateBack({
@@ -136,6 +141,7 @@
 
 			.infos {
 				margin-left: 12px;
+				flex: 1;
 
 				.title {
 					color: rgba(51, 51, 51, 1);
@@ -147,8 +153,8 @@
 					display: flex;
 
 					.item {
-						width: 128rpx;
-						height: 40rpx;
+						// width: 128rpx;
+						// height: 40rpx;
 						line-height: 40rpx;
 						border-radius: 8rpx;
 						background-color: rgba(241, 243, 244, 1);
@@ -180,6 +186,11 @@
 
 					.name {
 						color: rgba(16, 16, 16, 1);
+						width: 45%;
+					}
+					
+					.phone-teacher {
+						margin-right: 8px;
 					}
 				}
 			}