wkyy 2 years ago
parent
commit
25003856dc

+ 20 - 0
apis/parents/sickNote.js

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

+ 41 - 9
pages/parents/classSchedule/classScheduleDetails.vue

@@ -22,17 +22,24 @@
 			</u-cell-group>
 		</view>
 
-		<!-- <view class="main">
-				<u-cell-group>
-					<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-group>
-			</view> -->
-
-		<view class="bottom">
-			<button>请假</button>
+		<view class="main">
+			<u-cell-group>
+				<u-cell-item  title="打卡签到" :value="rollcallLogs.rollcall" :arrow="false"></u-cell-item>
+				<u-cell-item  title="签到时间" :value="rollcallLogs.rollcallTime"  :arrow="false"></u-cell-item>
+			</u-cell-group>
 		</view>
 
+		<!-- <view class="bottom" v-if="rollcallLogs != null">
+			<button style="background-color: #DBDBDB" v-if="rollcallLogs.rollcallResult == '1'" disabled>
+				已上课
+			</button>
+			<button style="background-color: #DBDBDB" v-if="rollcallLogs.rollcallResult == '2'" disabled>
+				已请假
+			</button>
+		</view> -->
+		<!-- <view class="bottom" v-else>
+			<button @click="askForLeave">请假</button>
+		</view> -->
 	</view>
 </template>
 
@@ -45,6 +52,11 @@
 				studentId: '',
 				scheduleId: '',
 				detail: {},
