wkyy 2 tahun lalu
induk
melakukan
6b43073cfb

+ 9 - 0
apis/parents/classSchedule.js

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

+ 11 - 0
apis/parents/teacherHomepage.js

@@ -0,0 +1,11 @@
+import requestStudent from '@/apis/utils/request.js';
+import Qs from 'qs';
+
+export function getTeacherBase(data) {
+	var url='/mobile/student/getTeacherBase';
+	return requestStudent({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}

+ 20 - 0
apis/teacher/myClass.js

@@ -0,0 +1,20 @@
+import requestTeacher from '@/apis/utils/request.js';
+import Qs from 'qs';
+
+export function loadMyClass(data) {
+	var url='/mobile/teacher/class/loadMyClass';
+	return requestTeacher({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}
+
+export function loadClassStudents(data) {
+	var url='/mobile/teacher/class/loadClassStudents';
+	return requestTeacher({
+		method: 'post',
+		data: data,
+		url: url
+	})
+}

+ 73 - 55
pages/parents/classSchedule/classScheduleDetails.vue

@@ -1,47 +1,59 @@
 <template>
 <template>
 	<view>
 	<view>
-		<u-navbar title="芭蕾舞新生班"></u-navbar>
-		
-			<view class="main">
-				<u-cell-group>
-					<u-cell-item  title="校区" value="青少年宫校区" :arrow="false"></u-cell-item>
-					<u-cell-item  title="开课/结课日期" value="2023-01-03至2023-02-20"  :arrow="false"></u-cell-item>
-					<u-cell-item  title="上课时间" :value="detail.courseDate + ' ' + detail.coursePeriods"  :arrow="false"></u-cell-item>
-					<u-cell-item  title="课次" value="36次"  :arrow="false"></u-cell-item>
-					<u-cell-item  title="上课教室" :value="detail.classroom"  :arrow="false"></u-cell-item>
-					<u-cell-item  title="学员总数" value="20人"  :arrow="false"></u-cell-item>
-					<u-cell-item  class="teacher" title="任课老师" :value="detail.courseTeachersN"></u-cell-item>
-				</u-cell-group>
-			</view>
-			
-			<view class="main">
+		<u-navbar :title="detail.className"></u-navbar>
+
+		<view class="main">
+			<u-cell-group>
+				<u-cell-item title="校区" :value="detail.schoolName" :arrow="false">
+				</u-cell-item>
+				<u-cell-item title="开课/结课日期" :value="detail.courseStart+'至'+detail.courseEnd"
+					:arrow="false">
+				</u-cell-item>
+				<u-cell-item title="上课时间" :value="detail.courseDate+' '+detail.coursePeriods" :arrow="false">
+				</u-cell-item>
+				<u-cell-item title="课次" :value="detail.courseAmount+detail.freeAmount+'次'" :arrow="false">
+				</u-cell-item>
+				<u-cell-item title="上课教室" :value="detail.classroomName" :arrow="false">
+				</u-cell-item>
+				<u-cell-item title="学员总数" :value="detail.studentCount+'人'" :arrow="false">
+				</u-cell-item>
+				<u-cell-item class="teacher" title="任课老师" :value="detail.teacherNames"
+					@click="gotoUrl('pages/parents/teacherHomepage/teacherHomepage?id=' + detail.courseTeachers)"></u-cell-item>
+			</u-cell-group>
+		</view>
+
+		<!-- <view class="main">
 				<u-cell-group>
 				<u-cell-group>
 					<u-cell-item  title="打卡签到" value="到课" :arrow="false"></u-cell-item>
 					<u-cell-item  title="打卡签到" value="到课" :arrow="false"></u-cell-item>
 					<u-cell-item  title="签到时间" value="10:30:00"  :arrow="false"></u-cell-item>
 					<u-cell-item  title="签到时间" value="10:30:00"  :arrow="false"></u-cell-item>
 				</u-cell-group>
 				</u-cell-group>
-			</view>
-			
-			<view class="bottom">
-				<button>请假</button>
-			</view>
-		
+			</view> -->
+
+		<view class="bottom">
+			<button>请假</button>
+		</view>
+
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
 	import * as classScheduleApi from '@/apis/parents/classSchedule.js'
 	import * as classScheduleApi from '@/apis/parents/classSchedule.js'
-	
+
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				sheetId: '',
+				studentId: '',
+				scheduleId: '',
 				detail: {},
 				detail: {},
 			}
 			}
 		},
 		},
 		onLoad(op) {
 		onLoad(op) {
-			if(op.id) {
-				this.sheetId = op.id;
-				this.getCourseDetail();
+			if (op.id) {
+				this.scheduleId = op.id;
+				if (this.carhelp.getStudentId()) {
+					this.studentId = this.carhelp.getStudentId().studentId;
+					this.getCourseDetail();
+				}
 			}
 			}
 		},
 		},
 		methods: {
 		methods: {
@@ -50,11 +62,12 @@
 					title: "加载中",
 					title: "加载中",
 					mask: true,
 					mask: true,
 				})
 				})
