wkyy před 1 rokem
rodič
revize
19ff7e6b6b

+ 27 - 0
apis/parents/course.js

@@ -1,6 +1,33 @@
 import requestStudent from '@/apis/utils/request.js';
 import Qs from 'qs';
 
+export function getTeacherCourseList(data) {
+	var url='/mobile/student/getTeacherCourseList';
+	return requestStudent({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function getCourseBaseListBySortId(data) {
+	var url='/mobile/student/getCourseBaseListBySortId';
+	return requestStudent({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function getTeacherListBySortId(data) {
+	var url='/mobile/student/getTeacherListBySortId';
+	return requestStudent({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
 export function addBuyLogList(data) {
 	var url='/mobile/student/addBuyLogList';
 	return requestStudent({

+ 2 - 2
pages/parents/course/confirmOrder.vue

@@ -86,9 +86,9 @@
 					<view class="price">
 						{{payTotalMoney.toFixed(2)}}元
 					</view>
-					<view class="price-info">
+					<!-- <view class="price-info">
 						报名费{{entryFee.toFixed(2)}} 水电费{{weFee.toFixed(2)}}
-					</view>
+					</view> -->
 				</view>
 			</view>
 			<view class="discount-amount">

+ 205 - 126
pages/parents/course/course.vue

@@ -1,58 +1,58 @@
 <template>
 	<view>
 		<view class="head">
-			<u-search placeholder="搜索课程" :show-action="false" height="80" :disabled="true"
-				@click="toSearchResult"></u-search>
+			<u-search placeholder="搜索课程" :show-action="false" height="80" @focus="toSearchResult"></u-search>
 		</view>
 		<view class="main">
 			<!-- <u-swiper :list="list"></u-swiper> -->
 
 			<view class="content">
 				<view class="classify">
-					<view class="item" v-for="(m,index) in courseMenu" :key="index"
-						:class="active==index ? 'chosen' : ''" @click="courseChose(m,index)">
+					<view class="item" v-for="(m,index) in courseMenu" :key="index" :class="active==index ? 'chosen' : ''"
+						@click="courseChose(m,index)">
 						{{m.name}}
 					</view>
-					
+
 				</view>
-				
+
 				<view class="details">
 					<view class="classes">
-						<view class="item checked" >
+						<view class="item" @click="categorize = 1" :class="categorize==1 ? 'checked' : ''">
 							按课程
 						</view>
-						<view class="item" >
+						<view class="item" @click="categorize = 2" :class="categorize==2 ? 'checked' : ''">
 							按老师
 						</view>
 					</view>
 					<view class="infos-box2">
-						<view class="teacher-item" v-for="item in 2">
+						<view class="details-box" v-if="categorize==1">
+							<view class="item" v-for="(item,index) in courseBaseList" :key="index"
+								@click="toSearchResultById(item)">
+								{{item.name}}
+							</view>
+						</view>
+						<view class="teacher-item" v-for="(item,index) in teacherList" :key="index" v-if="categorize==2"
+							@click="toTeacherHomepage(item)">
 							<view class="photo">
-								<img src="../../../assets/img/photo2.png" alt="">
+								<u-avatar class="avatar" mode="square"
+									:src="item.headPhoto != null ? item.headPhoto : '../../assets/img/head.png'" size="96">
+								</u-avatar>
 							</view>
 							<view class="infos">
 								<view class="name">
-									瞿老师
+									{{item.employeeName}}
 								</view>
 								<view class="course1">
-									足球、篮球、羽球等
+									{{item.courseName}}
 								</view>
 							</view>
 							<view class="more">
 								<u-icon name="arrow-right"></u-icon>
 							</view>
 						</view>
-						<u-divider v-if="reCoursesList.length == recordsTotal && recordsTotal != 0" style="margin-top: 10px">没有更多了</u-divider>
 					</view>
-					<view  class="infos-box" v-for="(item,index) in reCoursesList" :key="index"
+					<view class="infos-box" v-for="(item,index) in reCoursesList" :key="index"
 						@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>
-						<view class="picture" v-else>
-							<img src="../../../assets/img/classify1.png" alt="">
-						</view> -->
-						
 						<view class="infos">
 							<view class="name">
 								{{item.className}}
@@ -67,31 +67,18 @@
 							</view>
 							<view class="teacher-price">
 								<view class="teacher">
-									<!-- <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="img">
-										<img src="../../../assets/img/riLine-smartphone-line@1x.png" alt="">
-									</view> -->
 									<view class="phone-teacher">
 										{{item.consultPhone != null ? item.consultPhone : '暂无'}}
 									</view>
 								</view>
-								<!-- <view class="price">
-									
-								</view> -->
 							</view>
 						</view>
 					</view>
-					
-					<u-divider v-if="reCoursesList.length == recordsTotal && recordsTotal != 0" style="margin-top: 10px">没有更多了</u-divider>
-				
-					
+					<u-divider v-if="reCoursesList.length == recordsTotal && recordsTotal != 0"
+						style="margin-top: 10px">没有更多了</u-divider>
 				</view>
 
 			</view>
@@ -119,10 +106,13 @@
 				pageNum: 1,
 				pageSize: 5,
 				recordsTotal: 0,
-				current:0,
+				current: 0,
 				list: [{
 					image: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
 				}, ],
+				courseBaseList: [],
+				teacherList: [],
+				categorize: 1
 			}
 		},
 		onReady() {
@@ -134,6 +124,79 @@
 			}
 		},
 		methods: {
+			toSearchResultById(item) {
+				uni.navigateTo({
+					url: '/pages/parents/search/searchResult?id=' + item.id
+				})
+			},
+			toTeacherHomepage(item) {
+				uni.navigateTo({
+					url: '/pages/parents/teacherHomepage/teacherHomepage?id=' + item.employeeId
+				})
+			},
+			getCourseBaseListBySortId(courseSortId) {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				courseApi.getCourseBaseListBySortId({
+					courseSortId: courseSortId
+				}).then((response) => {
+					uni.hideLoading();
+					this.courseBaseList = response.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getTeacherListBySortId(courseSortId) {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				courseApi.getTeacherListBySortId({
+					courseSortId: courseSortId
+				}).then((response) => {
+					uni.hideLoading();
+					this.teacherList = response.data;
+					for (var i = 0; i < this.teacherList.length; i++) {
+						this.getTeacherCourseList(this.teacherList[i].employeeId,i);
+					}
+					console.log(this.teacherList)
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getTeacherCourseList(teacherId,index) {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				courseApi.getTeacherCourseList({
+					teacherId: teacherId
+				}).then((response) => {
+					uni.hideLoading();
+					var teacherCourseList = response.data;
+					var courseNameList = [];
+					var courseName = '';
+					courseNameList = teacherCourseList.map(record => {
+						return record.course_name;
+					});
+					courseName = courseNameList.join(',');
+					
+					this.teacherList[index]['courseName'] = courseName;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			toSearchResult() {
 				uni.navigateTo({
 					url: '/pages/parents/search/searchResult'
@@ -170,10 +233,13 @@
 					})
 				})
 			},
-			courseChose(m,index) {
+			courseChose(m, index) {
 				this.active = index;
 				this.courseSort = m.id;
-				this.getReCoursesList(true);
+				this.categorize = 1;
+				// this.getReCoursesList(true);
+				this.getCourseBaseListBySortId(m.id)
+				this.getTeacherListBySortId(m.id)
 			},
 			getLoadTopCourseSorts() {
 				uni.showLoading({
@@ -184,7 +250,9 @@
 					uni.hideLoading();
 					this.courseMenu = response.data;
 					this.courseSort = response.data[0].id;
-					this.getReCoursesList();
+					// this.getReCoursesList();
+					this.getCourseBaseListBySortId(this.courseSort)
+					this.getTeacherListBySortId(this.courseSort)
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -217,8 +285,9 @@
 				border-radius: 12px;
 				width: 28%;
 				text-align: center;
-				height:1200rpx;
-                overflow-y: scroll;
+				height: 1200rpx;
+				overflow-y: scroll;
+
 				.item {
 					line-height: 32px;
 					margin-top: 14px;
@@ -226,7 +295,7 @@
 				}
 
 				.chosen {
-					width: 66.7%;
+					width: 80.7%;
 					margin: 14px auto 0;
 					border-radius: 50px;
 					background-color: rgba(13, 186, 199, 1);
@@ -239,39 +308,40 @@
 				margin-left: 12px;
 				width: 68.3%;
 				height: 1200rpx;
-                overflow-y: scroll;
+				overflow-y: scroll;
+
 				.infos-box {
 					border-radius: 12px;
 					background-color: rgba(255, 255, 255, 1);
 					padding: 12px;
 					margin-bottom: 12px;
 					display: flex;
-				
+
 					.picture {
 						width: 200rpx;
 						height: 200rpx;
 						border-radius: 4px;
 						overflow: hidden;
-				
+
 						img {
 							width: 100%;
 							height: 100%;
 						}
 					}
-				
+
 					.infos {
 						flex: 1;
 						margin-left: 12px;
-				
+
 						.name {
 							color: rgba(51, 51, 51, 1);
 							font-size: 16px;
 						}
-				
+
 						.tips {
 							display: flex;
 							margin-top: 8px;
-				
+
 							.item {
 								padding: 0 8px;
 								line-height: 20px;
@@ -282,13 +352,13 @@
 								margin-right: 8px;
 							}
 						}
-				
+
 						.teacher-price {
 							margin-top: 44rpx;
 							// display: flex;
 							// justify-content: space-between;
 							// align-items: center;
-				
+
 							.teacher {
 								display: flex;
 								align-items: center;
@@ -298,44 +368,44 @@
 									font-size: 16px;
 									width: 60%;
 								}
-								
+
 								.phone-teacher {
 									margin-right: 8px;
 								}
-								
+
 								.photo {
 									// width: 32px;
 									// height: 32px;
 									// border-radius: 50px;
 									// overflow: hidden;
 									margin-right: 8px;
-				
+
 									img {
 										width: 100%;
 										height: 100%;
 									}
 								}
-								
+
 								.img {
 									width: 32rpx;
 									height: 32rpx;
 									margin-left: 16rpx;
-								
+
 									img {
 										width: 100%;
 										height: 100%;
-								
+
 									}
 								}
 							}
-				
+
 							.price {
 								color: rgba(119, 119, 119, 1);
 							}
 						}
 					}
 				}
-				
+
 				.title {
 					color: rgba(51, 51, 51, 1);
 					font-size: 16px;
@@ -367,74 +437,83 @@
 		}
 	}
 
-.classes{
-	height: 88rpx;
-	line-height: 88rpx;
-	display: flex;
-	background-color: #ffffff;
-	margin-bottom: 24rpx;
-	border-radius: 12px;
-	border: 2px solid rgba(13, 186, 199, 1);
-	color: rgba(13, 186, 199, 1);
-	.checked{
-		background-color: #0DBAC7;
-		color:#fff
-	}
-	.item{
-		width: 50%;
-		text-align: center;
-	}
-}
-
-.teacher-item{
-	width: 100%;
-	border-radius: 12px;
-	background-color: rgba(255, 255, 255, 1);
-	display: flex;
-	align-items: center;
-	margin-bottom: 24rpx;
-
-	padding: 24rpx;
-	.photo{
-		width: 96rpx;
-		height: 96rpx;
-		border-radius: 8px;
-		overflow: hidden;
-		img{
-			width: 100%;
+	.classes {
+		height: 88rpx;
+		line-height: 88rpx;
+		display: flex;
+		background-color: #ffffff;
+		margin-bottom: 24rpx;
+		border-radius: 12px;
+		border: 2px solid rgba(13, 186, 199, 1);
+		color: rgba(13, 186, 199, 1);
+
+		.checked {
+			background-color: #0DBAC7;
+			color: #fff
 		}
-		
-		
-		
-	}
-	.infos{
-		 margin-left: 16rpx;
-		.name{
-			color: rgba(51, 51, 51, 1);
-			font-size: 32rpx;
-			margin-bottom: 16rpx;
+
+		.item {
+			width: 50%;
+			text-align: center;
 		}
-		
 	}
-	.course1{
-		color: rgba(119, 119, 119, 1);
-		font-size: 28rpx;
-		width: 200rpx;
-		white-space: nowrap;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		
-		
+
+	.teacher-item {
+		width: 100%;
+		border-radius: 12px;
+		background-color: rgba(255, 255, 255, 1);
+		display: flex;
+		align-items: center;
+		margin-bottom: 24rpx;
+
+		padding: 24rpx;
+
+		.photo {
+			width: 96rpx;
+			height: 96rpx;
+			border-radius: 8px;
+			overflow: hidden;
+
+			img {
+				width: 100%;
+			}
+
+
+
+		}
+
+		.infos {
+			margin-left: 16rpx;
+
+			.name {
+				color: rgba(51, 51, 51, 1);
+				font-size: 32rpx;
+				margin-bottom: 16rpx;
+			}
+
+		}
+
+		.course1 {
+			color: rgba(119, 119, 119, 1);
+			font-size: 28rpx;
+			width: 200rpx;
+			white-space: nowrap;
+			overflow: hidden;
+			text-overflow: ellipsis;
+
+
+		}
+
+		.more {
+			margin-left: auto;
+		}
 	}
-	.more{
-		margin-left: auto;
+
+	.teacher-box {
+		border-radius: 12px;
+		background-color: rgba(255, 255, 255, 1);
+		padding: 12px;
+		margin-bottom: 12px;
+		display: flex;
 	}
-}
-.teacher-box {
-					border-radius: 12px;
-					background-color: rgba(255, 255, 255, 1);
-					padding: 12px;
-					margin-bottom: 12px;
-					display: flex;
-				}
-</style>
+</style>

+ 2 - 2
pages/parents/course/courseDetails.vue

@@ -188,9 +188,9 @@
 										{{packageDetail.unitPrice!=null && packageDetail.courseAmount!=null ?
 											(packageDetail.unitPrice*packageDetail.courseAmount+packageDetail.waterElectricityAmount).toFixed(2) : '0.00'}}元
 									</view>
-									<view class="price-detail" v-if="packageDetail.unitPrice!=null && packageDetail.courseAmount!=null">
+									<!-- <view class="price-detail" v-if="packageDetail.unitPrice!=null && packageDetail.courseAmount!=null">
 										(包含报名费{{(packageDetail.unitPrice*packageDetail.courseAmount).toFixed(2)}}元 水电费{{packageDetail.waterElectricityAmount.toFixed(2)}}元)
-									</view>
+									</view> -->
 								</view>
 							</view>
 							<!-- 报名班级 -->

+ 2 - 2
pages/parents/course/paymentDetail.vue

@@ -24,7 +24,7 @@
 		</view>
 		<!-- 金额 -->
 		<view class="amount">
-			<view class="amount-payable">
+			<!-- <view class="amount-payable">
 				<view class="title">
 					应付金额
 				</view>
@@ -55,7 +55,7 @@
 				<view class="value">
 					-{{detail.discountAmount!=null ? detail.discountAmount.toFixed(2) : '0.00'}}元
 				</view>
-			</view>
+			</view> -->
 			<view class="amount-paid">
 				<view class="title">
 					实付金额

+ 4 - 4
pages/parents/course/shoppingCar.vue

@@ -50,10 +50,10 @@
 				<view class="price">
 					{{(item.coursePackage.unitPrice*item.coursePackage.courseAmount+item.coursePackage.waterElectricityAmount).toFixed(2)}}元
 				</view>
-				<view :class="{priceInfo,editing:edit==true}">
+				<!-- <view :class="{priceInfo,editing:edit==true}">
 					包含 报名费{{(item.coursePackage.unitPrice*item.coursePackage.courseAmount).toFixed(2)}}元
 					水电费{{item.coursePackage.waterElectricityAmount.toFixed(2)}}元
-				</view>
+				</view> -->
 			</view>
 			<view class="del-icon" v-if="edit==true" style="margin: auto 0;" @click="deleteShop(item,index)">
 				<u-icon name="minus-circle-fill" color="#FF3523" size="40"></u-icon>
@@ -106,10 +106,10 @@
 							<view class="price">
 								{{(packageDetail.unitPrice*packageDetail.courseAmount+packageDetail.waterElectricityAmount).toFixed(2)}}元
 							</view>
-							<view class="price-detail" v-if="packageDetail.unitPrice!=null && packageDetail.courseAmount!=null">
+							<!-- <view class="price-detail" v-if="packageDetail.unitPrice!=null && packageDetail.courseAmount!=null">
 								(包含报名费{{(packageDetail.unitPrice*packageDetail.courseAmount).toFixed(2)}}元
 								水电费{{packageDetail.waterElectricityAmount.toFixed(2)}}元)
-							</view>
+							</view> -->
 						</view>
 					</view>
 					<!-- 报名班级 -->

+ 9 - 1
pages/parents/search/searchResult.vue

@@ -51,7 +51,14 @@
 		data() {
 			return {
 				className: '',
-				reCoursesList: []
+				reCoursesList: [],
+				courseSortId: ''
+			}
+		},
+		onLoad(op) {
+			if(op.id) {
+				this.courseSortId = op.id;
+				this.getReCoursesList();
 			}
 		},
 		methods: {
@@ -71,6 +78,7 @@
 					mask: true,
 				})
 				homePageApi.loadCoursesForHomeShow({
+					courseSortId: this.courseSortId,
 					className: this.className,
 					pageNum: 1,
 					pageSize: 10000

+ 79 - 42
pages/parents/teacherHomepage/teacherHomepage.vue

@@ -24,82 +24,66 @@
 					<view class="title">
 						教师简介
 					</view>
-					<view class="introduction-content">
+					<view class="introduction-content" v-if="form.introduce != null">
 						{{form.introduce}}
 					</view>
+					<view class="introduction-content" v-else>
+						暂无
+					</view>
 				</view>
 			</view>
 		</view>
 		<view class="content">
 
 		</view>
-		<!-- <view class="main">
+		<view class="main">
 			<view class="title">
 				主讲课程
 			</view>
-			<view class="class-card">
-				<view class="picture">
+			<view class="class-card" v-for="(item,index) in courseList" :key="index">
+				<view class="picture" v-if="item.poster_url != null">
+					<img :src="item.poster_url" alt="">
+				</view>
+				<view class="picture" v-else>
 					<img src="../../../assets/img/picture1.png" alt="">
 				</view>
 				<view class="infos">
 					<view class="infos-title">
-						中国舞十级班
+						{{item.course_name}}
 					</view>
 					<view class="tag">
-						<view class="tag-item">
-							专业考证
-						</view>
-						<view class="tag-item">
-							限时报名
-						</view>
-					</view>
-					<view class="apply-number">
-						<view class="number">
-							累计188人报名
+						<view class="tag-item" v-if="item.course_desc != null">
+							{{item.course_desc}}
 						</view>
-						<view class="selling-point">
-							仅剩5个名额
+						<view class="tag-item" v-else>
+							暂无简介
 						</view>
 					</view>
-
-				</view>
-
-			</view>
-			<view class="class-card">
-				<view class="picture">
-					<img src="../../../assets/img/picture1.png" alt="">
-				</view>
-				<view class="infos">
-					<view class="infos-title">
-						中国舞十级班
-					</view>
-					<view class="tag">
-						<view class="tag-item">
-							专业考证
+					<view class="teacher">
+						<view class="name">
+							咨询电话:
 						</view>
-						<view class="tag-item">
-							限时报名
+						<view class="phone-teacher">
+							{{item.consultPhone != null ? item.consultPhone : '暂无'}}
 						</view>
 					</view>
-					<view class="apply-number">
+					<!-- <view class="apply-number">
 						<view class="number">
 							累计188人报名
 						</view>
 						<view class="selling-point">
-							低至20元/节
+							仅剩5个名额
 						</view>
-					</view>
-
+					</view> -->
 				</view>
-
 			</view>
-
-		</view> -->
+		</view>
 	</view>
 </template>
 
 <script>
 	import * as teacherHomepageApi from '@/apis/parents/teacherHomepage.js'
+	import * as courseApi from '@/apis/parents/course.js'
 
 	export default {
 		data() {
@@ -110,17 +94,37 @@
 				title: '',
 				content: '',
 				confirmText: '拨打电话',
+				courseList: []
 			}
 		},
 		onLoad(op) {
 			if(op.id) {
 				this.teacherIds = op.id;
+				this.getParentsInfo();
+				this.getTeacherCourseList();
 			}
 		},
 		onReady() {
-			this.getParentsInfo();
+			
 		},
 		methods: {
+			getTeacherCourseList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				courseApi.getTeacherCourseList({
+					teacherId: this.teacherIds
+				}).then((response) => {
+					uni.hideLoading();
+					this.courseList = response.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			contactMe() {
 				this.title = '联系老师';
 				this.content = this.form.phone;
@@ -251,6 +255,11 @@
 				height: 200rpx;
 				border-radius: 4px;
 				overflow: hidden;
+				
+				img {
+					width: 100%;
+					height: 100%;
+				}
 			}
 
 			.infos {
@@ -279,6 +288,34 @@
 					font-size: 12px;
 				}
 			}
+			
+			.teacher {
+				display: flex;
+				align-items: center;
+				margin-top: 36rpx;
+			
+				.photo {
+					width: 64rpx;
+					height: 64rpx;
+					border-radius: 100rpx;
+					overflow: hidden;
+					margin-right: 12px;
+			
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+			
+				.name {
+					color: rgba(16, 16, 16, 1);
+					width: 45%;
+				}
+				
+				.phone-teacher {
+					margin-right: 8px;
+				}
+			}
 
 			.apply-number {
 				display: flex;