wkyy преди 2 години
родител
ревизия
5a056742eb

+ 8 - 0
apis/index.js

@@ -109,6 +109,14 @@ export function logout(data) {
 	})
 }
 
+export function deleteUser (data) {
+	 
+	return request({
+		method: 'get',
+		data:data ,
+		url: '/mobile/regUser/deleteUser'
+	})
+}
 
 export function stopCharging(data) {
 	return request({

+ 2 - 0
apis/parents/homePage.js

@@ -0,0 +1,2 @@
+import requestStudent from '@/apis/utils/requestStudent.js';
+import Qs from 'qs';

+ 10 - 0
apis/parents/mine.js

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

+ 1 - 1
apis/utils/requestStudent.js

@@ -1,4 +1,4 @@
-import  carhelp from '@/apis/utils/mixin-student.js'
+import  carhelp from '@/apis/utils/mixin.js'
 import requestSon from './requestSon.js';
 import requestNum from './requestNum.js';
 

+ 3 - 2
config/.env.dev.js

@@ -1,6 +1,6 @@
 const UNI_APP = {  
 	ProjectName :"51充电联盟",
-	BASE_URL: 'https://51team.xiaoxinda.com/charging-station-server/',
+	BASE_URL: 'http://192.168.77.162:8086/education-training-server/',
 	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 	//BASE_URL: 'http://192.168.77.162:8080/charging-station/' ,
 	PARK_URL: 'https://51team.xiaoxinda.com/charging-parking/' ,
@@ -8,7 +8,8 @@ const UNI_APP = {
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 
 	//openId:"oK9Wr57rAcNzihDN2PEdptprT0As", 
-	openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",//zkx
+	// openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",//zkx
+	openId:"123456",
 	//openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",//杨所
 	//openId:"oK9Wr5zv8lvirni3txbxRkmpg8d0",//
 	

+ 269 - 231
pages/parents/classSchedule/classSchedule.vue

@@ -1,159 +1,176 @@
 <template>
 	<view>
 		<u-navbar back-text="课程表">
-			<view class="slot-wrap">
-							今天
-						</view>
+			<view class="slot-wrap" @click="getToday()">
+				今天
+			</view>
 		</u-navbar>
-	<!-- 日期 -->	
+		<!-- 日期 -->
 		<view class="date-picker">
-			<view class="check">
+			<view class="check" @click="beforeWeek">
 				<u-icon name="arrow-left" size="32"></u-icon>前一周
 			</view>
 			<view class="date">
-				2023-01-03
+				{{date}}
 			</view>
-			<view class="check">
-				后一周<u-icon name="arrow-right" size="32" ></u-icon>
+			<view class="check" @click="afterWeek">
+				后一周<u-icon name="arrow-right" size="32"></u-icon>
 			</view>
 		</view>
 		<view class="date-item">
-			<view class="item checked">
-				<view class="dot dot-checked">
-					
+			<view class="item" v-for="(item,index) in weekDate" :key="index"
+				:class="activeClass == index ? 'checked' : ''" @click="activeClassClick(item,index)">
+				<view class="dot" :class="activeClass == index ? 'dot-checked' : ''">
+
 				</view>
 				<view class="week ">
-					
+					{{item.week}}
 				</view>
 				<view class="day ">
-					3
-				</view>
-			</view>
-			<view class="item">
-				<view class="dot">
-					
-				</view>
-				<view class="week">
-					二
-				</view>
-				<view class="day">
-					4
-				</view>
-			</view>
-			<view class="item">
-				<view class="dot">
-					
-				</view>
-				<view class="week">
-					三
-				</view>
-				<view class="day">
-					5
-				</view>
-			</view>
-			<view class="item">
-				<view class="dot">
-					
-				</view>
-				<view class="week">
-					四
-				</view>
-				<view class="day">
-					6
+					{{item.day}}
 				</view>
 			</view>
-			<view class="item">
-				<view class="dot">
-					
-				</view>
-				<view class="week">
-					五
-				</view>
-				<view class="day">
-					7
-				</view>
-			</view>
-			<view class="item">
-				<view class="dot">
-					
-				</view>
-				<view class="week">
-					六
-				</view>
-				<view class="day">
-					8
-				</view>
+		</view>
+		<!-- 课表信息 -->
+		<view class="class-box">
+			<view class="picture">
+				<img src="../../../assets/img/classschedule.png" alt="">
 			</view>
-			<view class="item">
-				<view class="dot">
-					
+			<view class="infos">
+				<view class="title">
+					中国舞十级班
 				</view>
-				<view class="week">
-					日
+				<view class="tag">
+					<view class="item">
+						二楼舞蹈一教室
+					</view>
+					<view class="item">
+						08:30-10:00
+					</view>
+
 				</view>
-				<view class="day">
-					9
+				<view class="else">
+					<view class="teacher">
+						<view class="photo">
+							<img src="../../../assets/img/teachercard.png" alt="">
+						</view>
+						<view class="name">
+							陈老师
+						</view>
+					</view>
+
+					<view class="class-times">
+						<view class="text">
+							课次
+						</view>
+						<view class="num">
+							22
+						</view>
+
+					</view>
+
 				</view>
+
 			</view>
-		
+
 		</view>
-	<!-- 课表信息 -->
-          <view class="class-box">
-			  <view class="picture">
-			  	<img src="../../../assets/img/classschedule.png" alt="">
-			  </view>
-			  <view class="infos">
-				  <view class="title">
-				  	中国舞十级班
-				  </view>
-				  <view class="tag">
-					  <view class="item">
-					  	二楼舞蹈一教室
-					  </view>
-					  <view class="item">
-					  	08:30-10:00
-					  </view>
-				  	
-				  </view>
-				  <view class="else">
-					  <view class="teacher">
-						  <view class="photo">
-						  	<img src="../../../assets/img/teachercard.png" alt="">
-						  </view>
-					  	   <view class="name">
-					  	   	陈老师
-					  	   </view>
-					  </view>
-					  
-					  <view class="class-times">
-						  <view class="text">
-						  	课次
-						  </view>
-						  <view class="num">
-						  	22
-						  </view>
-					  	
-					  </view>
-				  	
-				  </view>
-			  	
-			  </view>
-          	
-          </view>
-	
+
 	</view>
-	
+
 </template>
 
 <script>
 	export default {
 		data() {
 			return {
-
+				date: '',
+				weekDate: [],
+				weekN: ["一", "二", "三", "四", "五", "六", "日"],
+				activeClass: 0,
+				weekDate1: '',
 			}
 		},
+		onReady() {
+			this.getToday();
+		},
 		methods: {
+			getToday() {
+				this.weekDate = [];
+				let date = new Date(); //当前日期
+				let year = date.getFullYear(); //当前年
+				let month = date.getMonth() + 1; //当前月
+				let day = date.getDate(); //当天
+				let mydate = new Date(year, month - 1, day);
+				let weekday = mydate.getDay();
+				this.weekDate1 = new Date(year, month - 1, day + 1 - weekday);
+				this.getWeekDate(true);
+			},
+			getWeekDate(bl) {
+				let weekDate2 = new Date(this.weekDate1.getTime());
+				for (var i = 0; i < 7; i++) {
+					for (var j = 0; j < this.weekN.length; j++) {
+						if (i == j) {
+							this.weekDate.push({
+								week: this.weekN[j],
+								day: this.getFormatDate(new Date(weekDate2.setDate(this.weekDate1.getDate() + i)))
+							})
+						}
+					}
+				}
 
+				if (bl) {
+					let date = new Date(); //当前日期
+					date = this.getFormatDate(date);
+					for (var m = 0; m < this.weekDate.length; m++) {
+						if (date == this.weekDate[m].day) {
+							this.activeClass = m;
+							this.date = this.weekDate[m].day;
+						}
+					}
+				}
+			},
+			getFormatDate(date) {
+				let myyear = date.getFullYear();
+				let mymonth = date.getMonth() + 1;
+				let myweekday = date.getDate();
+				if (mymonth < 10) {
+					mymonth = "0" + mymonth;
+				}
+				if (myweekday < 10) {
+					myweekday = "0" + myweekday;
+				}
+
+				return (myyear + "-" + mymonth + "-" + myweekday);
+			},
+			beforeWeek() {
+				console.log(this.activeClass)
+				this.weekDate = [];
+				this.weekDate1 = new Date(this.weekDate1.setDate(this.weekDate1.getDate() - 7));
+				this.getWeekDate();
+				for (var m = 0; m < this.weekDate.length; m++) {
+					if (this.activeClass == m) {
+						this.date = this.weekDate[m].day;
+					}
+				}
+			},
+			afterWeek() {
+				this.weekDate = [];
+				this.weekDate1 = new Date(this.weekDate1.setDate(this.weekDate1.getDate() + 7));
+				this.getWeekDate();
+				for (var m = 0; m < this.weekDate.length; m++) {
+					if (this.activeClass == m) {
+						this.date = this.weekDate[m].day;
+					}
+				}
+			},
+			activeClassClick(item, index) {
+				this.activeClass = index;
+				for (var m = 0; m < this.weekDate.length; m++) {
+					if (index == m) {
+						this.date = this.weekDate[m].day;
+					}
+				}
+			},
 		}
 	}
 </script>
@@ -172,14 +189,16 @@
 			color: #333333;
 		}
 	}
-	.date-item{
+
+	.date-item {
 		background-color: #fff;
 		display: flex;
 		justify-content: space-around;
 		padding: 0 12px 16px 12px;
 		border-radius: 0px 0px 9px 9px;
 		box-shadow: 0px 4px 4px 0px #CFD2D5;
-		.item{
+
+		.item {
 			line-height: 20px;
 			border-radius: 8px;
 			background-color: rgba(238, 238, 238, 1);
@@ -188,20 +207,24 @@
 			width: 12%;
 			padding: 12rpx 0;
 			position: relative;
-			.week{
+
+			.week {
 				font-size: 12px;
-				
+
 			}
-			.day{
+
+			.day {
 				font-size: 16px;
 				font-weight: bold;
 			}
 		}
-		.checked{
+
+		.checked {
 			background-color: rgba(13, 186, 199, 1);
-			color: #fff ;
+			color: #fff;
 		}
-		.dot{
+
+		.dot {
 			width: 6px;
 			height: 6px;
 			background-color: rgba(13, 186, 199, 1);
@@ -210,111 +233,126 @@
 			top: 8rpx;
 			right: 8rpx;
 		}
-		.dot-checked{
+
+		.dot-checked {
 			background-color: #fff;
 		}
-		
+
+	}
+
+
+	// 课表信息
+	.class-box {
+		margin: 12px 16px;
+		padding: 24rpx 0 24rpx 24rpx;
+		border-radius: 24rpx;
+		background-color: rgba(255, 255, 255, 1);
+		display: flex;
+
+		.picture {
+			width: 200rpx;
+			height: 200rpx;
+			border-radius: 4px;
+			overflow: hidden;
+
+			img {
+				width: 100%;
+				height: 100%;
+			}
+		}
+
+		.infos {
+			margin-left: 24rpx;
+			display: flex;
+			flex-direction: column;
+			justify-content: space-between;
+			flex: 1;
+
+			.title {
+				color: rgba(51, 51, 51, 1);
+				font-size: 16px;
+				font-weight: bold;
+			}
+
+			.tag {
+				display: flex;
+
+				.item {
+					line-height: 40rpx;
+					border-radius: 8rpx;
+					background-color: rgba(241, 243, 244, 1);
+					color: rgba(16, 16, 16, 1);
+					text-align: center;
+					margin-right: 12rpx;
+					font-size: 24rpx;
+					padding: 0 8rpx;
+				}
+
+				@media screen and (max-width: 310px) {
+					.item {
+						padding: 0 4rpx;
+						margin-right: 8rpx;
+					}
+				}
+
+			}
+
+			.else {
+				display: flex;
+				justify-content: space-between;
+				padding-right: 24rpx;
+
+				.teacher {
+					display: flex;
+					align-items: center;
+
+					.photo {
+						width: 64rpx;
+						height: 64rpx;
+						border-radius: 50px;
+						overflow: hidden;
+
+						img {
+							width: 100%;
+							height: 100%;
+						}
+					}
+
+					.name {
+						color: rgba(16, 16, 16, 1);
+						margin-left: 12px;
+					}
+				}
+
+				.class-times {
+					display: flex;
+					align-items: center;
+
+					.text {
+						color: rgba(119, 119, 119, 1);
+						font-size: 16px;
+					}
+
+					.num {
+						line-height: 20px;
+						border-radius: 4px;
+						background-color: rgba(13, 186, 199, 1);
+						color: rgba(255, 255, 255, 1);
+						text-align: center;
+						margin-left: 8rpx;
+						padding: 0 4px;
+					}
+				}
+
+			}
+		}
 	}
 
 
-// 课表信息
-  .class-box{
-	  margin: 12px 16px;
-	  padding: 24rpx 0 24rpx 24rpx;
-	  border-radius: 24rpx;
-	  background-color: rgba(255, 255, 255, 1);
-	  display: flex;
-	  .picture{
-		  width: 200rpx;
-		  height: 200rpx;
-		  border-radius: 4px;
-		  overflow: hidden;
-		  img{
-			  width: 100%;
-			  height: 100%;
-		  }
-	  }
-	  .infos{
-		  margin-left: 24rpx;
-		  display: flex;
-		  flex-direction: column;
-		  justify-content: space-between;
-		  flex: 1;
-		  .title{
-			  color: rgba(51, 51, 51, 1);
-			  font-size: 16px;
-			  font-weight: bold;
-		  }
-		  .tag{
-			  display: flex;
-			  .item{
-				  line-height: 40rpx;
-				  border-radius: 8rpx;
-				  background-color: rgba(241, 243, 244, 1);
-				  color: rgba(16, 16, 16, 1);
-				  text-align: center;
-				  margin-right: 12rpx;
-				  font-size: 24rpx;
-				  padding:0 8rpx;
-			  }
-			  @media screen and (max-width: 310px) {
-			    .item {
-			      padding:0 4rpx;
-				  margin-right: 8rpx;
-			    }
-			  }
-
-		  }
-		 
-		  .else{
-			  display: flex;
-			  justify-content: space-between;
-			  padding-right: 24rpx;
-			  .teacher{
-				  display: flex;
-				  align-items: center;
-				  .photo{
-					  width: 64rpx;
-					  height: 64rpx;
-					  border-radius: 50px;
-					  overflow: hidden;
-					  img{
-						  width: 100%;
-						  height: 100%;
-					  }
-				  }
-				  .name{
-					  color: rgba(16, 16, 16, 1);
-					  margin-left: 12px;
-				  }
-			  }
-			  .class-times{
-				  display: flex;
-				  align-items: center;
-				  .text{
-					  color: rgba(119, 119, 119, 1);
-					  font-size: 16px;
-				  }
-				  .num{
-					  line-height: 20px;
-					  border-radius: 4px;
-					  background-color: rgba(13, 186, 199, 1);
-					  color: rgba(255, 255, 255, 1);
-					  text-align: center;
-					  margin-left: 8rpx;
-					  padding: 0 4px;
-				  }
-			  }
-			  
-		  }
-	  }
-  }
-
-
-/deep/.u-slot-content{
-	display: block;
-	text-align: right !important;
-	margin-right: 16px;
-	color: #333333;
-}
+	/deep/.u-slot-content {
+		display: block;
+		text-align: right !important;
+		margin-right: 16px;
+		color: #333333;
+	}
 </style>

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

@@ -24,7 +24,7 @@
 		</view>
 		<view class="my-app">
 			<view class="app-items">
-				<view class="item">
+				<view class="item" @click="gotoUrl('pages/parents/classSchedule/classSchedule')">
 					<view class="icon-box"
 						style="background: linear-gradient(180deg, rgba(89,222,232,1) 1%,rgba(13,186,199,1) 100%)">
 						<img src="../../../assets/img/riFill-calendar-2-fill@1x.png" alt="">

+ 151 - 45
pages/parents/login/login.vue

@@ -1,25 +1,3 @@
-<template>
-	<view>
-		
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			
-		}
-	}
-</script>
-
-<style>
-
-</style>
 <template>
 	<view>
 		<u-navbar title="" back-icon-size="24"></u-navbar>
@@ -29,7 +7,7 @@
 		<view class="welcome">
 			欢迎来到青少年宫启航教培管家
 		</view>
-		
+
 		<!-- 登录框-->
 		<view class="login-box">
 			<view class="tel">
@@ -37,7 +15,9 @@
 					<img src="../../../assets/img/riFill-cellphone-fill@1x.png" alt="">
 				</view>
 				<u-line color="red" direction="col" length="40rpx" margin="auto 0" />
-				<view class="tips"><u-input  type="number" placeholder="请填写手机号码" /></view>
+				<view class="tips">
+					<u-input v-model="form.telephone" type="number" placeholder="请填写手机号码" />
+				</view>
 			</view>
 			<view class="hint">
 				未注册的手机号验证后将自动注册
@@ -48,32 +28,155 @@
 				</view>
 				<u-line color="red" direction="col" length="40rpx" margin="auto 0" />
 				<view class="tips">
-					<view class="input"><u-input  type="number" placeholder="请输入验证码" /></view>
-					<view class="verification-code">获取验证码</view>
-					<u-verification-code  >
+					<view class="input">
+						<u-input type="number" v-model="form.verifyCode" placeholder="请输入验证码" />
+					</view>
+					<view class="verification-code" :style="isCodeTipsColor ? 'color: #999999;' : ''" @click="getCode">{{codeTips}}</view>
+					<u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start" change-text="已发送(Xs)">
 					</u-verification-code>
 				</view>
 			</view>
 		</view>
-         <view class="agreement">
-         	<label class="radio">
-         		<radio value="" /><text class="text">我已阅读并同意<text style="color: rgba(13, 186, 199, 1);">《起航教培管家用户协议》</text></text>
-         	</label>
-         </view>
+		<view class="agreement">
+			<label class="radio">
+				<radio value="" @click="radioClick" /><text class="text">我已阅读并同意
+					<text style="color: rgba(13, 186, 199, 1);">《起航教培管家用户协议》</text></text>
+			</label>
+		</view>
 		<!-- 按钮 -->
-		<button class="login-btn" >登  录</button>
+		<button class="login-btn" @click="signIn">登  录</button>
 	</view>
 </template>
 
 <script>
+	import * as loginApi from '@/apis/login.js'
+	import {
+		checkPhone
+	} from '@/apis/utils'
+	
 	export default {
 		data() {
 			return {
-				
+				form: {
+					telephone: '',
+					openId: '',
+					verifyCode: '',
+					userType: 1
+				},
+				isSendMsgIng: false,
+				isCodeTipsColor: false,
+				sendMsgSecond: 60,
+				codeTips: '',
+				agreementValue: false,
 			}
 		},
 		methods: {
-
+			codeChange(text) {
+				this.codeTips = text;
+			},
+			start() {
+				if (!this.isSendMsgIng) {
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+					loginApi.getVerifyCode(this.form.telephone).then((response) => {
+						uni.hideLoading();
+						this.carhelp.set("getvcodetime", new Date().getTime());
+			
+						if (!"") {
+							//倒计时
+							uni.showToast({
+								title: "发送成功"
+							})
+						} else {
+							uni.showToast({
+								title: "您的验证码已经发送[5分钟有效],请勿重复点击"
+							})
+						}
+					}).catch(error => {
+						uni.showToast({
+							title: error,
+							icon: "none"
+						})
+					})
+				}
+			},
+			//倒计时
+			end() {
+				this.sendMsgSecond = 60;
+				this.isSendMsgIng = false;
+				this.isCodeTipsColor = false;
+			},
+			// 获取验证码
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {} else {
+					uni.showToast({
+						title: '倒计时结束后再发送',
+						icon: "none"
+					})
+					return
+				}
+			
+				var checkPhoneResult = checkPhone(this.form.telephone);
+			
+				if (checkPhoneResult !== true) {
+					uni.showToast({
+						title: checkPhoneResult,
+					})
+					return;
+				}
+				this.$refs.uCode.start();
+				this.isCodeTipsColor = true;
+			},
+			radioClick() {
+				this.agreementValue = true;
+			},
+			signIn() {
+				if(!this.form.telephone) {
+					uni.showToast({
+						title: checkPhoneResult,
+						icon: "none"
+					})
+					return;
+				}
+				// if(!this.form.verifyCode) {
+				// 	uni.showToast({
+				// 		title: "请输入验证码",
+				// 		icon: "none"
+				// 	})
+				// 	return
+				// }
+				if(!this.agreementValue) {
+					uni.showToast({
+						title: "请勾选协议",
+						icon: "none"
+					})
+					return
+				}
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				this.form.openId= this.carhelp.getOpenId();
+				
+				loginApi.validateCode(this.form).then((response) => {
+					uni.hideLoading();
+					var token = response ? response.data.token : '';
+					this.carhelp.setToken(token);
+					this.carhelp.setPersonInfo(response.data.regUser);
+					uni.redirectTo({
+						url: '/pages/parents/homePage/homePage'
+					})
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
 	}
 </script>
@@ -146,22 +249,25 @@
 				line-height: 40px;
 			}
 		}
-    .hint{
-		text-align: center;
-		color: rgba(153, 153, 153, 1);
-		font-size: 12px;
-		margin-bottom: 42px;
-	}
+
+		.hint {
+			text-align: center;
+			color: rgba(153, 153, 153, 1);
+			font-size: 12px;
+			margin-bottom: 42px;
+		}
 	}
-	.agreement{
+
+	.agreement {
 		margin-top: 84rpx;
 		text-align: center;
-		
-		/deep/.uni-radio-input{
+
+		/deep/.uni-radio-input {
 			width: 32rpx;
 			height: 32rpx;
 		}
-		.text{
+
+		.text {
 			line-height: 20px;
 		}
 	}

+ 30 - 6
pages/parents/mine/logout.vue

@@ -14,10 +14,10 @@
 			<p>	3.如您已被国家机关调查或正处于诉讼、仲裁程序中,请注意,注销您的帐号并不代表此帐号注销前的帐号行为和相关责任得到豁免或减轻。</p>
 		</view>
 		<view class="logout-btn">
-			<u-button class="logout-btn1" shape="circle" type="" >
+			<u-button class="logout-btn1" shape="circle" type="" @click="logout">
 				<span>继续注销</span>
 			</u-button>
-			<u-button class="logout-btn2" shape="circle" type="success" >
+			<u-button class="logout-btn2" shape="circle" type="success" @click="toMine">
 				<span>我再想想</span>
 			</u-button>
 		</view>
@@ -25,16 +25,40 @@
 </template>
 
 <script>
-	
+	import * as API from '@/apis/index.js'
 	
 	export default {
 		data() {
 			return {
 				
 			}
-		}, 
-		
-		
+		},
+		methods: {
+			toMine() {
+				uni.navigateBack({
+					
+				})
+			},
+			logout() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})		
+				API.deleteUser().then((res) => {
+					uni.hideLoading();
+					
+					this.carhelp.logoff();
+					uni.reLaunch({
+						url: '/pages/parents/login/login'
+					})
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
+		}
 	}
 </script>
 <style>

+ 254 - 159
pages/parents/mine/mine.vue

@@ -9,29 +9,29 @@
 					用户191012
 				</view>
 				<view class="modification">
-				点击修改个人信息	
+					点击修改个人信息
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="my-children">
 			<view class="top">
 				<view class="text">
 					我的子女
 				</view>
 				<view class="add">
-				添加
+					添加
 				</view>
 			</view>
-			
+
 			<view class="children">
-				<view class="check-box">
+				<view class="check-box" v-for="(item,index) in studentList" :key="item.studentId">
 					<view class="photo">
-						<img src="../../../assets/img/photo2.png" alt="">
+						<img :src="item.headPhoto" alt="">
 					</view>
 					<view class="infos">
 						<view class="name">
-							周梓轩
+							{{item.studentName}}
 						</view>
 						<view class="age">
 							4岁1个月
@@ -43,7 +43,7 @@
 						</label>
 					</view>
 				</view>
-				
+
 				<view class="check-box">
 					<view class="photo">
 						<img src="../../../assets/img/zixuan.png" alt="">
@@ -63,10 +63,29 @@
 					</view>
 				</view>
 				
+				<view class="check-box">
+					<view class="photo">
+						<img src="../../../assets/img/zixuan.png" alt="">
+					</view>
+					<view class="infos">
+						<view class="name">
+							王紫瑄
+						</view>
+						<view class="age">
+							6岁7个月
+						</view>
+					</view>
+					<view class="radio">
+						<label class="radio">
+							<radio value="" />
+						</label>
+					</view>
+				</view>
+
 			</view>
-			
+
 		</view>
-		
+
 		<view class="class-times">
 			<view class="box">
 				<view class="times">
@@ -86,7 +105,7 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="option-group">
 			<view class="item">
 				<view class="title">
@@ -97,7 +116,7 @@
 						人脸信息采集
 					</view>
 				</view>
-				
+
 				<view class="value">
 					<view class="text">
 					</view>
@@ -115,7 +134,7 @@
 						绑定手机
 					</view>
 				</view>
-				
+
 				<view class="value">
 					<view class="text">
 						155****0000
@@ -134,7 +153,7 @@
 						意见反馈
 					</view>
 				</view>
-				
+
 				<view class="value">
 					<view class="icon">
 						<u-icon name="arrow-right" color="#cccccc"></u-icon>
@@ -150,7 +169,7 @@
 						联系我们
 					</view>
 				</view>
-				
+
 				<view class="value">
 					<view class="text">
 						0716-8888888
@@ -160,7 +179,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="item">
+			<view class="item" @click="gotoUrl('pages/parents/mine/logout')">
 				<view class="title">
 					<view class="icon">
 						<img src="../../../assets/img/riLine-spam-3-line@1x.png" alt="">
@@ -169,7 +188,7 @@
 						注销账号
 					</view>
 				</view>
-				
+
 				<view class="value">
 					<view class="text">
 						注销后无法恢复,请谨慎操作
@@ -179,8 +198,8 @@
 					</view>
 				</view>
 			</view>
-			
-			<view class="item">
+
+			<view class="item" @click="signOut">
 				<view class="title">
 					<view class="icon">
 						<img src="../../../assets/img/riLine-logout-box-r-line@1x(1).png" alt="">
@@ -189,66 +208,123 @@
 						退出账号
 					</view>
 				</view>
-				
+
 				<view class="value">
 					<view class="text">
-						
+
 					</view>
 					<view class="icon">
 						<u-icon name="arrow-right" color="#cccccc"></u-icon>
 					</view>
 				</view>
 			</view>
-			
+			<u-modal v-model="show" @confirm="confirm" confirm-color="#FF3D00" :show-cancel-button="true" ref="uModal" :asyncClose="true" :title="title"
+				:content="content" :content-style="{color: '#333333'}"></u-modal>
+
 		</view>
-		
-		
+
+
 		<ParentsTabbar :current="3" ref="tabbarMain"></ParentsTabbar>
 	</view>
 </template>
 
 <script>
+	import * as mineApi from '@/apis/parents/mine.js'
+	import * as loginApi from '@/apis/login.js'
+	import * as API from '@/apis/index.js'
 	import ParentsTabbar from '@/components/ParentsTabbar.vue'
+
 	export default {
-		components:{
+		components: {
 			ParentsTabbar
 		},
 		data() {
 			return {
-				
+				parentsInfo: {},
+				show: false,
+				title: '退出账号',
+				content: '是否退出当前账号?',
+				studentList: [],
 			}
 		},
+		onReady() {
+			this.getStudentList();
+		},
 		methods: {
-			
+			getParentsInfo() {
+
+			},
+			getStudentList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})		
+				mineApi.studentList().then((res) => {
+					uni.hideLoading();
+					this.studentList = res.data.studentList;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			signOut() {
+				this.show = true;
+			},
+			confirm() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})		
+				API.logout().then((res) => {
+					uni.hideLoading();
+					this.show = false;
+					this.carhelp.logoff()
+					uni.reLaunch({
+						url: '/pages/parents/login/login'
+					})
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	.head{
+	.head {
 		padding: 48rpx 40rpx;
 		display: flex;
 		align-items: center;
-		.photo{
+
+		.photo {
 			width: 120rpx;
 			height: 120rpx;
 			border-radius: 100rpx;
 			border: 4rpx solid rgba(255, 255, 255, 1);
 			overflow: hidden;
-			img{
+
+			img {
 				width: 100%;
 				height: 100%;
 			}
 		}
-		.infos{
+
+		.infos {
 			margin-left: 32rpx;
-			.name{
+
+			.name {
 				color: rgba(51, 51, 51, 1);
 				font-size: 20px;
 				line-height: 20px;
 				font-weight: bold;
 			}
-			.modification{
+
+			.modification {
 				color: rgba(119, 119, 119, 1);
 				font-size: 24rpx;
 				line-height: 24rpx;
@@ -258,145 +334,164 @@
 	}
 
 
-.my-children{
-	margin: 0 32rpx;
-	padding: 32rpx 24rpx; 
-	border-radius: 12px;
-	background: linear-gradient(90deg, rgba(13,186,199,1) 0%,rgba(37,209,146,1) 100%);
-	.top{
-		display: flex;
-		justify-content: space-between;
-		
-		.text{
-			color: rgba(255, 255, 255, 1);
-			font-size: 18px;
+	.my-children {
+		margin: 0 32rpx;
+		padding: 32rpx 24rpx;
+		border-radius: 12px;
+		background: linear-gradient(90deg, rgba(13, 186, 199, 1) 0%, rgba(37, 209, 146, 1) 100%);
+
+		.top {
+			display: flex;
+			justify-content: space-between;
+
+			.text {
+				color: rgba(255, 255, 255, 1);
+				font-size: 18px;
+			}
+
+			.add {
+				width: 120rpx;
+				line-height: 28px;
+				border-radius: 50px;
+				background-color: rgba(255, 174, 0, 1);
+				color: rgba(255, 255, 255, 1);
+				font-size: 28rpx;
+				text-align: center;
+			}
 		}
-		.add{
-			width: 120rpx;
-			line-height: 28px;
-			border-radius: 50px;
-			background-color: rgba(255, 174, 0, 1);
-			color: rgba(255, 255, 255, 1);
-			font-size: 28rpx;
-			text-align: center;
+
+		.children {
+			margin-top: 12px;
+			border-radius: 16rpx;
+			background-color: rgba(255, 255, 255, 1);
+			padding: 24rpx;
+			display: flex;
+			justify-content: space-around;
+
+			.check-box {
+				padding: 16rpx 40rpx 16rpx 16rpx;
+				border-radius: 100rpx;
+				background-color: rgba(13, 186, 199, 0.1);
+				border: 1px solid rgba(13, 186, 199, 0.5);
+				display: flex;
+				position: relative;
+
+				.photo {
+					width: 80rpx;
+					height: 80rpx;
+					border-radius: 100rpx;
+					overflow: hidden;
+
+					img {
+						width: 100%;
+						height: 100%;
+					}
+				}
+
+				.infos {
+					margin-left: 16rpx;
+
+					.name {
+						color: rgba(51, 51, 51, 1);
+						font-size: 32rpx;
+						line-height: 48rpx;
+					}
+
+					.age {
+						color: rgba(119, 119, 119, 1);
+						font-size: 24rpx;
+						line-height: 28rpx;
+					}
+				}
+
+				.radio {
+					position: absolute;
+					bottom: -2rpx;
+					right: -8rpx;
+
+					/deep/.uni-radio-input {
+						width: 40rpx;
+						height: 40rpx;
+						background-color: rgba(221, 241, 242, 1);
+					}
+
+					/deep/.uni-radio-input-checked {
+						background-color: #43C9D3 !important;
+						border-color: #43C9D3 !important;
+					}
+
+				}
+			}
+
 		}
 	}
-	
-	.children{
-		margin-top: 12px;
-		border-radius: 16rpx;
+
+	.class-times {
+		border-radius: 12px;
 		background-color: rgba(255, 255, 255, 1);
-		padding: 24rpx;
 		display: flex;
-		justify-content: space-around;
-		.check-box{
-			padding: 16rpx 40rpx 16rpx 16rpx;
-			border-radius: 100rpx;
-			background-color: rgba(13, 186, 199, 0.1);
-			border: 1px solid rgba(13, 186, 199, 0.5);
-			display: flex;
-			position: relative;
-			.photo{
-				width: 80rpx;
-				height: 80rpx;
-				border-radius: 100rpx;
-				overflow: hidden;
-				img{
-					width: 100%;
-					height: 100%;
-				}
+		padding: 20px 0;
+		margin: 12px 16px;
+
+		.box {
+			width: 50%;
+			text-align: center;
+
+			.times {
+				color: rgba(51, 51, 51, 1);
+				font-size: 20px;
+				font-weight: bold;
+
 			}
-			.infos{
-				margin-left: 16rpx;
-				
-				.name{
-					color: rgba(51, 51, 51, 1);
-					font-size: 32rpx;
-					line-height: 48rpx;
+
+			.text {
+				color: rgba(119, 119, 119, 1);
+				font-size: 14px;
+				margin-top: 8px;
+			}
+		}
+	}
+
+	.option-group {
+		margin: 0 32rpx;
+		background-color: #fff;
+		border-radius: 12px;
+
+		.item {
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			padding: 24rpx;
+			border-bottom: 1px solid rgba(244, 244, 244, 1);
+
+			.title {
+				display: flex;
+				align-items: center;
+
+				img {
+					vertical-align: middle;
 				}
-				.age{
+
+				.text {
+					margin-left: 16rpx;
 					color: rgba(119, 119, 119, 1);
-					font-size: 24rpx;
-				line-height: 28rpx;
+					font-size: 28rpx
 				}
 			}
-			.radio{
-				position: absolute;
-				bottom: -2rpx;
-				right: -8rpx;
-				/deep/.uni-radio-input{
-					width: 40rpx;
-					height: 40rpx;
-					background-color: rgba(221, 241, 242, 1);
+
+			.value {
+				display: flex;
+				align-items: center;
+
+				.icon {
+					margin-left: 16rpx;
 				}
-				/deep/.uni-radio-input-checked{
-					background-color: #43C9D3 !important;
-					border-color:#43C9D3 !important ;
+
+				.text {
+					color: rgba(119, 119, 119, 1);
+					font-size: 24rpx;
 				}
-				
 			}
 		}
-		
 	}
-}
-
-.class-times{
-	border-radius: 12px;
-	background-color: rgba(255, 255, 255, 1);
-	display: flex;
-	padding: 20px 0;
-	margin: 12px 16px;
-	
-	.box{
-		width: 50%;
-		text-align: center;
-		.times{
-			color: rgba(51, 51, 51, 1);
-			font-size: 20px;
-			font-weight: bold;
-			
-		}
-		.text{
-			color: rgba(119, 119, 119, 1);
-			font-size: 14px;
-			margin-top: 8px;
-		}
-	}
-}
-.option-group{
-  margin: 0 32rpx;
-  background-color: #fff;
-  border-radius: 12px;
-  .item{
-	  display: flex;
-	  justify-content: space-between;
-	  align-items: center;
-	  padding: 24rpx;
-	  border-bottom: 1px solid rgba(244, 244, 244, 1);
-	  .title{
-		  display: flex;
-		  align-items: center;
-		  img{
-			  vertical-align: middle;
-		  }
-		  .text{
-			  margin-left: 16rpx;
-			  color: rgba(119, 119, 119, 1);
-			  font-size: 28rpx
-		  }
-	  }
-	  .value{
-		  display: flex;
-		  align-items: center;
-		  .icon{
-			  margin-left: 16rpx;
-		  }
-		  .text{
-			  color: rgba(119, 119, 119, 1);
-			  font-size: 24rpx;
-		  }
-	  }
-  }
-}
-
 </style>

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

@@ -239,25 +239,25 @@
 			}
 		},
 		onLoad() {
-			let data = new Date() //当前日期
-			let year = data.getFullYear();//当前年			 
-			let month = data.getMonth()+1;//当前月
-			let day = data.getDate(); //当天
+			let date = new Date() //当前日期
+			let year = date.getFullYear();//当前年			 
+			let month = date.getMonth()+1;//当前月
+			let day = date.getDate(); //当天
 			let mydate = new Date(year,month-1,day);
 			let weekday = mydate.getDay();
 			let weekDate1 = new Date(year, month - 1, day + 1 - weekday);
 			let weekDate2 = new Date(year, month - 1, day + 7 - weekday);
 			
-			this.day = this.getDate(data,true);
-			this.weekStartDate = this.getDate(weekDate1,true);
-			this.weekEndDate = this.getDate(weekDate2,true);
-			this.monthStartDate = this.getDate(data,false) + "-" + '01';
+			this.day = this.getFormatDate(date,true);
+			this.weekStartDate = this.getFormatDate(weekDate1,true);
+			this.weekEndDate = this.getFormatDate(weekDate2,true);
+			this.monthStartDate = this.getFormatDate(date,false) + "-" + '01';
 			
 			let days = new Date(year, month + 1, 0).getDate();
-			this.monthEndDate = this.getDate(data,false) + "-" + days;
+			this.monthEndDate = this.getFormatDate(date,false) + "-" + days;
 		},
 		methods: {
-			getDate(date,m) {
+			getFormatDate(date,m) {
 				let myyear = date.getFullYear();
 				let mymonth = date.getMonth()+1;
 				let myweekday = date.getDate(); 

+ 2 - 0
pages/teacher/login/login.vue

@@ -47,7 +47,9 @@
 			return {
 				form: {
 					telephone: '',
+					openId: '',
 					verifyCode: '',
+					userType: 2
 				},
 				isSendMsgIng: false,
 				isCodeTipsColor: false,