-				classScheduleApi.courseDetail({
-					sheetId: this.sheetId,
+				classScheduleApi.getScheduleDtl({
+					studentId: this.studentId,
+					scheduleId: this.scheduleId
 				}).then((response) => {
 				}).then((response) => {
 					uni.hideLoading();
 					uni.hideLoading();
-					this.detail = response.data.scheduleSheet;
+					this.detail = response.data.scheduleDtl;
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({
 						title: error,
 						title: error,
@@ -67,39 +80,44 @@
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-	page{
+	page {
 		padding-bottom: 150px;
 		padding-bottom: 150px;
 	}
 	}
-	.main{
+
+	.main {
 		background-color: #fff;
 		background-color: #fff;
 		margin-bottom: 10px;
 		margin-bottom: 10px;
 	}
 	}
-	/deep/.u-cell_title{
+
+	/deep/.u-cell_title {
 		color: rgba(119, 119, 119, 1);
 		color: rgba(119, 119, 119, 1);
 	}
 	}
-	/deep/.u-cell__value{
+
+	/deep/.u-cell__value {
 		color: #333333;
 		color: #333333;
 	}
 	}
-   .teacher{
-	   /deep/.u-cell__value{
-	   	color: #00BAC8;
-	   }
-   }
-   
-   .bottom{
-	   position: fixed;
-	   left: 0;
-	   right: 0;
-	   bottom: 0;
-	   padding: 10px 0;
-	   background-color: #fff;
-	   button{
-		   border-radius: 50px;
-		   background-color: rgba(13, 186, 199, 1);
-		   color: rgba(255, 255, 255, 1);
-		   font-size: 16px;
-		   line-height: 40px;
-		   width: 91.4%;
-	   }
-   }
+
+	.teacher {
+		/deep/.u-cell__value {
+			color: #00BAC8;
+		}
+	}
+
+	.bottom {
+		position: fixed;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		padding: 10px 0;
+		background-color: #fff;
+
+		button {
+			border-radius: 50px;
+			background-color: rgba(13, 186, 199, 1);
+		 color: rgba(255, 255, 255, 1);
+			font-size: 16px;
+			line-height: 40px;
+			width: 91.4%;
+		}
+	}
 </style>
 </style>

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

@@ -110,7 +110,7 @@
 			</view>
 			</view>
 			<view class="course-infos">
 			<view class="course-infos">
 				<view class="info-box" v-for="(item,index) in courseList" :key="index"
 				<view class="info-box" v-for="(item,index) in courseList" :key="index"
-					@click="gotoUrl('pages/parents/classSchedule/classScheduleDetails')">
+					@click="gotoUrl('pages/parents/classSchedule/classScheduleDetails?id=' + item.sheetId)">
 					<view class="position today" v-if="item.courseDate == date">
 					<view class="position today" v-if="item.courseDate == date">
 					</view>
 					</view>

+ 25 - 12
pages/parents/mine/mine.vue

@@ -105,7 +105,7 @@
 
 
 				<view class="value">
 				<view class="value">
 					<view class="text">
 					<view class="text">
-						155****0000
+						{{form.phone.slice(0,3) + '****' + form.phone.slice(-4)}}
 					</view>
 					</view>
 					<view class="icon">
 					<view class="icon">
 						<u-icon name="arrow-right" color="#cccccc"></u-icon>
 						<u-icon name="arrow-right" color="#cccccc"></u-icon>
@@ -210,6 +210,7 @@
 		data() {
 		data() {
 			return {
 			return {
 				form: {
 				form: {
+					id: '',
 					headImg: '',
 					headImg: '',
 					nickName: ''
 					nickName: ''
 				},
 				},
@@ -235,15 +236,22 @@
 				this.studentId = e;
 				this.studentId = e;
 			},
 			},
 			toAddChildInformation(item) {
 			toAddChildInformation(item) {
-				if(item) {
-					uni.navigateTo({
-						url: '/pages/parents/mine/addChildInformation?id=' + item.studentId
-					})
-				} else {
+				if(this.form.id) {
+					if(item) {
+						uni.navigateTo({
+							url: '/pages/parents/mine/addChildInformation?id=' + item.studentId
+						})
+					} else {
+						uni.navigateTo({
+							url: '/pages/parents/mine/addChildInformation'
+						})
+					}
+				}else {
 					uni.navigateTo({
 					uni.navigateTo({
-						url: '/pages/parents/mine/addChildInformation'
+						url: '/pages/parents/login/login'
 					})
 					})
 				}
 				}
+				
 			},
 			},
 			getAge(str) {
 			getAge(str) {
 				var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
 				var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
@@ -284,8 +292,7 @@
 					openId: this.carhelp.getOpenId()
 					openId: this.carhelp.getOpenId()
 				}).then((response) => {
 				}).then((response) => {
 					uni.hideLoading();
 					uni.hideLoading();
-					this.form.headImg = response.data.regUser.headImg;
-					this.form.nickName = response.data.regUser.nickName;
+					this.form = response.data.regUser;
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({
 						title: error,
 						title: error,
@@ -331,9 +338,15 @@
 				})
 				})
 			},
 			},
 			toEditProfile() {
 			toEditProfile() {
-				uni.navigateTo({
-					url: '/pages/parents/mine/editProfile'
-				})
+				if (this.form.id) {
+					uni.navigateTo({
+						url: '/pages/parents/mine/editProfile'
+					})
+				} else{
+					uni.navigateTo({
+						url: '/pages/parents/login/login'
+					})
+				}
 			},
 			},
 		}
 		}
 	}
 	}

+ 200 - 135
pages/parents/teacherHomepage/teacherHomepage.vue

@@ -5,112 +5,160 @@
 			<view class="teacher-card">
 			<view class="teacher-card">
 				<view class="infos">
 				<view class="infos">
 					<view class="photo">
 					<view class="photo">
-						<img src="../../../assets/img/photowoman.png" alt="">
+						<u-avatar v-if="form.headPhoto != null" class="avatar"
+							:src="form.headPhoto+'?x-oss-process=image/resize,m_fill,w_256,h_256'" size="160">
+							<img src="" alt="">
+						</u-avatar>
 					</view>
 					</view>
 					<view class="name">
 					<view class="name">
-						夏奕琳
+						{{form.employeeName}}
 					</view>
 					</view>
-					<view class="contact">
+					<view class="contact" @click="contactMe">
 						联系我
 						联系我
 					</view>
 					</view>
 				</view>
 				</view>
-				 
-				 <view class="introduction">
-				 	<view class="title">
-				 		教师简介
-				 	</view>
+				<u-modal v-model="show" @confirm="confirmPhone" :confirm-text="confirmText" confirm-color="#606266" :show-cancel-button="true" ref="uModal"
+					:asyncClose="true" :title="title" :content="content" :content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
+
+				<view class="introduction">
+					<view class="title">
+						教师简介
+					</view>
 					<view class="introduction-content">
 					<view class="introduction-content">
-						授课老师荣誉奖项以及优质教学案例授课老师荣誉奖项以及优质教学案例授课老师荣誉奖项以及优质教学案例。
+						{{form.introduce}}
 					</view>
 					</view>
-				 </view>
+				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content">
 		<view class="content">
-			
+
 		</view>
 		</view>
 		<view class="main">
 		<view class="main">
 			<view class="title">
 			<view class="title">
 				主讲课程
 				主讲课程
 			</view>
 			</view>
 			<view class="class-card">
 			<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>
-									<view class="tag-item">
-										限时报名
-									</view>
-								 </view>
-								 <view class="apply-number">
-								 	<view class="number">
-								 		累计188人报名
-								 	</view>
-									<view class="selling-point">
-										仅剩5个名额
-									</view>
-								 </view>
-							 	
-							 </view>
-				
+				<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>
+						<view class="tag-item">
+							限时报名
+						</view>
+					</view>
+					<view class="apply-number">
+						<view class="number">
+							累计188人报名
+						</view>
+						<view class="selling-point">
+							仅剩5个名额
+						</view>
+					</view>
+
+				</view>
+
 			</view>
 			</view>
 			<view class="class-card">
 			<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>
-									<view class="tag-item">
-										限时报名
-									</view>
-								 </view>
-								 <view class="apply-number">
-								 	<view class="number">
-								 		累计188人报名
-								 	</view>
-									<view class="selling-point">
-										低至20元/节
-									</view>
-								 </view>
-							 	
-							 </view>
-				
+				<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>
+						<view class="tag-item">
+							限时报名
+						</view>
+					</view>
+					<view class="apply-number">
+						<view class="number">
+							累计188人报名
+						</view>
+						<view class="selling-point">
+							低至20元/节
+						</view>
+					</view>
+
+				</view>
+
 			</view>
 			</view>
-			
+
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import * as teacherHomepageApi from '@/apis/parents/teacherHomepage.js'
+
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				
+				form: {},
+				teacherIds: '',
+				show: false,
+				title: '',
+				content: '',
+				confirmText: '拨打电话',
+			}
+		},
+		onLoad(op) {
+			if(op.id) {
+				this.teacherIds = op.id;
 			}
 			}
 		},
 		},