+				rollcallLogs: {
+					rollcall: '',
+					rollcallResult: '',
+					rollcallTime: ''
+				}
 			}
 		},
 		onLoad(op) {
@@ -57,6 +69,9 @@
 			}
 		},
 		methods: {
+			askForLeave() {
+				
+			},
 			getCourseDetail() {
 				uni.showLoading({
 					title: "加载中",
@@ -68,6 +83,23 @@
 				}).then((response) => {
 					uni.hideLoading();
 					this.detail = response.data.scheduleDtl;
+					if(response.data.rollcallLogs != null) {
+						this.rollcallLogs = response.data.rollcallLogs;
+						var date = new Date(response.data.rollcallLogs.rollcallTime);
+						var hour = date.getHours();
+						var minute = date.getMinutes();
+						var second = date.getSeconds();
+						if(hour < 10) {
+							hour = '0' + hour;
+						}
+						if(minute < 10) {
+							minute = '0' + hour;
+						}
+						if(second < 10) {
+							second = '0' + hour;
+						}
+						this.rollcallLogs.rollcallTime = hour + ':' + minute + ':' + second;
+					}
 				}).catch(error => {
 					uni.showToast({
 						title: error,

+ 41 - 11
pages/parents/homePage/homePage.vue

@@ -36,7 +36,7 @@
 						课程表
 					</view>
 				</view>
-				<view class="item">
+				<view class="item" @click="toSickNote">
 					<view class="icon-box"
 						style="background: linear-gradient(180deg, rgba(169,147,255,1) 1%,rgba(129,97,255,1) 100%);">
 						<img src="../../../assets/img/riFill-quill-pen-fill@1x.png" alt="">
@@ -177,27 +177,33 @@
 				</view>
 				<view class="infos">
 					<view class="name">
-						{{item.courseName}}
+						{{item.className}}
 					</view>
 					<view class="tips">
-						<view class="item">
+						<view class="item" v-if="item.courseDesc != null">
 							{{item.courseDesc}}
 						</view>
-						<!-- <view class="item">
-							思维训练
-						</view> -->
+						<view class="item" v-else>
+							暂无简介
+						</view>
 					</view>
 					<view class="teacher-price">
 						<view class="teacher">
 							<view class="photo">
+								<img src="../../../assets/img/teacher.png" alt="">
+							</view>
+							<view class="name">
+								{{item.teacherName}}
+							</view>
+							<view class="img">
 								<img src="../../../assets/img/riLine-smartphone-line@1x.png" alt="">
 							</view>
-							<view class="name" style="font-size: 14px;">
+							<view>
 								{{item.consultPhone}}
 							</view>
 						</view>
 						<!-- <view class="price">
-							低至30元/课
+							
 						</view> -->
 					</view>
 				</view>
@@ -332,6 +338,18 @@
 					})
 				}
 			},
+			toSickNote() {
+				if(this.studentId) {
+					uni.navigateTo({
+						url: '/pages/parents/sickNote/sickNote'
+					})
+				} else{
+					uni.showToast({
+						title: "请先去'我的'中完善'我的子女'",
+						icon: "none"
+					})
+				}
+			},
 			toMyCourses() {
 				if(this.studentId) {
 					uni.navigateTo({
@@ -752,8 +770,8 @@
 						align-items: center;
 
 						.photo {
-							width: 20px;
-							height: 20px;
+							width: 32px;
+							height: 32px;
 							border-radius: 50px;
 							overflow: hidden;
 							margin-right: 8px;
@@ -763,10 +781,22 @@
 								height: 100%;
 							}
 						}
+						
+						.img {
+							width: 32rpx;
+							height: 32rpx;
+							margin-left: 16rpx;
+						
+							img {
+								width: 100%;
+								height: 100%;
+						
+							}
+						}
 					}
 
 					.price {
-						color: rgba(255, 61, 0, 1);
+						color: rgba(119, 119, 119, 1);
 					}
 				}
 			}

+ 90 - 205
pages/parents/mine/classRecord.vue

@@ -1,48 +1,49 @@
 <template>
 	<view>
-		<u-navbar title="中国舞十级班">
+		<u-navbar :title="className">
 
 		</u-navbar>
 		<!-- 头部 -->
 		<view class="header">
 			<view class="infos">
 				<view class="title">
-					中国舞十级班
+					{{className}}
 				</view>
 				<view class="times">
-					已上 10 节 / 共 36 课次
+					已上 {{classTimes}} 节 / 共 {{allClassTimes}} 课次
 				</view>
 
 			</view>
-			<view class="state">
+			<view class="state" v-if="status=='1' || status=='5'">
 				进行中
 			</view>
+			<view class="stateClose" v-if="status=='2'">
+				已结课
+			</view>
 
 		</view>
 		<!-- 课次 -->
 		<view class="class-times">
 
-			<view class="item-box" v-for="(item,index) in classList" :key="index">
+			<view class="item-box" v-for="(item,index) in classList" :key="index"	@click="toDetail(item)">
 				<view class="item">
 					<view class="class">
-
-						课程&nbsp;{{item.id + 1}}
+						课程&nbsp;{{index+1}}
 					</view>
-					<!-- <view
-						:class="{state0:item.state==0,state1:item.state==1,state2:item.state==2,state3:item.state==3,state4:item.state==4}">
-						{{item.text}}
-					</view> -->
-					<view class="state0" v-if="item.state == 0">
-						{{item.text}}
+					<view class="state0" v-if="item.rollcall == ''">
+						{{item.rollcall}}
 					</view>
-					<view class="state1" v-if="item.state == 1">
-						{{item.text}}
+					<view class="state2" v-if="item.rollcall == '到课'">
+						{{item.rollcall}}
 					</view>
-					<view class="state2" v-if="item.state == 2">
-						{{item.text}}
+					<view class="state4" v-if="item.rollcall == '请假'">
+						{{item.rollcall}}
 					</view>
-					<view class="state3" v-if="item.state == 3">
-						{{item.text}}
+					<view class="state3" v-if="item.rollcall == '旷课'">
+						{{item.rollcall}}
+					</view>
+					<view class="state1" v-if="item.rollcall == '停课'">
+						{{item.rollcall}}
 					</view>
 					<view class="boder-right">
 
@@ -63,199 +64,65 @@
 		data() {
 			return {
 				buyId: '',
-				classList: [{
-						id: 0,
-						class: "课程1",
-						state: 1,
-						text: "停课"
-					},
-					{
-						id: 1,
-						state: 1,
-						text: "停课"
-					},
-					{
-						id: 2,
-						state: 1,
-						text: "停课"
-					},
-					{
-						id: 3,
-						state: 1,
-						text: "停课"
-					},
-					{
-						id: 4,
-						state: 1,
-						text: "停课"
-					},
-					{
-						id: 5,
-						state: 1,
-						text: "停课"
-					},
-					{
-						id: 6,
-						state: 2,
-						text: "到课"
-					},
-					{
-						id: 7,
-						state: 3,
-						text: "旷课"
-					},
-					{
-						id: 8,
-						state: 4,
-						text: "请假"
-					},
-					{
-						id: 9,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 10,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 11,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 12,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 13,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 14,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 15,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 16,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 17,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 18,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 19,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 20,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 21,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 22,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 23,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 24,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 25,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 26,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 27,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 28,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 29,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 30,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 31,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 32,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 33,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 34,
-						state: 0,
-						text: ""
-					},
-					{
-						id: 35,
-						state: 0,
-						text: ""
-					},
-
-				]
-
+				classList: [],
+				allClassTimes: 0,
+				classTimes: 0,
+				className: '',
+				status: '',
+				studentId: ''
 			}
 		},
 		onLoad(op) {
 			if(op.id) {
 				this.buyId = op.id;
-				this.getLoadCourseRollcall();
+				this.studentId = this.carhelp.getStudentId().studentId;
+				this.getLoadMyCourses();
 			}
 		},
 		methods: {
+			toDetail(item) {
+				if(item.id) {
+					uni.navigateTo({
+						url: '/pages/parents/classSchedule/classScheduleDetails?id='+item.id
+					})
+				}
+			},
+			getLoadMyCourses() {
+				this.classList = [];
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				mineApi.loadMyCourses({
+					studentId: this.studentId,
+					pageNum: 1,
+					pageSize: 10000
+				}).then((res) => {
+					uni.hideLoading();
+					var list = res.data.data;
+					for (var i = 0; i < list.length; i++) {
+						if(list[i].buyId == this.buyId) {
+							this.allClassTimes = list[i].courseAmount+list[i].freeAmount;
+							if(list[i].rollcallCount != null) {
+								this.classTimes = list[i].rollcallCount;
+							}
+							this.className = list[i].className;
+							this.status = list[i].status;
+						}
+					}
+					
+					for (var i = 0; i < this.allClassTimes; i++) {
+						this.classList.push({id: '',rollcall: ''});
+					}
+					
+					this.getLoadCourseRollcall();
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 			getLoadCourseRollcall() {
 				uni.showLoading({
 					title: "加载中",
@@ -265,7 +132,11 @@
 					buyId: this.buyId
 				}).then((res) => {
 					uni.hideLoading();
-					// this.courseList = res.data;
+					var list = res.data;
+					for (var i = 0; i < list.length; i++) {
+						this.classList[i].rollcall = list[i].rollcall;
+						this.classList[i].id = list[i].sheetId;
+					}
 				}).catch(error => {
 					uni.showToast({
 						title: error,
@@ -316,6 +187,20 @@
 			height: 48rpx;
 			line-height: 48rpx;
 		}
+		
+		.stateClose {
+			margin-left: auto;
+			border-radius: 8rpx;
+			background-color: rgba(13, 186, 199, 1);
+			color: rgba(255, 255, 255, 1);
+			font-size: 24rpx;
+			text-align: center;
+			font-family: Arial;
+			border: 1px solid rgba(255, 255, 255, 1);
+			width: 100rpx;
+			height: 48rpx;
+			line-height: 48rpx;
+		}
 	}
 
 	// 课次

+ 6 - 2
pages/parents/mine/myCourses.vue

@@ -41,10 +41,10 @@
 						{{item.teacherName}}
 					</view>
 					<view class="progress">
-						<u-line-progress :percent="20/(item.courseAmount+item.freeAmount)*100" :show-percent="false" active-color="#43C9D3">
+						<u-line-progress :percent="item.rollcallCount/(item.courseAmount+item.freeAmount)*100" :show-percent="false" active-color="#43C9D3">
 						</u-line-progress>
 						<view class="percent">
-							20/{{item.courseAmount+item.freeAmount}}
+							{{item.rollcallCount!= null ? item.rollcallCount : '0'}}/{{item.courseAmount+item.freeAmount}}
 						</view>
 					</view>
 				</view>
@@ -142,9 +142,13 @@
 				justify-content: space-between;
 
 				.text {
+					width: 70%;
 					color: rgba(51, 51, 51, 1);
 					font-size: 16px;
 					font-weight: bold;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+					overflow: hidden;
 				}
 
 				.state {

+ 171 - 68
pages/parents/sickNote/leave.vue

@@ -1,160 +1,260 @@
 <template>
 	<view>
-		<u-navbar title="请假条详情"></u-navbar>
+		<u-navbar title="请假条申请"></u-navbar>
 		<view class="infos">
-			<view class="item">
+			<view class="item" @click="classShow=true">
 				<view class="title">
 					<text class="asterisk">*</text>
 					<text>所属班级</text>
 				</view>
-				
 				<view class="value">
-					<text>郭健康毛笔楷书班</text>
-					<text class="icon"><u-icon name="arrow-right" color="#c8c8c8"></u-icon></text>
+					<text>{{className}}</text>
+					<text class="icon">
+						<u-icon name="arrow-right" color="#c8c8c8"></u-icon>
+					</text>
 				</view>
-				
 			</view>
-			<view class="item">
+			<u-select v-model="classShow" mode="single-column" :list="classList" @confirm="classConfirm"></u-select>
+			
+			<view class="item" @click="courseShow=true">
 				<view class="title">
 					<text class="asterisk">*</text>
-					<text>请假日期</text>
+					<text>请假课次日期</text>
 				</view>
-				
 				<view class="value">
 					<text>2023-01-03 周一</text>
-					<text class="icon"><u-icon name="arrow-right" color="#c8c8c8"></u-icon></text>
+					<text class="icon">
+						<u-icon name="arrow-right" color="#c8c8c8"></u-icon>
+					</text>
 				</view>
-				
 			</view>
-			<view class="item">
+			<u-select v-model="courseShow" mode="mutil-column-auto" :list="courseList" @confirm="courseConfirm"></u-select>
+			<!-- <view class="item">
 				<view class="title indent">
-					
 					<text>请假课次</text>
 				</view>
-				
 				<view class="value">
 					<text>第20节</text>
-					
 				</view>
-				
-			</view>
+			</view> -->
 			<view class="item">
 				<view class="title indent">
-					
 					<text>授课老师</text>
 				</view>
-				
 				<view class="value">
-					<text>郭健康</text>
-					
+					<text>{{teacherName}}</text>
 				</view>
-				
 			</view>
-			
 		</view>
-		
+
 		<view class="infos">
-			<view class="item">
+			<!-- <view class="item">
 				<view class="title">
 					<text class="asterisk">*</text>
 					<text>请假类型</text>
 				</view>
-				
 				<view class="value">
 					<text>病假</text>
-					<text class="icon"><u-icon name="arrow-right" color="#c8c8c8"></u-icon></text>
+					<text class="icon">
+						<u-icon name="arrow-right" color="#c8c8c8"></u-icon>
+					</text>
 				</view>
-				
-			</view>
-			
+			</view> -->
 			<view class="reason">
 				<view class="title">
 					<text class="asterisk">*</text>
 					<text>请假事由</text>
 				</view>
-				
 				<view class="value">
 					<textarea name="" id="" cols="30" rows="10" placeholder="请假申请"></textarea>
 				</view>
-				
 			</view>
-			<view class="upload-pictures">
+			<!-- <view class="upload-pictures">
 				<view class="title indent">
-					
 					<text>上传图片</text>
 				</view>
-				
 				<view class="value ">
 					<img src="../../../assets/img/fas fa-camera Copy@1x.png" alt="">
 				</view>
-				
-			</view>
-			
+			</view> -->
+		</view>
+
+		<view class="btn">
+			<button>提交请假条</button>
 		</view>
-		
-		
-		
-	
-	   <view class="btn">
-	   	   <button >提交请假条</button>
-	   </view>
 	</view>
 </template>
 
 <script>
+	import * as sickNoteApi from '@/apis/parents/sickNote.js'
+	import * as courseApi from '@/apis/parents/course.js'
+	import * as classScheduleApi from '@/apis/parents/classSchedule.js'
+	
 	export default {
 		data() {
 			return {
-				
+				studentId: '',
+				classList: [],
+				classShow: false,
+				teacherName: '请选择班级',
+				className: '请选择班级',
+				courseList: [],
+				classId: '',
+				list: [],
+				courseShow: false
+			}
+		},
+		onReady() {
+			if (this.carhelp.getStudentId()) {
+				this.studentId = this.carhelp.getStudentId().studentId;
+				this.getLoadMyBuyLog();
 			}
 		},
 		methods: {
-			
+			courseConfirm(e) {
+				console.log(e)
+			},
+			getCourseList() {
+				this.courseList = [];
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				classScheduleApi.loadMySchedule({
+					studentId: this.studentId,
+					classId: this.classId,
+					startDate: '2023-02-24',
+					endDate: '2023-03-31'
+				}).then((response) => {
+					uni.hideLoading();
+					var list = response.data;
+					
+					for (var i = 0; i < list.length; i++) {
+						this.courseList.push({
+							value: list[i].classId,
+							label: list[i].courseDate,
+							children: []
+						})
+						for (var j = 0; j < this.courseList.length; j++) {
+							if(this.courseList[j].label == list[i].courseDate) {
+								this.courseList[j].children.push({
+									value: list[i].sheetId,
+									label: list[i].coursePeriods
+								})
+							}
+						}
+					}
+					
+					for (var i = 0; i < this.courseList.length; i++) {
+						for (var j = 0; j < this.courseList.length; j++) {
+							if(this.courseList[i].label == this.courseList[j].label && i != j) {
+								if(this.courseList[i].children.length > this.courseList[j].children.length) {
+									this.courseList.splice(j, 1);
+								} else {
+									this.courseList.splice(i, 1);
+								}
+							}
+						}
+					}
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			classConfirm(e) {
+				this.classId = e[0].value;
+				this.className = e[0].label;
+				for (var i = 0; i < this.list.length; i++) {
+					if(this.list[i].classId == e[0].value) {
+						this.teacherName = this.list[i].teacherName;
+					}
+				}
+				this.getCourseList();
+			},
+			getLoadMyBuyLog() {
+				this.classList = [];
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				courseApi.loadMyBuyLog({
+					studentId: this.studentId,
+					year: '',
+					courseId: '',
+					pageNum: 1,
+					pageSize: 10000
+				}).then((res) => {
+					uni.hideLoading();
+					this.list = res.data.data;
+					var clist = res.data.data;
+					for (var i = 0; i < clist.length; i++) {
+						this.classList.push({
+							value: clist[i].classId,
+							label: clist[i].className,
+						});
+					}
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	.infos{
-		padding: 0px 15px ;
+	.infos {
+		padding: 0px 15px;
 		background-color: #fff;
 		margin-bottom: 12px;
-		.item{
+
+		.item {
 			display: flex;
 			justify-content: space-between;
 			border-bottom: 1px solid rgba(244, 244, 244, 1);
 			padding: 12px 0;
-			.title{
+
+			.title {
 				color: #333333;
-				
-				.asterisk{
+
+				.asterisk {
 					color: rgba(244, 68, 68, 1);
 				}
 			}
-			.value{
+
+			.value {
 				color: rgba(51, 51, 51, 1);
-				.icon{
+
+				.icon {
 					margin-left: 4px;
 				}
-				
-				
+
+
 			}
-			
+
 		}
-		.reason{
-			.title{
+
+		.reason {
+			.title {
 				margin-bottom: 12px;
 			}
-			uni-textarea{
+
+			uni-textarea {
 				width: 696rpx;
 				height: 120rpx;
 				text-indent: 8px;
 				font-size: 14px
 			}
 		}
-		.upload-pictures{
+
+		.upload-pictures {
 			padding-bottom: 29px;
-			.value{
+
+			.value {
 				margin-top: 12px;
 				width: 120rpx;
 				height: 120rpx;
@@ -163,24 +263,28 @@
 				text-align: center;
 				padding: 36rpx;
 				margin-left: 20rpx;
-				img{
+
+				img {
 					width: 48rpx;
 					height: 48rpx;
 				}
 			}
 		}
 	}
-	.indent{
+
+	.indent {
 		text-indent: 8px;
 	}
-	.btn{
+
+	.btn {
 		position: fixed;
 		left: 0;
 		right: 0;
 		bottom: 0;
 		padding: 10px 12px;
 		background-color: #fff;
-		button{
+
+		button {
 			border-radius: 50px;
 			background-color: rgba(13, 186, 199, 1);
 			color: rgba(255, 255, 255, 1);
@@ -188,5 +292,4 @@
 			line-height: 40px;
 		}
 	}
-	
 </style>

+ 159 - 94
pages/parents/sickNote/sickNote.vue

@@ -2,130 +2,195 @@
 	<view>
 		<u-navbar title="请假"></u-navbar>
 		<view class="main">
-			<view class="sick-note">
+			<view class="sick-note" v-for="(item,index) in leaveList" :key="index">
 				<view class="head">
 					<view class="name">
-						周梓轩的请假条
+						{{item.studentName}}的请假条
 					</view>
-					<view class="state">
-						待查收
+					<view class="state1" v-if="item.status == 0">
+						待处理
 					</view>
-				</view>
-				<view class="infos">
-					<view class="class">
-						郭健康毛笔楷书班
+					<view class="state2" v-if="item.status == 1">
+						已审核
 					</view>
-					<view class="date">
-						2023-01-03
-					</view>
-					
-				</view>
-				
-			</view>
-			
-			<view class="sick-note">
-				<view class="head">
-					<view class="name">
-						王紫瑄的请假条
-					</view>
-					<view class="state checked">
-						已查收
+					<view class="state3" v-if="item.status == -1">
+						已取消
 					</view>
 				</view>
 				<view class="infos">
 					<view class="class">
-						夏奕琳芭蕾舞新生班
+						{{item.className}}
 					</view>
 					<view class="date">
-						2023-01-03
+						{{item.createTime.slice(0,10)}}
 					</view>
-					
 				</view>
-				
 			</view>
-			
 		</view>
-		
-		
+
 		<view class="bottom">
-			<button>请假</button>
-			
+			<button @click="toLeave">请假</button>
 		</view>
 	</view>
 </template>
 
 <script>
+	import * as sickNoteApi from '@/apis/parents/sickNote.js'
+
 	export default {
 		data() {
 			return {
-				
+				leaveList: [],
+				pageNum: 1,
+				pageSize: 10,
+				recordsTotal: 0,
+				years: '',
+				studentId: ''
+			}
+		},
+		onReady() {
+			if (this.carhelp.getStudentId()) {
+				this.studentId = this.carhelp.getStudentId().studentId;
+				this.getLeaveList();
+			}
+		},
+		onReachBottom() {
+			if (this.leaveList.length < this.recordsTotal) {
+				this.myLoadmore();
 			}
 		},
 		methods: {
-			
+			toLeave() {
+				uni.navigateTo({
+					url: '/pages/parents/sickNote/leave'
+				})
+			},
+			myLoadmore() {
+				this.pageNum += 1;
+				this.getLeaveList()
+			},
+			getLeaveList(bl) {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				if (bl) {
+					this.leaveList = [];
+					this.pageNum = 1;
+				}
+				sickNoteApi.loadStudentLeaveLog({
+					studentId: this.studentId,
+					yyyyMM: this.years,
+					pageNum: this.pageNum,
+					pageSize: this.pageSize
+				}).then((res) => {
+					uni.hideLoading();
+					this.leaveList = [
+						...this.leaveList,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	 .main{
-		 padding: 12px;
-		 .sick-note{
-			 padding: 16px 12px;
-			 border-radius: 12px;
-			 background-color: #fff;
-			 margin-bottom: 12px;
-			 .head{
-				 display: flex;
-				 justify-content: space-between;
-				 align-items: center;
-				 .name{
-					 color: rgba(51, 51, 51, 1);
-					 font-size: 16px;
-				 }
-				 .state{
-					 line-height: 24px;
-					 border-radius: 50px;
-					 background-color: rgba(255, 255, 255, 1);
-					 color: rgba(13, 186, 199, 1);
-					 font-size: 12px;
-					 text-align: center;
-					 border: 1px solid rgba(13, 186, 199, 1);
-					 padding: 0 16rpx;
-				 }
-				 .checked{
-					 border: 1px solid rgba(204, 204, 204, 1);
-					 color: rgba(119, 119, 119, 1);
-				 }
-			 }
-			 .infos{
-				 display: flex;
-				 justify-content: space-between;
-				 align-items: center;
-				 margin-top: 8px;
-				 .class{
-					 color: rgba(51, 51, 51, 1);
-				 }
-				 .date{
-					 color: rgba(119, 119, 119, 1);
-				 }
-			 }
-		 }
-	 }
-    
-	 .bottom{
-		 padding: 10px 16px;
-		 background-color: #fff;
-		 position: fixed;
-		 left: 0;
-		 right: 0;
-		 bottom: 0;
-		 button{
-			 border-radius: 50px;
-			 background-color: rgba(13, 186, 199, 1);
-			 color: rgba(255, 255, 255, 1);
-			 font-size: 16px;
-			 line-height: 40px;
-		 }
-	 }
+	.main {
+		padding: 12px;
+
+		.sick-note {
+			padding: 16px 12px;
+			border-radius: 12px;
+			background-color: #fff;
+			margin-bottom: 12px;
+
+			.head {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+
+				.name {
+					color: rgba(51, 51, 51, 1);
+					font-size: 16px;
+				}
+
+				.state1 {
+					line-height: 24px;
+					border-radius: 50px;
+					background-color: rgba(255, 255, 255, 1);
+					color: rgba(22, 119, 255, 1);
+					font-size: 12px;
+					text-align: center;
+					border: 1px solid 1px solid rgba(22, 119, 255, 1);
+					padding: 0 16rpx;
+				}
+				
+				.state2 {
+					line-height: 24px;
+					border-radius: 50px;
+					background-color: rgba(255, 255, 255, 1);
+					color: rgba(0, 187, 170, 1);
+					font-size: 12px;
+					text-align: center;
+					border: 1px solid rgba(0, 187, 170, 1);
+					padding: 0 16rpx;
+				}
+				
+				.state3 {
+					line-height: 24px;
+					border-radius: 50px;
+					background-color: rgba(255, 255, 255, 1);
+					color: rgba(153, 153, 153, 1);
+					font-size: 12px;
+					text-align: center;
+					border: 1px solid 1px solid rgba(153, 153, 153, 1);
+					padding: 0 16rpx;
+				}
+
+				.checked {
+					border: 1px solid rgba(204, 204, 204, 1);
+					color: rgba(119, 119, 119, 1);
+				}
+			}
+
+			.infos {
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				margin-top: 8px;
+
+				.class {
+					color: rgba(51, 51, 51, 1);
+				}
+
+				.date {
+					color: rgba(119, 119, 119, 1);
+				}
+			}
+		}
+	}
+
+	.bottom {
+		padding: 10px 16px;
+		background-color: #fff;
+		position: fixed;
+		left: 0;
+		right: 0;
+		bottom: 0;
+
+		button {
+			border-radius: 50px;
+			background-color: rgba(13, 186, 199, 1);
+			color: rgba(255, 255, 255, 1);
+			font-size: 16px;
+			line-height: 40px;
+		}
+	}
 </style>