+		onReady() {
+			this.getParentsInfo();
+		},
 		methods: {
 		methods: {
-			
+			contactMe() {
+				this.title = '联系老师';
+				this.content = this.form.phone;
+				this.show = true;
+			},
+			confirmPhone(){
+				this.show = false;
+				uni.makePhoneCall({
+					phoneNumber:this.content //仅为示例
+				});
+			},
+			getParentsInfo() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				teacherHomepageApi.getTeacherBase({
+					teacherIds: this.teacherIds
+				}).then((response) => {
+					uni.hideLoading();
+					this.form = response.data[0];
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 		}
 		}
 	}
 	}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-	.background{
+	.background {
 		background-color: rgba(13, 186, 199, 1);
 		background-color: rgba(13, 186, 199, 1);
 		height: 400rpx;
 		height: 400rpx;
-		.teacher-card{
+
+		.teacher-card {
 			width: 91.4%;
 			width: 91.4%;
 			padding: 44rpx 40rpx;
 			padding: 44rpx 40rpx;
 			background-color: #fff;
 			background-color: #fff;
@@ -119,29 +167,34 @@
 			left: 32rpx;
 			left: 32rpx;
 			right: 32rpx;
 			right: 32rpx;
 			border-radius: 24rpx;
 			border-radius: 24rpx;
-			.infos{
+
+			.infos {
 				display: flex;
 				display: flex;
 			}
 			}
-			.photo{
+
+			.photo {
 				width: 80px;
 				width: 80px;
 				height: 80px;
 				height: 80px;
 				border-radius: 50px;
 				border-radius: 50px;
 				overflow: hidden;
 				overflow: hidden;
 				margin-top: -80rpx;
 				margin-top: -80rpx;
-				img{
+
+				img {
 					width: 100%;
 					width: 100%;
 					height: 100%;
 					height: 100%;
 				}
 				}
 			}
 			}
-			.name{
+
+			.name {
 				margin-left: 12px;
 				margin-left: 12px;
 				color: rgba(51, 51, 51, 1);
 				color: rgba(51, 51, 51, 1);
 				font-size: 20px;
 				font-size: 20px;
 				font-weight: bold;
 				font-weight: bold;
 			}
 			}
-			.contact{
+
+			.contact {
 				margin-left: auto;
 				margin-left: auto;
-				width:160rpx;
+				width: 160rpx;
 				height: 64rpx;
 				height: 64rpx;
 				line-height: 64rpx;
 				line-height: 64rpx;
 				border-radius: 100rpx;
 				border-radius: 100rpx;
@@ -150,84 +203,96 @@
 				text-align: center;
 				text-align: center;
 			}
 			}
 		}
 		}
-		.introduction{
+
+		.introduction {
 			color: rgba(119, 119, 119, 1);
 			color: rgba(119, 119, 119, 1);
 			margin-top: 48rpx;
 			margin-top: 48rpx;
-			.introduction-content{
+
+			.introduction-content {
 				margin-top: 16rpx;
 				margin-top: 16rpx;
 			}
 			}
 		}
 		}
 	}
 	}
 
 
-.content{
-	border-radius: 40rpx 40rpx 0px 0px;
-	background-color: rgba(244, 246, 246, 1);
-	margin-top: -20rpx;
-	height: 100px;
+	.content {
+		border-radius: 40rpx 40rpx 0px 0px;
+		background-color: rgba(244, 246, 246, 1);
+		margin-top: -20rpx;
+		height: 100px;
+
+		.title {
+			margin-top: 380rpx;
+			color: rgba(51, 51, 51, 1);
+			font-size: 16px;
+			font-weight: bold;
 	
 	
-	.title{
-		margin-top: 380rpx;
-		color: rgba(51, 51, 51, 1);
-		font-size: 16px;
-		font-weight: bold;
 	}
 	}
 }
 }
 
 
 
 
-.main{
-	padding: 0 24rpx;
-	.title{
-		color: rgba(51, 51, 51, 1);
-		font-size: 16px;
-		font-weight: bold;
-	}
-	.class-card{
-		margin-top: 24rpx;
-		border-radius: 12px;
-		background-color: #fff;
-		padding: 24rpx;
-		display: flex;
-		.picture{
-			width: 200rpx;
-			height: 200rpx;
-			border-radius: 4px;
-			overflow: hidden;
-		}
-		.infos{
-			flex: 1;
-			margin-left: 40rpx;
-			.infos-title{
-				color: rgba(51, 51, 51, 1);
-				font-size: 16px;
-				font-weight: bold;
-				
-			}
+	.main {
+		padding: 0 24rpx;
+
+		.title {
+			color: rgba(51, 51, 51, 1);
+			font-size: 16px;
+			font-weight: bold;
 		}
 		}
-		.tag{
-			display: flex;
+
+		.class-card {
 			margin-top: 24rpx;
 			margin-top: 24rpx;
-			font-size: 24rpx;
-			.tag-item{
-				padding: 8rpx;
-				margin-right: 16rpx;
-				border-radius: 8rpx;
-				background-color: rgba(241, 243, 244, 1);
-				color: rgba(136, 133, 133, 1);
-				font-size: 12px;
-			}
-		}
-		.apply-number{
+			border-radius: 12px;
+			background-color: #fff;
+			padding: 24rpx;
 			display: flex;
 			display: flex;
-			justify-content: space-between;
-			margin-top: 60rpx;
-			.number{
-				color: rgba(119, 119, 119, 1);
+
+			.picture {
+				width: 200rpx;
+				height: 200rpx;
+				border-radius: 4px;
+				overflow: hidden;
+			}
+
+			.infos {
+				flex: 1;
+				margin-left: 40rpx;
+
+				.infos-title {
+					color: rgba(51, 51, 51, 1);
+					font-size: 16px;
+					font-weight: bold;
+
+				}
+			}
+
+			.tag {
+				display: flex;
+				margin-top: 24rpx;
+				font-size: 24rpx;
+
+				.tag-item {
+					padding: 8rpx;
+					margin-right: 16rpx;
+					border-radius: 8rpx;
+					background-color: rgba(241, 243, 244, 1);
+					color: rgba(136, 133, 133, 1);
+					font-size: 12px;
+				}
 			}
 			}
-			.selling-point{
-				color: rgba(255, 61, 0, 1);
+
+			.apply-number {
+				display: flex;
+				justify-content: space-between;
+				margin-top: 60rpx;
+
+				.number {
+					color: rgba(119, 119, 119, 1);
+				}
+
+				.selling-point {
+					color: rgba(255, 61, 0, 1);
+				}
 			}
 			}
 		}
 		}
 	}
 	}
-}
-
 </style>
 </style>

+ 11 - 6
pages/teacher/mine/mine.vue

@@ -100,6 +100,7 @@
 		data() {
 		data() {
 			return {
 			return {
 				form: {
 				form: {
+					id: '',
 					headImg: '',
 					headImg: '',
 					nickName: ''
 					nickName: ''
 				},
 				},
@@ -143,9 +144,7 @@
 					openId: this.carhelp.getOpenId()
 					openId: this.carhelp.getOpenId()
 				}).then((response) => {
 				}).then((response) => {
 					uni.hideLoading();
 					uni.hideLoading();
-					console.log(response.data.regUser)
-					this.form.headImg = response.data.regUser.headImg;
-					this.form.nickName = response.data.regUser.nickName;
+					this.form = response.data.regUser;
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({
 						title: error,
 						title: error,
@@ -154,9 +153,15 @@
 				})
 				})
 			},
 			},
 			toEditProfile() {
 			toEditProfile() {
-				uni.navigateTo({
-					url: '/pages/teacher/editProfile/editProfile'
-				})
+				if (this.form.id) {
+					uni.navigateTo({
+						url: '/pages/teacher/editProfile/editProfile'
+					})
+				} else{
+					uni.navigateTo({
+						url: '/pages/teacher/login/login'
+					})
+				}
 			},
 			},
 		}
 		}
 	}
 	}

+ 293 - 116
pages/teacher/myClass/classDetails.vue

@@ -1,86 +1,197 @@
 <template>
 <template>
 	<view>
 	<view>
-		<u-navbar title="芭蕾舞新生班"></u-navbar>
-		<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" active-color="#1CBECA" bar-width="100"></u-tabs>
+		<u-navbar :title="classDetail.className"></u-navbar>
+		<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" active-color="#1CBECA"
+			bar-width="100"></u-tabs>
 		<view class="content-1" v-if="this.current==0">
 		<view class="content-1" v-if="this.current==0">
 			<u-cell-group>
 			<u-cell-group>
-				<u-cell-item  title="所属学部" value="文艺部" :arrow="false"></u-cell-item>
-				<u-cell-item  title="所属项目中心" value="中国舞项目中心"  :arrow="false"></u-cell-item>
-				<u-cell-item  title="上课时间" value="周四晚上18:00-19:30周六上午11:20-12:40"  :arrow="false"></u-cell-item>
-				<u-cell-item   title="上课教室" value="二楼舞蹈一教室"  :arrow="false"></u-cell-item>
-				<u-cell-item  title="授课老师" value="夏奕琳"  :arrow="false"></u-cell-item>
-				<u-cell-item  title="咨询电话" value="13872354255"  :arrow="false"></u-cell-item>
-				<u-cell-item  title="学员总数" value="20人"  :arrow="false"></u-cell-item>
+				<!-- <u-cell-item title="所属学部" value="文艺部" :arrow="false"></u-cell-item> -->
+				<u-cell-item title="所属课程项目" :value="classDetail.courseSortName" :arrow="false"></u-cell-item>
+				<!-- <u-cell-item title="上课时间" value="周四晚上18:00-19:30周六上午11:20-12:40" :arrow="false"></u-cell-item> -->
+				<u-cell-item title="上课教室" :value="classDetail.className" :arrow="false"></u-cell-item>
+				<u-cell-item title="授课老师" :value="classDetail.teacherNames" :arrow="false"></u-cell-item>
+				<u-cell-item title="咨询电话" :value="classDetail.consultPhone" :arrow="false"></u-cell-item>
+				<u-cell-item title="学员总数" :value="classDetail.crtStudentCount+'人'" :arrow="false"></u-cell-item>
 			</u-cell-group>
 			</u-cell-group>
 		</view>
 		</view>
-		
+
 		<view class="content-2" v-if="this.current==1">
 		<view class="content-2" v-if="this.current==1">
 			<view class="search">
 			<view class="search">
-				<u-search placeholder="搜索班级/一对一学员" action-text="查询"></u-search>
-  				 </view>
-				<view class="student-details" @click="gotoUrl('pages/teacher/myClass/studentDetails')">
-					<view class="photo">
-						<img src="../../../assets/img/photo@1x.png" alt="">
-					</view>
-					<view class="details">
-						<view class="name-tel">
-							<view class="name">
-								王紫瑄
-							</view>
-							<view class="tel">
-								<img src="../../../assets/img/riLine-smartphone-line@1x.png" alt=""><view class="">17700112233
-									
-								</view>
+				<u-search v-model="queryName" placeholder="搜索学员姓名" action-text="查询"
+				 @custom="queryStudent"></u-search>
+			</view>
+			<!-- <view class="student-details" @click="gotoUrl('pages/teacher/myClass/studentDetails')">
+				<view class="photo">
+					<img src="../../../assets/img/photo@1x.png" alt="">
+				</view>
+				<view class="details">
+					<view class="name-tel">
+						<view class="name">
+							王紫瑄
+						</view>
+						<view class="tel">
+							<img src="../../../assets/img/riLine-smartphone-line@1x.png" alt="">
+							<view class="">17700112233
+
 							</view>
 							</view>
 						</view>
 						</view>
-						
-					</view>
-					<view class="more">
-						<u-icon name="arrow-right" color="#cccccc"></u-icon>
 					</view>
 					</view>
+
 				</view>
 				</view>
-				<view class="student-details">
+				<view class="more">
+					<u-icon name="arrow-right" color="#cccccc"></u-icon>
+				</view>
+			</view> -->
+			<view class="student-card" v-for="(item,index) in studentList" :key="index">
+				<!-- <view class="title">
+					<view><img src="../../../assets/img/fas fa-graduation-cap@1x.png" alt=""></view>
+					<view>
+						学员详情
+					</view>
+				</view> -->
+				<view class="details">
 					<view class="photo">
 					<view class="photo">
 						<img src="../../../assets/img/photo@1x.png" alt="">
 						<img src="../../../assets/img/photo@1x.png" alt="">
 					</view>
 					</view>
-					<view class="details">
-						<view class="name-tel">
-							<view class="name">
-								王紫瑄
+					<view class="information">
+						<view class="name">
+							{{item.studentName}}
+						</view>
+						<view class="item">
+							<view class="item-name">
+								年龄
 							</view>
 							</view>
-							<view class="tel">
-								<img src="../../../assets/img/riLine-smartphone-line@1x.png" alt=""><view class="">17700112233
-									
-								</view>
+							<view class="item-content">
+								<!-- {{getAge(item.birthday)}} -->
 							</view>
 							</view>
 						</view>
 						</view>
-						
-					</view>
-					<view class="more">
-						<u-icon name="arrow-right" color="#cccccc"></u-icon>
+						<view class="item">
+							<view class="item-name">
+								联系人手机号
+							</view>
+							<view class="item-content">
+								{{item.firstContactPhone}}
+							</view>
+						</view>
+						<view class="item">
+							<view class="item-name">
+								第二联系人手机号
+							</view>
+							<view class="item-content">
+								{{item.secondContactPhone}}
+							</view>
+						</view>
+						<view class="item">
+							<view class="item-name">
+								接送家长姓名
+							</view>
+							<view class="item-content">
+								{{item.takerName}}
+							</view>
+						</view>
+
 					</view>
 					</view>
+
 				</view>
 				</view>
-			
+			</view>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import * as myClassApi from '@/apis/teacher/myClass.js'
+	
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
 				list: [{
 				list: [{
 					name: '班级信息'
 					name: '班级信息'
-				},  {
+				}, {
 					name: '学员信息',
 					name: '学员信息',
 				}],
 				}],
-				current: 0
+				current: 0,
+				classId: '',
+				queryName: '',
+				classDetail: {},
+				studentList: [],
 			}
 			}
 		},
 		},
 		onLoad(op) {
 		onLoad(op) {
-			console.log(op)
+			if(op.id) {
+				this.classId = op.id;
+				this.getLoadMyClass();
+				this.getLoadClassStudents();
+			}
 		},
 		},
 		methods: {
 		methods: {
+			queryStudent() {
+				this.getLoadClassStudents();
+			},
+			getAge(str) {
+				var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
+				if (r == null) return false;
+				var d = new Date(r[1], r[3] - 1, r[4]);
+				if (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4]) {
+					var date = new Date();
+					var Y = date.getFullYear() - r[1];
+					var M = date.getMonth() + 1 - r[3];
+					var D = date.getDate();
+					if (parseInt(D) - parseInt(r[4]) < 0) {
+						M--;
+						if (M < 0) {
+							Y--;
+							M = 11;
+						}
+					}
+					if (M < 0) {
+						Y--;
+						M = 11;
+					}
+					if(Y != 0 && M != 0) {
+						return (Y + "岁" + M + "个月");
+					}else if(Y != 0 && M == 0) {
+						return (Y + "岁");
+					}else {
+						return (M + "个月");
+					}
+				}
+				return ("输入的日期格式错误!");
+			},
+			getLoadClassStudents() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				myClassApi.loadClassStudents({
+					classId: this.classId,
+					queryName: this.queryName
+				}).then((res) => {
+					uni.hideLoading();
+					this.studentList = res.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getLoadMyClass() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				myClassApi.loadMyClass({
+					classId: this.classId
+				}).then((res) => {
+					uni.hideLoading();
+					this.classDetail = res.data[0];
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			change(index) {
 			change(index) {
 				this.current = index;
 				this.current = index;
 			},
 			},
@@ -89,84 +200,150 @@
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-	/deep/.u-tab-item{
-		color: #101010 !important;
-	}
-	/deep/.u-cell_title{
-			color: rgba(119, 119, 119, 1);
+	.student-card{
+		margin: 24rpx 32rpx;
+		padding: 2rpx 32rpx 0rpx 32rpx; 
+		background-color: #fff;
+		border-radius: 12px;
+		.title{
+			display: flex;
+			align-items: center;
+			color: rgba(51, 51, 51, 1);
+			font-weight: bold;
+			img{
+				vertical-align: middle;
+				margin-right: 16rpx;
+			}
 		}
 		}
-		/deep/.u-cell__value{
-			color: #333333;
-			flex: 0.45;
-			margin-left: auto;
+		.details{
+			margin-top: 40rpx;
+			display: flex;
+			.photo{
+				width: 80px;
+				height: 80px;
+				border-radius: 8px;
+				margin-right: 32rpx;
+			   overflow: hidden;
+				img{
+					width: 100%;
+					height: 100%;
+				}
+			}
 		}
 		}
-.search{
+		.information{
+			.name{
+				color: rgba(51, 51, 51, 1);
+				font-size: 18px;
+				font-weight: bold;
+				margin-bottom: 20rpx;
+			}
+			.item{
+				display: flex;
+				margin-bottom: 16rpx;
+				justify-content: space-between;
+				.item-name{
+					color: rgba(119, 119, 119, 1);
+				}
+				.item-content{
+					color: rgba(51, 51, 51, 1);
+					margin-left: 16rpx;
+				}
+				
+			}
+			
+		}
+	}
+	
+	/deep/.u-tab-item {
+		color: #101010 !important;
+	}
+
+	/deep/.u-cell_title {
+		color: rgba(119, 119, 119, 1);
+	}
+
+	/deep/.u-cell__value {
+		color: #333333;
+		flex: 0.45;
+		margin-left: auto;
+	}
+
+	.search {
 		// background-color: #fff;
 		// background-color: #fff;
 		padding: 8px 12px;
 		padding: 8px 12px;
 	}
 	}
-	/deep/.u-action{
-		   width: 17.1%;
-		   text-align: center;
-		   line-height: 28px;
-		   border-radius: 50px;
-		   background-color: rgba(13, 186, 199, 1);
-		   color: rgba(255, 255, 255, 1);
+
+	/deep/.u-action {
+		width: 17.1%;
+		text-align: center;
+		line-height: 28px;
+		border-radius: 50px;
+		background-color: rgba(13, 186, 199, 1);
+		color: rgba(255, 255, 255, 1);
 	}
 	}
-	/deep/.u-content{
-		   background-color: #fff !important;
+
+	/deep/.u-content {
+		background-color: #fff !important;
 	}
 	}
-	/deep/.u-input{
-		   background-color: #fff !important;
+
+	/deep/.u-input {
+		background-color: #fff !important;
 	}
 	}
-	
-	.student-details{
-		   padding: 12px 16px;
-		   background-color: #fff;
-		   display: flex;
-		   position: relative;
-		   border-bottom:  1px solid rgba(229, 231, 234, 1);;
-		   .photo{
-			   width: 56px;
-			   height: 56px;
-			   border-radius: 4px;
-			   overflow: hidden;
-			   margin-right: 11px;
-			   img{
-				   width: 100%;
-				   height: 100%;
-			   }
-		   }
-		   .details{
-			   display: flex;
-			   align-items: center;
-
-			   .name-tel{
-				   
-				   
-				   .name{
-					   margin-right: 12px;
-					   color: rgba(51, 51, 51, 1);
-					   font-size: 18px;
-					   margin-bottom: 16rpx;
-				   }
-				   .tel{
-					   color: rgba(119, 119, 119, 1);
-	                   // line-height: 24px;
-					   display: flex;
-					   align-items: center;
-					  
 
 
-	
-				   }
-				   
-			   }
-			  
-		   }
-		   .more{
-		   			    color: #333333;
-					   position: absolute;
-					   bottom: 65rpx;
-					   right: 24rpx;
-		   }
+	.student-details {
+		padding: 12px 16px;
+		background-color: #fff;
+		display: flex;
+		position: relative;
+		border-bottom: 1px solid rgba(229, 231, 234, 1);
+		;
+
+		.photo {
+			width: 56px;
+			height: 56px;
+			border-radius: 4px;
+			overflow: hidden;
+			margin-right: 11px;
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		.details {
+			display: flex;
+			align-items: center;
+
+			.name-tel {
+
+
+				.name {
+					margin-right: 12px;
+					color: rgba(51, 51, 51, 1);
+					font-size: 18px;
+					margin-bottom: 16rpx;
+				}
+
+				.tel {
+					color: rgba(119, 119, 119, 1);
+					// line-height: 24px;
+					display: flex;
+					align-items: center;
+
+
+
+				}
+
+			}
+
+		}
+
+		.more {
+			color: #333333;
+			position: absolute;
+			bottom: 65rpx;
+			right: 24rpx;
+		}
 	}
 	}
 </style>
 </style>

+ 126 - 127
pages/teacher/myClass/myClass.vue

@@ -2,104 +2,98 @@
 	<view>
 	<view>
 		<u-navbar title="我的班级"></u-navbar>
 		<u-navbar title="我的班级"></u-navbar>
 		<view class="main">
 		<view class="main">
-
-			
-			<view class="details-box" @click="gotoUrl('pages/teacher/myClass/classDetails')">
+			<view class="details-box" v-for="(item,index) in classList" :key="index"
+				@click="gotoUrl('pages/teacher/myClass/classDetails?id=' + item.classId)">
 				<view class="title-box">
 				<view class="title-box">
 					<view class="title">
 					<view class="title">
-						芭蕾舞新生班
+						{{item.className}}
 					</view>
 					</view>
 					<view class="location-time">
 					<view class="location-time">
 						<view class="location">
 						<view class="location">
-							文艺部
+							{{item.courseSortName}}
 						</view>
 						</view>
-						<view class="location">
+						<!-- <view class="location">
 							文艺部
 							文艺部
-						</view>
-					
+						</view> -->
 					</view>
 					</view>
 				</view>
 				</view>
-				
-				
 				<view class="number">
 				<view class="number">
-					学员数 <text>1</text><u-icon name="arrow-right"></u-icon>
+					学员数 <text>{{item.crtStudentCount}}</text>
+					<u-icon name="arrow-right"></u-icon>
 				</view>
 				</view>
-				
 			</view>
 			</view>
-			<view class="details-box">
-				<view class="title-box">
-					<view class="title">
-						芭蕾舞八级一对一考级班
-					</view>
-					<view class="location-time">
-						<view class="location">
-							文艺部
-						</view>
-						<view class="location">
-							文艺部
-						</view>
-					
-					</view>
-				</view>
-				
-				
-				<view class="number">
-					学员数 <text>1</text><u-icon name="arrow-right"></u-icon>
-				</view>
-				
-			</view>
-			
 		</view>
 		</view>
-		<u-divider>没有更多数据了</u-divider>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import * as myClassApi from '@/apis/teacher/myClass.js'
+
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-				
+				classList: []
 			}
 			}
 		},
 		},
+		onReady() {
+			this.getLoadMyClass();
+		},
 		methods: {
 		methods: {
-			
+			getLoadMyClass() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				myClassApi.loadMyClass().then((res) => {
+					uni.hideLoading();
+					this.classList = res.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-	
-   /deep/.u-action{
-	   width: 17.1%;
-	   text-align: center;
-	   line-height: 28px;
-	   border-radius: 50px;
-	   background-color: rgba(13, 186, 199, 1);
-	   color: rgba(255, 255, 255, 1);
-   }
-   /deep/.u-content{
-	   background-color: #F0F4FA !important;
-   }
-   /deep/.u-input{
-	   background-color: #F0F4FA !important;
-   }
-
-.main{
-	
-	padding: 12px 16px ;
-	.details-box{
-		width: 100%;
-		margin-top: 12px;
-		background-color: #fff;
-		padding: 12px ;
-		border-radius: 12px;
-		display: flex;
-		align-items: center;
-		justify-content: space-between;
-		
-			.title-box{
+	/deep/.u-action {
+		width: 17.1%;
+		text-align: center;
+		line-height: 28px;
+		border-radius: 50px;
+		background-color: rgba(13, 186, 199, 1);
+		color: rgba(255, 255, 255, 1);
+	}
+
+	/deep/.u-content {
+		background-color: #F0F4FA !important;
+	}
+
+	/deep/.u-input {
+		background-color: #F0F4FA !important;
+	}
+
+	.main {
+
+		padding: 12px 16px;
+
+		.details-box {
+			width: 100%;
+			margin-top: 12px;
+			background-color: #fff;
+			padding: 12px;
+			border-radius: 12px;
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+
+			.title-box {
 				width: 68%;
 				width: 68%;
-				.title{
+
+				.title {
 					color: rgba(51, 51, 51, 1);
 					color: rgba(51, 51, 51, 1);
 					font-size: 36rpx;
 					font-size: 36rpx;
 					font-weight: bold;
 					font-weight: bold;
@@ -108,75 +102,80 @@
 					overflow: hidden;
 					overflow: hidden;
 					text-overflow: ellipsis;
 					text-overflow: ellipsis;
 				}
 				}
-				
+
 			}
 			}
-			
-		
-		
-		.location-time{
-			display: flex;
-			margin-top: 8px;
-			.location,.time{
-				line-height: 20px;
-				border-radius: 4px;
-				background-color: rgba(241, 243, 244, 1);
-				color: rgba(136, 133, 133, 1);
-                padding: 0px 8px;
-				margin-right: 8px;
-				font-size: 24rpx
+
+
+
+			.location-time {
+				display: flex;
+				margin-top: 8px;
+
+				.location,
+				.time {
+					line-height: 20px;
+					border-radius: 4px;
+					background-color: rgba(241, 243, 244, 1);
+					color: rgba(136, 133, 133, 1);
+					padding: 0px 8px;
+					margin-right: 8px;
+					font-size: 24rpx
+				}
 			}
 			}
 		}
 		}
-	}
-	.number{
-		color: rgba(119, 119, 119, 1);
-		font-size: 32rpx;
-		text-align: right;
-		text{
-			display: inline-block;
-			text-align: center;
-			width: 40rpx;
-			line-height: 40rpx;
-			border-radius: 8rpx;
-			background-color: rgba(13, 186, 199, 1);
-			color: rgba(255, 255, 255, 1);
-			font-size: 28rpx;
-			 margin-left: 8rpx;
-		}
-	}
 
 
-.circumstance{
-	display: flex;
-	margin-top: 8px;
-	.date{
-		color: rgba(51, 51, 51, 1);
-		margin-right: 18px;
-	}
-	.details{
-		display: flex;
-		flex: 1;
-		justify-content: space-between;
-		
-		.details-item{
-			 display: flex;
-			 align-items: center;
-			.num-box{
+		.number {
+			color: rgba(119, 119, 119, 1);
+			font-size: 32rpx;
+			text-align: right;
+
+			text {
 				display: inline-block;
 				display: inline-block;
-				width: 16px;
-				height: 16px;
-				line-height: 16px;
-				border-radius: 4px;
-				background-color: rgba(153, 153, 153, 1);
+				text-align: center;
+				width: 40rpx;
+				line-height: 40rpx;
+				border-radius: 8rpx;
+				background-color: rgba(13, 186, 199, 1);
 				color: rgba(255, 255, 255, 1);
 				color: rgba(255, 255, 255, 1);
-				font-size: 12px;
-				margin-left: 4px;
+				font-size: 28rpx;
+				margin-left: 8rpx;
 			}
 			}
 		}
 		}
-	}
-}
 
 
+		.circumstance {
+			display: flex;
+			margin-top: 8px;
+
+			.date {
+				color: rgba(51, 51, 51, 1);
+				margin-right: 18px;
+			}
 
 
+			.details {
+				display: flex;
+				flex: 1;
+				justify-content: space-between;
 
 
-}
+				.details-item {
+					display: flex;
+					align-items: center;
 
 
+					.num-box {
+						display: inline-block;
+						width: 16px;
+						height: 16px;
+						line-height: 16px;
+						border-radius: 4px;
+						background-color: rgba(153, 153, 153, 1);
+						color: rgba(255, 255, 255, 1);
+						font-size: 12px;
+						margin-left: 4px;
+					}
+				}
+			}
+		}
 
 
+
+
+	}
 </style>
 </style>