Browse Source

no message

xiaoxin 1 year ago
parent
commit
57175e9216

+ 7 - 2
pages/addStudent/addStudent.vue

@@ -34,7 +34,12 @@
 				<radio color="#0061FF" style="transform: scale(0.7)" :checked="item.isChecked" />
 				<radio color="#0061FF" style="transform: scale(0.7)" :checked="item.isChecked" />
 				<view class="item_info">
 				<view class="item_info">
 					<image v-if="item.headImage" class="info_img" :src="item.headImage" mode="aspectFill"></image>
 					<image v-if="item.headImage" class="info_img" :src="item.headImage" mode="aspectFill"></image>
-					<image v-else class="info_img" src="/static/images/header.png" mode="aspectFill"></image>
+					<image
+						v-else
+						class="info_img"
+						src="https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png"
+						mode="aspectFill"
+					></image>
 					<view class="info_msg">
 					<view class="info_msg">
 						<view class="msg_name">{{ item.name }}</view>
 						<view class="msg_name">{{ item.name }}</view>
 						<view>{{ item.cardNo }}</view>
 						<view>{{ item.cardNo }}</view>
@@ -317,4 +322,4 @@ const handleAddClass = async (ids) => {
 		background-color: #0061ff;
 		background-color: #0061ff;
 	}
 	}
 }
 }
-</style>
+</style>

+ 348 - 34
pages/addStudentMsg/addStudentMsg.vue

@@ -36,10 +36,17 @@
 				<text class="text">*</text>
 				<text class="text">*</text>
 				人脸图片
 				人脸图片
 			</view>
 			</view>
-			<view class="box_upload">
+			<view v-if="!headImage" class="box_upload" @click="handleUpload">
 				<uni-icons type="plusempty" size="30" color="#666666"></uni-icons>
 				<uni-icons type="plusempty" size="30" color="#666666"></uni-icons>
 				上传照片
 				上传照片
 			</view>
 			</view>
+			<view v-else class="box_upload">
+				<image :src="headImage" mode="aspectFill" style="width: 160rpx; height: 160rpx" @click="clickImg(headImage)"></image>
+				<!-- 图片删除图标 -->
+				<view class="delete" @click="deleteImg">
+					<uni-icons type="close" size="20"></uni-icons>
+				</view>
+			</view>
 		</view>
 		</view>
 		<view class="tips">注:支持.jpg .png,五官清晰无遮挡,大小不超过2M</view>
 		<view class="tips">注:支持.jpg .png,五官清晰无遮挡,大小不超过2M</view>
 
 
@@ -50,77 +57,364 @@
 				时间组
 				时间组
 			</view>
 			</view>
 
 
-			<picker @change="bindPickerChange" :value="currentIndex" :range="array">
+			<picker @change="bindPickerChange" :value="currentIndex" :range="timeGroups" range-key="name">
 				<view class="box_value" :class="{ unactive: !currentIndex }">
 				<view class="box_value" :class="{ unactive: !currentIndex }">
-					{{ currentIndex ? array[currentIndex] : '请选择' }}
+					{{ currentIndex ? timeGroups[currentIndex].name : '请选择' }}
 					<image class="value_img" src="/static/images/bottom2.png" mode="aspectFill"></image>
 					<image class="value_img" src="/static/images/bottom2.png" mode="aspectFill"></image>
 				</view>
 				</view>
 			</picker>
 			</picker>
 		</view>
 		</view>
 
 
-		<!-- 家属区域 -->
-		<view class="box">
-			<view class="box_key">
-				<text class="text">*</text>
-				家属
-			</view>
-			<view class="box_value">
-				<input class="input" type="text" placeholder="请输入姓名" />
-				<view class="value_icon">
-					<uni-icons type="plus" size="25" color="#0061FF"></uni-icons>
+		<!-- 家属列表区域 -->
+		<view v-for="(item, index) in list" :key="index">
+			<!-- 家属区域 -->
+			<view class="box">
+				<view class="box_key">
+					<text class="text">*</text>
+					家属{{ index + 1 }}
+				</view>
+				<view class="box_value">
+					<input v-model="item.name" class="input" type="text" placeholder="请输入称呼或职业" />
+					<view class="value_icon">
+						<uni-icons v-if="index == 0" type="plus" size="25" color="#0061FF" @click="handleAdd"></uni-icons>
+						<uni-icons v-else type="close" size="25" color="#0061FF" @click="handleDelete(index)"></uni-icons>
+					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-		</view>
 
 
-		<!-- 手机号码区域 -->
-		<view class="box">
-			<view class="box_key">
-				<text class="text">*</text>
-				手机号码
-			</view>
-			<view class="box_value">
-				<input class="input" type="text" placeholder="请输入手机号码" />
+			<!-- 手机号码区域 -->
+			<view class="box">
+				<view class="box_key">
+					<text class="text">*</text>
+					手机号码
+				</view>
+				<view class="box_value">
+					<input v-model="item.phone" class="input" type="text" placeholder="请输入手机号码" />
+				</view>
 			</view>
 			</view>
-		</view>
 
 
-		<!-- 家属与本人的关系区域 -->
-		<view class="box">
-			<view class="box_key">
-				<text class="text">*</text>
-				家属与本人的关系
-			</view>
-			<view class="box_value">
-				<input class="input" type="text" placeholder="请输入家属与本人的关系" />
+			<!-- 家属与本人的关系区域 -->
+			<view class="box">
+				<view class="box_key">
+					<text class="text">*</text>
+					家属与本人的关系
+				</view>
+				<view class="box_value">
+					<input v-model="item.ship" class="input" type="text" placeholder="请输入家属与本人的关系" />
+				</view>
 			</view>
 			</view>
 		</view>
 		</view>
+
+		<!-- 确认按钮区域 -->
+		<view class="btn" @click="handleConfirm">确认</view>
+
+		<!-- 用于图片压缩的canvas画布 -->
+		<canvas
+			:style="{
+				width: cw + 'px',
+				height: cw + 'px',
+				position: 'absolute',
+				zIndex: -1,
+				left: '-10000rpx',
+				top: '-10000rpx'
+			}"
+			canvas-id="zipCanvas"
+		></canvas>
+		<!--画布结束-->
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
 import { ref } from 'vue'
 import { ref } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+import { myRequest } from '@/utils/api.js'
+import { decryptDes } from '@/utils/des.js'
+import getLessLimitSizeImage from '@/utils/imageCompress.js'
 
 
 // 姓名
 // 姓名
 const name = ref()
 const name = ref()
 // 性别
 // 性别
 const gender = ref(1)
 const gender = ref(1)
+// 照片
+const headImage = ref('')
 // 时间组当前激活索引
 // 时间组当前激活索引
-const currentIndex = ref()
+const currentIndex = ref('')
 // 时间组数据
 // 时间组数据
-const array = ref(['上午', '下午'])
+const timeGroups = ref([])
+
+// 家属列表
+const list = ref([
+	{
+		name: '',
+		phone: '',
+		ship: '',
+		departmentId: uni.getStorageSync('departmentId_list')
+	}
+])
+
+//画板边长默认是屏幕宽度,正方形画布
+const cw = uni.getSystemInfoSync().windowWidth
+
+onLoad(() => {
+	// 获取时间组列表数据
+	getTimeGroups()
+})
+
+// 获取时间组列表数据
+const getTimeGroups = async () => {
+	const res = await myRequest({
+		url: '/wanzai/api/smartUser/timeGroups'
+	})
+	// console.log(res)
+	const result = JSON.parse(decryptDes(res.data))
+	// console.log(result)
+	timeGroups.value = result
+}
+
 // 切换性别回调
 // 切换性别回调
 const handlegender = (v) => {
 const handlegender = (v) => {
 	gender.value = v
 	gender.value = v
 }
 }
+
 // 切换时间组回调
 // 切换时间组回调
 const bindPickerChange = (e) => {
 const bindPickerChange = (e) => {
 	currentIndex.value = e.detail.value
 	currentIndex.value = e.detail.value
 }
 }
+
+// 上传照片回调
+const handleUpload = () => {
+	uni.chooseMedia({
+		count: 1,
+		mediaType: ['image'],
+		sourceType: ['album'],
+		sizeType: ['compressed'],
+		success: (res) => {
+			// console.log(res.tempFiles)
+
+			res.tempFiles.forEach((ele) => {
+				if (ele.fileType === 'image' && ele.size > 1024 * 1024 * 2) {
+					//这里的id和页面中写的html代码的canvas的id要一致
+					let canvasId = 'zipCanvas'
+					//原图的路径
+					let imagePath = ele.tempFilePath
+					//大小限制1024kb
+					let limitSize = 1024 * 2
+					//初始绘画区域是画布自身的宽度也就是屏幕宽度
+					let drawWidth = uni.getSystemInfoSync().windowWidth
+					// 图片过大压缩
+					getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, (resPath) => {
+						handleUploadMini({ tempFilePath: resPath, fileType: ele.fileType })
+					})
+				} else {
+					handleUploadMini(ele)
+				}
+			})
+		}
+	})
+}
+
+const handleUploadMini = (ele) => {
+	uni.showLoading({
+		title: '上传中,请稍后',
+		mask: true
+	})
+	uni.uploadFile({
+		url: `https://www.campussmartlife.com/smartApi/wanzai/api/upload/toCos`,
+		filePath: ele.tempFilePath,
+		name: 'files',
+		header: {
+			token: uni.getStorageSync('token') || '',
+			user_head: uni.getStorageSync('userhead') || ''
+		},
+		success: (uploadFileRes) => {
+			// console.log(uploadFileRes)
+			let imgUrl = JSON.parse(uploadFileRes.data).data
+
+			const result = JSON.parse(decryptDes(imgUrl))
+			console.log(result)
+			headImage.value = result
+		},
+		fail: () => {
+			uni.showToast({
+				title: '上传失败',
+				icon: 'error'
+			})
+		},
+		complete: () => {
+			uni.hideLoading()
+		}
+	})
+}
+
+// 家属添加图标回调
+const handleAdd = () => {
+	list.value.push({
+		name: '',
+		phone: '',
+		ship: '',
+		departmentId: uni.getStorageSync('departmentId_list')
+	})
+}
+
+// 家属删除图标回调
+const handleDelete = (index) => {
+	// console.log(index)
+	uni.showModal({
+		title: '提示',
+		content: '确定删除该家属吗?',
+		success: (res) => {
+			if (res.confirm) {
+				list.value.splice(index, 1)
+			}
+		}
+	})
+}
+
+// 确认按钮回调
+const handleConfirm = () => {
+	const flag = verify()
+
+	if (flag) {
+		uni.showModal({
+			title: '提示',
+			content: '确定添加该学生吗?',
+			success: (res) => {
+				if (res.confirm) {
+					handleConfirmReq()
+				}
+			}
+		})
+	}
+}
+
+// 验证提交数据是否合法
+const verify = () => {
+	if (!name.value) {
+		uni.showToast({
+			title: '请输入姓名',
+			icon: 'none'
+		})
+		return false
+	}
+
+	let reg_name = /^[\u4e00-\u9fa5]{2,4}$/
+	if (!reg_name.test(name.value)) {
+		uni.showToast({
+			title: '姓名格式错误',
+			icon: 'none'
+		})
+		return false
+	}
+
+	if (!headImage.value) {
+		uni.showToast({
+			title: '请上传图片',
+			icon: 'none'
+		})
+		return false
+	}
+
+	if (!currentIndex.value) {
+		uni.showToast({
+			title: '请选择时间组',
+			icon: 'none'
+		})
+		return false
+	}
+
+	let res = list.value.some((ele) => !ele.name || !ele.phone || !ele.ship)
+
+	if (res) {
+		uni.showToast({
+			title: '家属数据不能为空',
+			icon: 'none'
+		})
+		return false
+	}
+
+	let res2 = list.value.some((ele) => !reg_name.test(ele.name))
+
+	if (res2) {
+		uni.showToast({
+			title: '家属姓名格式错误',
+			icon: 'none'
+		})
+		return false
+	}
+
+	let reg_phone = /^1[3-9]\d{9}$/
+	let res3 = list.value.some((ele) => !reg_phone.test(ele.phone))
+
+	if (res3) {
+		uni.showToast({
+			title: '家属手机号码格式错误',
+			icon: 'none'
+		})
+		return false
+	}
+
+	return true
+}
+
+// 确认请求
+const handleConfirmReq = async () => {
+	let data = {
+		name: name.value,
+		sexId: gender.value,
+		headImage: headImage.value,
+		departmentId: uni.getStorageSync('departmentId'),
+		gradeId: uni.getStorageSync('grade_student'),
+		classId: uni.getStorageSync('classes_student'),
+		timeGroupId: timeGroups.value[currentIndex.value].id,
+		list: list.value
+	}
+	// console.log(data)
+	const res = await myRequest({
+		url: '/wanzai/api/smartEnrollmentUser/insertTeacherSmartEnrollmentUser',
+		method: 'post',
+		data
+	})
+	// console.log(res)
+	if (res.code == 200) {
+		uni.showToast({
+			title: '添加成功',
+			icon: 'success'
+		})
+		setTimeout(() => {
+			uni.reLaunch({
+				url: '/pages/studentManage/studentManage'
+			})
+		}, 1500)
+	}
+}
+
+// 点击图片回调
+const clickImg = (url) => {
+	uni.previewImage({
+		urls: [url],
+		current: 1
+	})
+}
+
+// 删除图片回调
+const deleteImg = () => {
+	uni.showModal({
+		title: '提示',
+		content: '确定删除该图片吗?',
+		success: (res) => {
+			if (res.confirm) {
+				headImage.value = ''
+			}
+		}
+	})
+}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .container {
 .container {
+	box-sizing: border-box;
 	padding: 10rpx 0 30rpx 15rpx;
 	padding: 10rpx 0 30rpx 15rpx;
-	height: 100vh;
+	min-height: 100vh;
 	font-size: 28rpx;
 	font-size: 28rpx;
 
 
 	.box {
 	.box {
@@ -193,6 +487,7 @@ const bindPickerChange = (e) => {
 		}
 		}
 
 
 		.box_upload {
 		.box_upload {
+			position: relative;
 			display: flex;
 			display: flex;
 			flex-direction: column;
 			flex-direction: column;
 			justify-content: center;
 			justify-content: center;
@@ -204,6 +499,12 @@ const bindPickerChange = (e) => {
 			color: #666666;
 			color: #666666;
 			border-radius: 6rpx;
 			border-radius: 6rpx;
 			background-color: #f2f2f2;
 			background-color: #f2f2f2;
+
+			.delete {
+				position: absolute;
+				right: 10rpx;
+				top: 10rpx;
+			}
 		}
 		}
 	}
 	}
 
 
@@ -213,5 +514,18 @@ const bindPickerChange = (e) => {
 		font-size: 24rpx;
 		font-size: 24rpx;
 		color: #a6a6a6;
 		color: #a6a6a6;
 	}
 	}
+
+	.btn {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		margin-top: 100rpx;
+		width: 710rpx;
+		height: 100rpx;
+		font-size: 32rpx;
+		color: #fff;
+		border-radius: 8rpx;
+		background-color: #0061ff;
+	}
 }
 }
 </style>
 </style>

+ 17 - 4
pages/check/check.vue

@@ -29,15 +29,20 @@
 					<view class="box">性别:{{ item.sexId == 1 ? '男' : '女' }}</view>
 					<view class="box">性别:{{ item.sexId == 1 ? '男' : '女' }}</view>
 					<view class="box">
 					<view class="box">
 						照片:
 						照片:
-						<image v-if="!item.headImage" class="box_img" src="/static/images/header.png" mode="aspectFill"></image>
-						<image v-else class="box_img" :src="item.headImage" mode="aspectFill"></image>
+						<image
+							v-if="!item.headImage"
+							class="box_img"
+							src="https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png"
+							mode="aspectFill"
+						></image>
+						<image v-else class="box_img" :src="item.headImage" mode="aspectFill" @click="clickImg(item.headImage)"></image>
 					</view>
 					</view>
 					<view class="box">年级:{{ item.gradeName }}</view>
 					<view class="box">年级:{{ item.gradeName }}</view>
 					<view class="box">班级:{{ item.schoolClassName }}</view>
 					<view class="box">班级:{{ item.schoolClassName }}</view>
 
 
 					<!-- 家属数组区域 -->
 					<!-- 家属数组区域 -->
 					<view v-for="(ele, index) in item.list" :key="index">
 					<view v-for="(ele, index) in item.list" :key="index">
-						<view class="box">家属:{{ ele.name }}</view>
+						<view class="box">家属{{ index + 1 }}:{{ ele.name }}</view>
 						<view class="box">手机号码:{{ ele.phone }}</view>
 						<view class="box">手机号码:{{ ele.phone }}</view>
 						<view class="box">家属与本人的关系:{{ ele.ship }}</view>
 						<view class="box">家属与本人的关系:{{ ele.ship }}</view>
 					</view>
 					</view>
@@ -120,7 +125,7 @@ const getData = async () => {
 	})
 	})
 	// console.log(res)
 	// console.log(res)
 	const result = JSON.parse(decryptDes(res.data))
 	const result = JSON.parse(decryptDes(res.data))
-	// console.log(result)
+	console.log(result)
 	dataList.value = [...dataList.value, ...result.list]
 	dataList.value = [...dataList.value, ...result.list]
 	total.value = result.totalCount
 	total.value = result.totalCount
 }
 }
@@ -172,6 +177,14 @@ const clickBtnReq = async (id, type) => {
 		}, 1500)
 		}, 1500)
 	}
 	}
 }
 }
+
+// 点击图片回调
+const clickImg = (url) => {
+	uni.previewImage({
+		urls: [url],
+		current: 1
+	})
+}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 1 - 1
pages/energy/energy.vue

@@ -513,7 +513,7 @@ const changePage_now = (e) => {
 					.text {
 					.text {
 						display: inline-block;
 						display: inline-block;
 						margin-top: -8rpx;
 						margin-top: -8rpx;
-						margin-left: -8rpx;
+						// margin-left: -8rpx;
 						font-size: 22rpx;
 						font-size: 22rpx;
 						font-weight: 400;
 						font-weight: 400;
 					}
 					}

+ 52 - 4
pages/grade/grade.vue

@@ -5,7 +5,18 @@
 		<!-- input组件区域 -->
 		<!-- input组件区域 -->
 		<headerInput @changeInputValue="changeInputValue" />
 		<headerInput @changeInputValue="changeInputValue" />
 		<!-- 学校年级班级区域 -->
 		<!-- 学校年级班级区域 -->
-		<view class="school">万载三中/{{ gradeName ? gradeName + '/' : '' }}{{ className ? className : '' }}</view>
+		<!-- <view class="school">万载三中/{{ gradeName ? gradeName + '/' : '' }}{{ className ? className : '' }}</view> -->
+		<view class="school">
+			<uni-data-picker
+				placeholder="请选择班级"
+				popup-title="请选择班级"
+				:clear-icon="false"
+				:map="{ text: 'name', value: 'classId' }"
+				:localdata="dataTree_student"
+				v-model="classes_student"
+				@nodeclick="clickNode"
+			></uni-data-picker>
+		</view>
 
 
 		<!-- 学生列表区域 -->
 		<!-- 学生列表区域 -->
 		<listView :list="list" :appType="appType" />
 		<listView :list="list" :appType="appType" />
@@ -18,6 +29,7 @@ import { onLoad } from '@dcloudio/uni-app'
 import headerInput from '@/components/headerInput.vue'
 import headerInput from '@/components/headerInput.vue'
 import listView from '@/components/listView.vue'
 import listView from '@/components/listView.vue'
 import { myRequest } from '@/utils/api.js'
 import { myRequest } from '@/utils/api.js'
+import { decryptDes } from '@/utils/des.js'
 
 
 // 学生列表数组
 // 学生列表数组
 const list = ref([])
 const list = ref([])
@@ -28,11 +40,37 @@ const className = ref('')
 
 
 const appType = ref('')
 const appType = ref('')
 
 
+const dataTree_student = ref([])
+
+const classes_student = ref('')
+
+const gradeId = ref('')
+
 onLoad((options) => {
 onLoad((options) => {
 	appType.value = options.type || ''
 	appType.value = options.type || ''
-	getData()
+	const manageGrade = uni.getStorageSync('userInfo').manageGrade
+	const manageSchoolClass = uni.getStorageSync('userInfo').manageSchoolClass
+	getManageClass(manageSchoolClass, manageGrade)
 })
 })
 
 
+// 获取管理的班级数组
+const getManageClass = async (manageSchoolClass, manageGrade) => {
+	const res = await myRequest({
+		url: '/wanzai/api/smartUser/getManageClass',
+		data: {
+			manageSchoolClass,
+			manageGrade
+		}
+	})
+	// console.log(res)
+	const result = JSON.parse(decryptDes(res.data))
+	// console.log(result)
+	dataTree_student.value = result
+	classes_student.value = result[0].classId
+	gradeId.value = result[0].gradeId
+	getData()
+}
+
 // 输入框组件自定义事件
 // 输入框组件自定义事件
 const changeInputValue = (value) => {
 const changeInputValue = (value) => {
 	// console.log(value)
 	// console.log(value)
@@ -54,7 +92,9 @@ const getData = async () => {
 	const res = await myRequest({
 	const res = await myRequest({
 		url: '/wanzai/api/wechat/queryPhoneBook',
 		url: '/wanzai/api/wechat/queryPhoneBook',
 		data: {
 		data: {
-			id: uni.getStorageSync('userInfo').id
+			id: uni.getStorageSync('userInfo').id,
+			gradeId: gradeId.value,
+			classId: classes_student.value
 		}
 		}
 	})
 	})
 	// console.log(res)
 	// console.log(res)
@@ -83,6 +123,14 @@ const getData = async () => {
 		})
 		})
 	}
 	}
 }
 }
+
+// 学生部门筛选框选择时的回调
+const clickNode = (e) => {
+	// console.log(e)
+	classes_student.value = e.classId
+	gradeId.value = e.gradeId
+	getData()
+}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -105,7 +153,7 @@ const getData = async () => {
 
 
 	// 学校名称区域样式
 	// 学校名称区域样式
 	.school {
 	.school {
-		margin-top: 38rpx;
+		margin-top: 30rpx;
 		color: #808080;
 		color: #808080;
 		font-size: 28rpx;
 		font-size: 28rpx;
 	}
 	}

+ 2 - 2
pages/home/home.vue

@@ -11,7 +11,7 @@
 
 
 		<!-- 顶部图片区域 -->
 		<!-- 顶部图片区域 -->
 		<view class="header">
 		<view class="header">
-			<img mode="aspectFill" class="header_img" src="../../static/images/header.png" />
+			<img mode="aspectFill" class="header_img" src="https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png" />
 			<!-- 学校图标区域 -->
 			<!-- 学校图标区域 -->
 			<img mode="aspectFill" class="header_icon" src="../../static/images/school-logo.jpg" />
 			<img mode="aspectFill" class="header_icon" src="../../static/images/school-logo.jpg" />
 			<!-- 学校名称区域 -->
 			<!-- 学校名称区域 -->
@@ -517,4 +517,4 @@ const updateObj = (data) => {
 		}
 		}
 	}
 	}
 }
 }
-</style>
+</style>

+ 31 - 30
pages/invitation/invitation.vue

@@ -3,7 +3,7 @@
 		<!-- 二维码区域 -->
 		<!-- 二维码区域 -->
 		<view class="box">
 		<view class="box">
 			<view class="box_top">
 			<view class="box_top">
-				<view class="top_text">尊敬的家长:您好!七年级一班现诚邀您扫描下方二维码,填写相关信息加入班级,感谢您的配合,让我们携手为孩子的成长保驾护航!</view>
+				<view class="top_text">尊敬的家长:您好!{{ currentClass }}现诚邀您扫描下方二维码,填写相关信息加入班级,感谢您的配合,让我们携手为孩子的成长保驾护航!</view>
 				<view class="top_qrcode">
 				<view class="top_qrcode">
 					<view class="qrcode_box">
 					<view class="qrcode_box">
 						<uv-qrcode ref="qrcodeRef" size="350rpx" :value="QRCodeUrl"></uv-qrcode>
 						<uv-qrcode ref="qrcodeRef" size="350rpx" :value="QRCodeUrl"></uv-qrcode>
@@ -14,7 +14,7 @@
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-			<view class="box_bottom" @click="test">填写相关信息</view>
+			<view class="box_bottom">填写相关信息</view>
 		</view>
 		</view>
 
 
 		<view class="btns">
 		<view class="btns">
@@ -28,17 +28,30 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
-import { onShareAppMessage } from '@dcloudio/uni-app'
+import { onLoad, onShareAppMessage } from '@dcloudio/uni-app'
 import { ref } from 'vue'
 import { ref } from 'vue'
 
 
+const gradeId = ref('')
+const classId = ref('')
+const departmentId = ref('')
+const departmentId_list = ref('')
+
+const currentClass = ref('')
+
+onLoad(() => {
+	gradeId.value = uni.getStorageSync('grade_student')
+	classId.value = uni.getStorageSync('classes_student')
+	departmentId.value = uni.getStorageSync('departmentId')
+	departmentId_list.value = uni.getStorageSync('departmentId_list')
+	currentClass.value = uni.getStorageSync('currentClass')
+
+	QRCodeUrl.value = `https://chtech.ncjti.edu.cn/testingServer/repairManage/pages/register/register?gradeId=${gradeId.value}&classId=${classId.value}&departmentId=${departmentId.value}&departmentId_list=${departmentId_list.value}&currentClass=${currentClass.value}`
+})
+
 onShareAppMessage(() => {
 onShareAppMessage(() => {
-	if (res.from === 'button') {
-		// 来自页面内分享按钮
-		console.log(res.target)
-	}
 	return {
 	return {
-		title: '自定义分享标题',
-		path: '/pages/test/test?id=123'
+		title: '邀请家长',
+		path: `/pages/register/register?gradeId=${gradeId.value}&classId=${classId.value}&departmentId=${departmentId.value}&departmentId_list=${departmentId_list.value}&currentClass=${currentClass.value}`
 	}
 	}
 })
 })
 
 
@@ -46,38 +59,26 @@ onShareAppMessage(() => {
 const qrcodeRef = ref(null)
 const qrcodeRef = ref(null)
 
 
 // 二维码信息
 // 二维码信息
-const QRCodeUrl = ref('https://chtech.ncjti.edu.cn/testingServer/repairManage/')
+const QRCodeUrl = ref('')
 
 
 // 保存图片按钮回调
 // 保存图片按钮回调
 const handleSave = () => {
 const handleSave = () => {
 	qrcodeRef.value.save({
 	qrcodeRef.value.save({
 		success: (res) => {
 		success: (res) => {
-			console.log(res)
-
-			// uni.getImageInfo({
-			// 	url: res.tempFilePath,
-			// 	success: (res) => {
-			// 		console.log(res)
-			// 		uni.saveImageToPhotosAlbum({
-			// 			filePath: res.tempFilePath,
-			// 			success: function () {
-			// 				console.log('save success')
-			// 			}
-			// 		})
-			// 	}
-			// })
+			uni.showToast({
+				title: '保存成功',
+				icon: 'success'
+			})
 		},
 		},
 		fail: (err) => {
 		fail: (err) => {
 			console.log(err)
 			console.log(err)
+			uni.showToast({
+				title: '保存失败',
+				icon: 'none'
+			})
 		}
 		}
 	})
 	})
 }
 }
-
-const test = () => {
-	uni.navigateTo({
-		url: '/pages/register/register'
-	})
-}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>

+ 123 - 40
pages/late/late.vue

@@ -3,6 +3,19 @@
 		<!-- 背景图片区域 -->
 		<!-- 背景图片区域 -->
 		<img class="img_bg" src="../../static/images/center-bg.png" />
 		<img class="img_bg" src="../../static/images/center-bg.png" />
 
 
+		<!-- 选择年级区域 -->
+		<view class="grade">
+			<uni-data-picker
+				placeholder="请选择班级"
+				popup-title="请选择班级"
+				:clear-icon="false"
+				:map="{ text: 'name', value: 'classId' }"
+				:localdata="dataTree_student"
+				v-model="classes_student"
+				@change="onchange_student"
+			></uni-data-picker>
+		</view>
+
 		<!-- 时间筛选区域 -->
 		<!-- 时间筛选区域 -->
 		<view class="time">
 		<view class="time">
 			迟到时间
 			迟到时间
@@ -12,14 +25,20 @@
 		</view>
 		</view>
 
 
 		<!-- 迟到列表区域 -->
 		<!-- 迟到列表区域 -->
-		<view class="list">
+		<view class="list" v-if="list.length">
 			<uni-swipe-action>
 			<uni-swipe-action>
-				<view v-for="(item, index) in list" :key="index">
+				<view v-for="item in list" :key="item.id">
 					<uni-swipe-action-item :right-options="options" @click="onClickItem(item)">
 					<uni-swipe-action-item :right-options="options" @click="onClickItem(item)">
 						<!-- 每一个迟到记录区域 -->
 						<!-- 每一个迟到记录区域 -->
 						<view class="item_box">
 						<view class="item_box">
 							<view class="box_info">
 							<view class="box_info">
-								<image class="info_img" src="/static/images/header.png" mode="aspectFill"></image>
+								<image v-if="item.image" class="info_img" :src="item.image" mode="aspectFill" @click="clickImage(item.image)"></image>
+								<image
+									v-else
+									class="info_img"
+									src="https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png"
+									mode="aspectFill"
+								></image>
 								<view class="info_msg">
 								<view class="info_msg">
 									<view class="msg_name">
 									<view class="msg_name">
 										{{ item.name }}
 										{{ item.name }}
@@ -29,18 +48,29 @@
 									</view>
 									</view>
 								</view>
 								</view>
 							</view>
 							</view>
-							<view class="box_time">{{ item.timeGroup }}</view>
+							<view class="box_time">{{ item.dateTime }}</view>
 						</view>
 						</view>
 					</uni-swipe-action-item>
 					</uni-swipe-action-item>
 					<view style="height: 20rpx"></view>
 					<view style="height: 20rpx"></view>
 				</view>
 				</view>
 			</uni-swipe-action>
 			</uni-swipe-action>
 		</view>
 		</view>
+
+		<NoData v-else />
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
 import { ref } from 'vue'
 import { ref } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+import NoData from '@/components/noData.vue'
+import { myRequest } from '@/utils/api.js'
+import { decryptDes } from '@/utils/des.js'
+
+// 班级数组
+const dataTree_student = ref([])
+// 选择的班级
+const classes_student = ref()
 
 
 const options = [
 const options = [
 	{
 	{
@@ -51,58 +81,106 @@ const options = [
 	}
 	}
 ]
 ]
 
 
+// 迟到时间筛选
 const timeRang = ref([])
 const timeRang = ref([])
 
 
-const list = ref([
-	{
-		cardNo: '132',
-		name: '小明',
-		timeGroup: '时间组'
-	},
-	{
-		cardNo: '132',
-		name: '小明',
-		timeGroup: '时间组'
-	},
-	{
-		cardNo: '132',
-		name: '小明',
-		timeGroup: '时间组'
-	},
-	{
-		cardNo: '132',
-		name: '小明',
-		timeGroup: '时间组'
-	},
-	{
-		cardNo: '132',
-		name: '小明',
-		timeGroup: '时间组'
-	}
-])
+// 迟到数据
+const list = ref([])
+
+onLoad(() => {
+	const manageGrade = uni.getStorageSync('userInfo').manageGrade
+	const manageSchoolClass = uni.getStorageSync('userInfo').manageSchoolClass
+	getManageClass(manageSchoolClass, manageGrade)
+})
+
+// 获取管理的班级数组
+const getManageClass = async (manageSchoolClass, manageGrade) => {
+	const res = await myRequest({
+		url: '/wanzai/api/smartUser/getManageClass',
+		data: {
+			manageSchoolClass,
+			manageGrade
+		}
+	})
+	// console.log(res)
+	const result = JSON.parse(decryptDes(res.data))
+	// console.log(result)
+	dataTree_student.value = result
+	classes_student.value = result[0].classId
+	getData()
+}
+
+// 获取迟到数据
+const getData = async () => {
+	const res = await myRequest({
+		url: '/wanzai/api/smartLate/listApp',
+		data: {
+			currentPage: 1,
+			pageCount: 1000,
+			classId: classes_student.value,
+			startTime: timeRang.value.length ? timeRang.value[0] + ' 00:00:00' : '',
+			endTime: timeRang.value.length ? timeRang.value[1] + ' 00:00:00' : ''
+		}
+	})
+	// console.log(res)
+	const result = JSON.parse(decryptDes(res.data))
+	console.log(result)
+	list.value = result.list
+}
+
+// 点击图片回调
+const clickImage = (url) => {
+	uni.previewImage({
+		urls: [url],
+		current: 1
+	})
+}
 
 
 // 点击每一项删除回调
 // 点击每一项删除回调
 const onClickItem = (item) => {
 const onClickItem = (item) => {
 	uni.showModal({
 	uni.showModal({
 		title: '提示',
 		title: '提示',
-		content: `确定把${item.name}移除吗?`,
+		content: `确定把${item.name}的迟到记录移除吗?`,
 		success: (res) => {
 		success: (res) => {
 			if (res.confirm) {
 			if (res.confirm) {
-				// handleDeleteReq([item.id])
+				handleDeleteReq(item.id)
 			}
 			}
 		}
 		}
 	})
 	})
 }
 }
 
 
+// 删除请求
+const handleDeleteReq = async (id) => {
+	const res = await myRequest({
+		url: '/wanzai/api/smartLate/delete?id=1',
+		data: {
+			id
+		}
+	})
+	// console.log(res)
+	if (res.code == 200) {
+		uni.showToast({
+			title: '删除成功',
+			icon: 'success'
+		})
+		setTimeout(() => {
+			getData()
+		}, 1500)
+	}
+}
+
 // 切换时间回调
 // 切换时间回调
 const changeTime = (e) => {
 const changeTime = (e) => {
 	timeRang.value = e
 	timeRang.value = e
-	console.log(timeRang.value)
-	if (timeRang.value.length) {
-		console.log(1)
-	} else {
-		console.log(2)
-	}
+
+	getData()
+}
+
+// 学生部门筛选框选择时的回调
+const onchange_student = (e) => {
+	// console.log(e.detail.value)
+	// console.log(classes_student.value)
+	getData()
 }
 }
 </script>
 </script>
 
 
@@ -123,6 +201,11 @@ const changeTime = (e) => {
 		pointer-events: none;
 		pointer-events: none;
 	}
 	}
 
 
+	.grade {
+		margin-bottom: 20rpx;
+		height: 70rpx;
+	}
+
 	.time {
 	.time {
 		display: flex;
 		display: flex;
 		align-items: center;
 		align-items: center;
@@ -137,7 +220,7 @@ const changeTime = (e) => {
 	}
 	}
 
 
 	.list {
 	.list {
-		height: calc(100vh - 160rpx);
+		height: calc(100vh - 250rpx);
 		overflow-y: auto;
 		overflow-y: auto;
 
 
 		.item_box {
 		.item_box {

+ 2 - 2
pages/main/main.vue

@@ -11,7 +11,7 @@
 
 
 		<!-- 顶部图片区域 -->
 		<!-- 顶部图片区域 -->
 		<view class="header">
 		<view class="header">
-			<img mode="aspectFill" class="header_img" src="../../static/images/header.png" />
+			<img mode="aspectFill" class="header_img" src="https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png" />
 			<!-- 学校图标区域 -->
 			<!-- 学校图标区域 -->
 			<img mode="aspectFill" class="header_icon" src="../../static/images/school-logo.jpg" />
 			<img mode="aspectFill" class="header_icon" src="../../static/images/school-logo.jpg" />
 			<!-- 学校名称区域 -->
 			<!-- 学校名称区域 -->
@@ -246,4 +246,4 @@ const goLogin = (type) => {
 		}
 		}
 	}
 	}
 }
 }
-</style>
+</style>

+ 2 - 2
pages/myCenter/myCenter.vue

@@ -7,8 +7,8 @@
 			<img
 			<img
 				mode="aspectFill"
 				mode="aspectFill"
 				class="user_photo"
 				class="user_photo"
-				:src="userInfo.headImage || '../../static/images/header.png'"
-				@click="previewImage(userInfo.headImage || '../../static/images/header.png')"
+				:src="userInfo.headImage || 'https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png'"
+				@click="previewImage(userInfo.headImage || 'https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png')"
 			/>
 			/>
 			<!-- 姓名区域 -->
 			<!-- 姓名区域 -->
 			<view class="user_name">{{ userInfo.name }}</view>
 			<view class="user_name">{{ userInfo.name }}</view>

+ 319 - 19
pages/register/register.vue

@@ -2,7 +2,7 @@
 	<view class="container">
 	<view class="container">
 		<!-- 提示信息区域 -->
 		<!-- 提示信息区域 -->
 		<view class="header">
 		<view class="header">
-			<view class="header_top">欢迎加入七年级一班!!</view>
+			<view class="header_top">欢迎加入{{ currentClass }}!!</view>
 			<view>为确保您的信息顺利通过,请上传有效信息</view>
 			<view>为确保您的信息顺利通过,请上传有效信息</view>
 		</view>
 		</view>
 
 
@@ -18,7 +18,7 @@
 		</view>
 		</view>
 
 
 		<!-- 性别区域 -->
 		<!-- 性别区域 -->
-		<!-- 	<view class="box">
+		<view class="box">
 			<view class="box_key">
 			<view class="box_key">
 				<text class="text">*</text>
 				<text class="text">*</text>
 				性别
 				性别
@@ -34,7 +34,7 @@
 				</view>
 				</view>
 			</view>
 			</view>
-		</view> -->
+		</view>
 
 
 		<!-- 人脸图片区域 -->
 		<!-- 人脸图片区域 -->
 		<view class="box2">
 		<view class="box2">
@@ -42,10 +42,17 @@
 				<text class="text">*</text>
 				<text class="text">*</text>
 				人脸图片
 				人脸图片
 			</view>
 			</view>
-			<view class="box_upload">
+			<view v-if="!headImage" class="box_upload" @click="handleUpload">
 				<uni-icons type="plusempty" size="30" color="#666666"></uni-icons>
 				<uni-icons type="plusempty" size="30" color="#666666"></uni-icons>
 				上传照片
 				上传照片
 			</view>
 			</view>
+			<view v-else class="box_upload">
+				<image :src="headImage" mode="aspectFill" style="width: 160rpx; height: 160rpx" @click="clickImg(headImage)"></image>
+				<!-- 图片删除图标 -->
+				<view class="delete" @click="deleteImg">
+					<uni-icons type="close" size="20"></uni-icons>
+				</view>
+			</view>
 		</view>
 		</view>
 		<view class="tips">注:支持.jpg .png,五官清晰无遮挡,大小不超过2M</view>
 		<view class="tips">注:支持.jpg .png,五官清晰无遮挡,大小不超过2M</view>
 
 
@@ -64,17 +71,18 @@
 			</picker>
 			</picker>
 		</view> -->
 		</view> -->
 
 
-		<view class="box_list">
+		<view v-for="(item, index) in list" :key="index">
 			<!-- 家属区域 -->
 			<!-- 家属区域 -->
 			<view class="box">
 			<view class="box">
 				<view class="box_key">
 				<view class="box_key">
 					<text class="text">*</text>
 					<text class="text">*</text>
-					家属
+					家属{{ index + 1 }}
 				</view>
 				</view>
 				<view class="box_value">
 				<view class="box_value">
-					<input class="input" type="text" placeholder="请输入姓名" />
+					<input v-model="item.name" class="input" type="text" placeholder="请输入称呼或职业" />
 					<view class="value_icon">
 					<view class="value_icon">
-						<uni-icons type="plus" size="25" color="#0061FF"></uni-icons>
+						<uni-icons v-if="index == 0" type="plus" size="25" color="#0061FF" @click="handleAdd"></uni-icons>
+						<uni-icons v-else type="close" size="25" color="#0061FF" @click="handleDelete(index)"></uni-icons>
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
@@ -86,7 +94,7 @@
 					手机号码
 					手机号码
 				</view>
 				</view>
 				<view class="box_value">
 				<view class="box_value">
-					<input class="input" type="text" placeholder="请输入手机号码" />
+					<input v-model="item.phone" class="input" type="text" placeholder="请输入手机号码" />
 				</view>
 				</view>
 			</view>
 			</view>
 
 
@@ -97,33 +105,318 @@
 					家属与本人的关系
 					家属与本人的关系
 				</view>
 				</view>
 				<view class="box_value">
 				<view class="box_value">
-					<input class="input" type="text" placeholder="请输入家属与本人的关系" />
+					<input v-model="item.ship" class="input" type="text" placeholder="请输入家属与本人的关系" />
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 
 
-		<view class="btn">确认</view>
+		<view class="btn" @click="handleConfirm">确认</view>
+
+		<!-- 用于图片压缩的canvas画布 -->
+		<canvas
+			:style="{
+				width: cw + 'px',
+				height: cw + 'px',
+				position: 'absolute',
+				zIndex: -1,
+				left: '-10000rpx',
+				top: '-10000rpx'
+			}"
+			canvas-id="zipCanvas"
+		></canvas>
+		<!--画布结束-->
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script setup>
 <script setup>
+import { onLoad } from '@dcloudio/uni-app'
 import { ref } from 'vue'
 import { ref } from 'vue'
+import { getQueryString } from '@/utils/getParams.js'
+import { myRequest } from '@/utils/api.js'
+import { decryptDes } from '@/utils/des.js'
+import getLessLimitSizeImage from '@/utils/imageCompress.js'
 
 
 // 姓名
 // 姓名
-const name = ref()
+const name = ref('')
 // 性别
 // 性别
 const gender = ref(1)
 const gender = ref(1)
+// 照片
+const headImage = ref('')
 // 时间组当前激活索引
 // 时间组当前激活索引
-const currentIndex = ref()
+// const currentIndex = ref()
 // 时间组数据
 // 时间组数据
-const array = ref(['上午', '下午'])
+// const array = ref(['上午', '下午'])
+
+const gradeId = ref('')
+const classId = ref('')
+const departmentId = ref('')
+const departmentId_list = ref('')
+const currentClass = ref('')
+
+const list = ref([
+	{
+		name: '',
+		phone: '',
+		ship: '',
+		departmentId: departmentId_list.value
+	}
+])
+
+//画板边长默认是屏幕宽度,正方形画布
+const cw = uni.getSystemInfoSync().windowWidth
+
+onLoad((options) => {
+	// console.log(options)
+	if (options.q) {
+		const data = decodeURIComponent(options.q)
+		gradeId.value = getQueryString(data, 'gradeId')
+		classId.value = getQueryString(data, 'classId')
+		departmentId.value = getQueryString(data, 'departmentId')
+		departmentId_list.value = getQueryString(data, 'departmentId_list')
+		currentClass.value = getQueryString(data, 'currentClass')
+	} else {
+		gradeId.value = options.gradeId
+		classId.value = options.classId
+		departmentId.value = options.departmentId
+		departmentId_list.value = options.departmentId_list
+		currentClass.value = options.currentClass
+	}
+})
+
 // 切换性别回调
 // 切换性别回调
 const handlegender = (v) => {
 const handlegender = (v) => {
 	gender.value = v
 	gender.value = v
 }
 }
 // 切换时间组回调
 // 切换时间组回调
-const bindPickerChange = (e) => {
-	currentIndex.value = e.detail.value
+// const bindPickerChange = (e) => {
+// 	currentIndex.value = e.detail.value
+// }
+
+// 上传照片回调
+const handleUpload = () => {
+	uni.chooseMedia({
+		count: 1,
+		mediaType: ['image'],
+		sourceType: ['album'],
+		sizeType: ['compressed'],
+		success: (res) => {
+			// console.log(res.tempFiles)
+
+			res.tempFiles.forEach((ele) => {
+				if (ele.fileType === 'image' && ele.size > 1024 * 1024 * 2) {
+					//这里的id和页面中写的html代码的canvas的id要一致
+					let canvasId = 'zipCanvas'
+					//原图的路径
+					let imagePath = ele.tempFilePath
+					//大小限制1024kb
+					let limitSize = 1024 * 2
+					//初始绘画区域是画布自身的宽度也就是屏幕宽度
+					let drawWidth = uni.getSystemInfoSync().windowWidth
+					// 图片过大压缩
+					getLessLimitSizeImage(canvasId, imagePath, limitSize, drawWidth, (resPath) => {
+						handleUploadMini({ tempFilePath: resPath, fileType: ele.fileType })
+					})
+				} else {
+					handleUploadMini(ele)
+				}
+			})
+		}
+	})
+}
+
+const handleUploadMini = (ele) => {
+	uni.showLoading({
+		title: '上传中,请稍后',
+		mask: true
+	})
+	uni.uploadFile({
+		url: `https://www.campussmartlife.com/smartApi/wanzai/api/upload/toCos`,
+		filePath: ele.tempFilePath,
+		name: 'files',
+		header: {
+			token: uni.getStorageSync('token') || '',
+			user_head: uni.getStorageSync('userhead') || ''
+		},
+		success: (uploadFileRes) => {
+			// console.log(uploadFileRes)
+			let imgUrl = JSON.parse(uploadFileRes.data).data
+
+			const result = JSON.parse(decryptDes(imgUrl))
+			// console.log(result)
+			headImage.value = result
+		},
+		fail: () => {
+			uni.showToast({
+				title: '上传失败',
+				icon: 'error'
+			})
+		},
+		complete: () => {
+			uni.hideLoading()
+		}
+	})
+}
+
+// 点击图片回调
+const clickImg = (url) => {
+	uni.previewImage({
+		urls: [url],
+		current: 1
+	})
+}
+
+// 删除图片回调
+const deleteImg = () => {
+	uni.showModal({
+		title: '提示',
+		content: '确定删除该图片吗?',
+		success: (res) => {
+			if (res.confirm) {
+				headImage.value = ''
+			}
+		}
+	})
+}
+
+// 家属添加图标回调
+const handleAdd = () => {
+	list.value.push({
+		name: '',
+		phone: '',
+		ship: '',
+		departmentId: departmentId_list.value
+	})
+}
+
+// 家属删除图标回调
+const handleDelete = (index) => {
+	// console.log(index)
+	uni.showModal({
+		title: '提示',
+		content: '确定删除该家属吗?',
+		success: (res) => {
+			if (res.confirm) {
+				list.value.splice(index, 1)
+			}
+		}
+	})
+}
+
+// 确认按钮回调
+const handleConfirm = () => {
+	const flag = verify()
+
+	if (flag) {
+		uni.showModal({
+			title: '提示',
+			content: '确定提交吗?',
+			success: (res) => {
+				if (res.confirm) {
+					handleConfirmReq()
+				}
+			}
+		})
+	}
+}
+
+// 验证提交数据是否合法
+const verify = () => {
+	if (!name.value) {
+		uni.showToast({
+			title: '请输入姓名',
+			icon: 'none'
+		})
+		return false
+	}
+
+	let reg_name = /^[\u4e00-\u9fa5]{2,4}$/
+	if (!reg_name.test(name.value)) {
+		uni.showToast({
+			title: '姓名格式错误',
+			icon: 'none'
+		})
+		return false
+	}
+
+	if (!headImage.value) {
+		uni.showToast({
+			title: '请上传图片',
+			icon: 'none'
+		})
+		return false
+	}
+
+	// if (!currentIndex.value) {
+	// 	uni.showToast({
+	// 		title: '请选择时间组',
+	// 		icon: 'none'
+	// 	})
+	// 	return false
+	// }
+
+	let res = list.value.some((ele) => !ele.name || !ele.phone || !ele.ship)
+
+	if (res) {
+		uni.showToast({
+			title: '家属数据不能为空',
+			icon: 'none'
+		})
+		return false
+	}
+
+	let res2 = list.value.some((ele) => !reg_name.test(ele.name))
+
+	if (res2) {
+		uni.showToast({
+			title: '家属姓名格式错误',
+			icon: 'none'
+		})
+		return false
+	}
+
+	let reg_phone = /^1[3-9]\d{9}$/
+	let res3 = list.value.some((ele) => !reg_phone.test(ele.phone))
+
+	if (res3) {
+		uni.showToast({
+			title: '家属手机号码格式错误',
+			icon: 'none'
+		})
+		return false
+	}
+
+	return true
+}
+
+// 确认请求
+const handleConfirmReq = async () => {
+	let data = {
+		name: name.value,
+		sexId: gender.value,
+		headImage: headImage.value,
+		departmentId: departmentId.value,
+		gradeId: gradeId.value,
+		classId: classId.value,
+		list: list.value
+	}
+	// console.log(data)
+	const res = await myRequest({
+		url: '/wanzai/api/smartEnrollmentUser/insertSmartEnrollmentUser',
+		method: 'post',
+		data
+	})
+	// console.log(res)
+	if (res.code == 200) {
+		uni.showToast({
+			title: '添加成功,请等待审核',
+			icon: 'none'
+		})
+		// setTimeout(() => {
+		// 	uni.reLaunch({
+		// 		url: '/pages/studentManage/studentManage'
+		// 	})
+		// }, 1500)
+	}
 }
 }
 </script>
 </script>
 
 
@@ -131,7 +424,7 @@ const bindPickerChange = (e) => {
 .container {
 .container {
 	box-sizing: border-box;
 	box-sizing: border-box;
 	padding: 10rpx 0 30rpx 15rpx;
 	padding: 10rpx 0 30rpx 15rpx;
-	height: 100vh;
+	min-height: 100vh;
 	font-size: 28rpx;
 	font-size: 28rpx;
 
 
 	.header {
 	.header {
@@ -177,7 +470,7 @@ const bindPickerChange = (e) => {
 
 
 			.input {
 			.input {
 				height: 100%;
 				height: 100%;
-				text-align: end;
+				text-align: right;
 			}
 			}
 
 
 			.men,
 			.men,
@@ -220,6 +513,7 @@ const bindPickerChange = (e) => {
 		}
 		}
 
 
 		.box_upload {
 		.box_upload {
+			position: relative;
 			display: flex;
 			display: flex;
 			flex-direction: column;
 			flex-direction: column;
 			justify-content: center;
 			justify-content: center;
@@ -231,6 +525,12 @@ const bindPickerChange = (e) => {
 			color: #666666;
 			color: #666666;
 			border-radius: 6rpx;
 			border-radius: 6rpx;
 			background-color: #f2f2f2;
 			background-color: #f2f2f2;
+
+			.delete {
+				position: absolute;
+				right: 10rpx;
+				top: 10rpx;
+			}
 		}
 		}
 	}
 	}
 
 
@@ -245,7 +545,7 @@ const bindPickerChange = (e) => {
 		display: flex;
 		display: flex;
 		justify-content: center;
 		justify-content: center;
 		align-items: center;
 		align-items: center;
-		margin: 200rpx auto 0;
+		margin: 80rpx auto 0;
 		width: 710rpx;
 		width: 710rpx;
 		height: 100rpx;
 		height: 100rpx;
 		color: #fff;
 		color: #fff;

+ 12 - 6
pages/set/set.vue

@@ -8,6 +8,7 @@
 					placeholder="请选择部门"
 					placeholder="请选择部门"
 					popup-title="请选择部门"
 					popup-title="请选择部门"
 					:map="{ text: 'name', value: 'id' }"
 					:map="{ text: 'name', value: 'id' }"
+					:clear-icon="false"
 					:localdata="dataTree_student"
 					:localdata="dataTree_student"
 					v-model="classes_student"
 					v-model="classes_student"
 					@change="onchange_student"
 					@change="onchange_student"
@@ -23,6 +24,7 @@
 					placeholder="请选择部门"
 					placeholder="请选择部门"
 					popup-title="请选择部门"
 					popup-title="请选择部门"
 					:map="{ text: 'name', value: 'id' }"
 					:map="{ text: 'name', value: 'id' }"
+					:clear-icon="false"
 					:localdata="dataTree_family"
 					:localdata="dataTree_family"
 					v-model="classes_family"
 					v-model="classes_family"
 					@change="onchange_family"
 					@change="onchange_family"
@@ -51,6 +53,8 @@ const dataTree_family = ref([])
 const classes_family = ref()
 const classes_family = ref()
 
 
 onLoad(() => {
 onLoad(() => {
+	classes_student.value = uni.getStorageSync('departmentId')
+	classes_family.value = uni.getStorageSync('departmentId_list')
 	// 获取学生部门数据
 	// 获取学生部门数据
 	getData_student()
 	getData_student()
 
 
@@ -78,20 +82,22 @@ const getData_family = async () => {
 
 
 // 学生部门筛选框选择时的回调
 // 学生部门筛选框选择时的回调
 const onchange_student = (e) => {
 const onchange_student = (e) => {
-	console.log(e.detail.value)
-	console.log(classes_student.value)
+	// console.log(e.detail.value)
+	// console.log(classes_student.value)
+	uni.setStorageSync('departmentId', classes_student.value)
 }
 }
 
 
 // 家属部门筛选框选择时的回调
 // 家属部门筛选框选择时的回调
 const onchange_family = (e) => {
 const onchange_family = (e) => {
-	console.log(e.detail.value)
-	console.log(classes_family.value)
+	// console.log(e.detail.value)
+	// console.log(classes_family.value)
+	uni.setStorageSync('departmentId_list', classes_family.value)
 }
 }
 
 
 // 点击确认按钮回调
 // 点击确认按钮回调
 const clickBtn = () => {
 const clickBtn = () => {
-	console.log(classes_student.value)
-	console.log(classes_family.value)
+	// console.log(classes_student.value)
+	// console.log(classes_family.value)
 	uni.reLaunch({
 	uni.reLaunch({
 		url: '/pages/studentManage/studentManage'
 		url: '/pages/studentManage/studentManage'
 	})
 	})

+ 54 - 7
pages/statistics/statistics.vue

@@ -8,6 +8,18 @@
 			<uni-datetime-picker type="date" :clear-icon="false" v-model="time" @change="changeTime"></uni-datetime-picker>
 			<uni-datetime-picker type="date" :clear-icon="false" v-model="time" @change="changeTime"></uni-datetime-picker>
 		</div>
 		</div>
 
 
+		<view class="school">
+			<uni-data-picker
+				placeholder="请选择班级"
+				popup-title="请选择班级"
+				:clear-icon="false"
+				:map="{ text: 'name', value: 'classId' }"
+				:localdata="dataTree_student"
+				v-model="classes_student"
+				@change="onchange_student"
+			></uni-data-picker>
+		</view>
+
 		<!-- 状态选择区域 -->
 		<!-- 状态选择区域 -->
 		<div class="type">
 		<div class="type">
 			<div class="type_box" :class="{ active: currentType === 1 }" @click="changeType(1)">未监听({{ info?.abnormal?.count }})</div>
 			<div class="type_box" :class="{ active: currentType === 1 }" @click="changeType(1)">未监听({{ info?.abnormal?.count }})</div>
@@ -98,19 +110,43 @@ const popup = ref(null)
 // 弹窗请假信息
 // 弹窗请假信息
 const askInfo = ref({})
 const askInfo = ref({})
 
 
+const dataTree_student = ref([])
+
+const classes_student = ref()
+
 onLoad(() => {
 onLoad(() => {
 	// 获取当前时间
 	// 获取当前时间
 	time.value = dayjs(Date.now()).format('YYYY-MM-DD') + ' 00:00:00'
 	time.value = dayjs(Date.now()).format('YYYY-MM-DD') + ' 00:00:00'
 
 
-	getData()
+	const manageGrade = uni.getStorageSync('userInfo').manageGrade
+	const manageSchoolClass = uni.getStorageSync('userInfo').manageSchoolClass
+	getManageClass(manageSchoolClass, manageGrade)
 })
 })
 
 
+// 获取管理的班级数组
+const getManageClass = async (manageSchoolClass, manageGrade) => {
+	const res = await myRequest({
+		url: '/wanzai/api/smartUser/getManageClass',
+		data: {
+			manageSchoolClass,
+			manageGrade
+		}
+	})
+	// console.log(res)
+	const result = JSON.parse(decryptDes(res.data))
+	// console.log(result)
+	dataTree_student.value = result
+	classes_student.value = result[0].classId
+	getData()
+}
+
 // 获取列表数据
 // 获取列表数据
 const getData = async () => {
 const getData = async () => {
 	const res = await myRequest({
 	const res = await myRequest({
 		url: '/wanzai/api/smartUser/statisticsCampus',
 		url: '/wanzai/api/smartUser/statisticsCampus',
 		data: {
 		data: {
-			classId: uni.getStorageSync('userInfo').schoolClass,
+			// classId: uni.getStorageSync('userInfo').schoolClass,
+			classId: classes_student.value,
 			dateTime: time.value
 			dateTime: time.value
 		}
 		}
 	})
 	})
@@ -156,10 +192,9 @@ const clickName = async (item) => {
 	// console.log(res)
 	// console.log(res)
 	if (res.code == 200) {
 	if (res.code == 200) {
 		const result = JSON.parse(decryptDes(res.data))
 		const result = JSON.parse(decryptDes(res.data))
-		// console.log(result)
-
+		console.log(result)
 		uni.navigateTo({
 		uni.navigateTo({
-			url: `/pages/student/student?msg=${JSON.stringify(result)}`
+			url: `/pages/student/student?msg=${encodeURIComponent(JSON.stringify(result))}`
 		})
 		})
 	}
 	}
 }
 }
@@ -196,6 +231,13 @@ const getAskInfo = async (userId) => {
 		askInfo.value = result[0]
 		askInfo.value = result[0]
 	}
 	}
 }
 }
+
+// 班级筛选框选择时的回调
+const onchange_student = (e) => {
+	// console.log(e.detail.value)
+	// console.log(classes_student.value)
+	getData()
+}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -223,6 +265,10 @@ const getAskInfo = async (userId) => {
 		height: 80rpx;
 		height: 80rpx;
 	}
 	}
 
 
+	.school {
+		margin-bottom: 30rpx;
+	}
+
 	.type {
 	.type {
 		position: relative;
 		position: relative;
 		display: flex;
 		display: flex;
@@ -252,9 +298,10 @@ const getAskInfo = async (userId) => {
 	.list {
 	.list {
 		padding: 30rpx 20rpx;
 		padding: 30rpx 20rpx;
 		margin-top: 20rpx;
 		margin-top: 20rpx;
-		max-height: calc(100vh - 402rpx);
+		max-height: calc(100vh - 532rpx);
 		font-size: 28rpx;
 		font-size: 28rpx;
 		background-color: #fff;
 		background-color: #fff;
+		overflow-y: auto;
 
 
 		.list_header {
 		.list_header {
 			display: flex;
 			display: flex;
@@ -270,7 +317,7 @@ const getAskInfo = async (userId) => {
 		}
 		}
 
 
 		.list_content {
 		.list_content {
-			max-height: calc(100vh - 475rpx);
+			max-height: calc(100vh - 605rpx);
 			overflow-y: auto;
 			overflow-y: auto;
 
 
 			.list_box {
 			.list_box {

+ 2 - 2
pages/student/student.vue

@@ -24,8 +24,8 @@
 			<img
 			<img
 				class="box_img"
 				class="box_img"
 				mode="aspectFill"
 				mode="aspectFill"
-				:src="item.headImage || '../../static/images/user-photo.png'"
-				@click="previewImage(item.headImage || '../../static/images/user-photo.png')"
+				:src="item.headImage || 'https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png'"
+				@click="previewImage(item.headImage || 'https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png')"
 			/>
 			/>
 			<view class="box_info">
 			<view class="box_info">
 				<view class="info_name">
 				<view class="info_name">

+ 113 - 13
pages/studentManage/studentManage.vue

@@ -14,6 +14,19 @@
 			</view>
 			</view>
 		</view>
 		</view>
 
 
+		<!-- 选择年级区域 -->
+		<view class="grade">
+			<uni-data-picker
+				placeholder="请选择班级"
+				popup-title="请选择班级"
+				:map="{ text: 'name', value: 'classId' }"
+				:clear-icon="false"
+				:localdata="dataTree_student"
+				v-model="classes_student"
+				@nodeclick="onchange_student"
+			></uni-data-picker>
+		</view>
+
 		<!-- 功能按钮区域 -->
 		<!-- 功能按钮区域 -->
 		<view class="school" v-if="list.length">
 		<view class="school" v-if="list.length">
 			<!-- 邀请家长按钮区域 -->
 			<!-- 邀请家长按钮区域 -->
@@ -55,7 +68,13 @@
 						<!-- 每一个学生区域 -->
 						<!-- 每一个学生区域 -->
 						<view class="item_box" @click="handleClickItem(item)">
 						<view class="item_box" @click="handleClickItem(item)">
 							<view class="box_info">
 							<view class="box_info">
-								<image class="info_img" src="/static/images/header.png" mode="aspectFill"></image>
+								<image v-if="item.headImage" class="info_img" :src="item.headImage" mode="aspectFill"></image>
+								<image
+									v-else
+									class="info_img"
+									src="https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png"
+									mode="aspectFill"
+								></image>
 								<view class="info_msg">
 								<view class="info_msg">
 									<view class="msg_name">
 									<view class="msg_name">
 										{{ item.name }}
 										{{ item.name }}
@@ -164,19 +183,54 @@ const options = [
 	}
 	}
 ]
 ]
 
 
+// 判断是修改还是删除
 const currentType = ref('')
 const currentType = ref('')
+// 班级数组
+const dataTree_student = ref([])
+// 选择的班级
+const classes_student = ref()
+// 选择的年级
+const grade_student = ref()
 
 
 onLoad(() => {
 onLoad(() => {
-	getData()
+	const manageGrade = uni.getStorageSync('userInfo').manageGrade
+	const manageSchoolClass = uni.getStorageSync('userInfo').manageSchoolClass
+	getManageClass(manageSchoolClass, manageGrade)
 })
 })
 
 
+// 获取管理的班级数组
+const getManageClass = async (manageSchoolClass, manageGrade) => {
+	const res = await myRequest({
+		url: '/wanzai/api/smartUser/getManageClass',
+		data: {
+			manageSchoolClass,
+			manageGrade
+		}
+	})
+	// console.log(res)
+	const result = JSON.parse(decryptDes(res.data))
+	// console.log(result)
+	dataTree_student.value = result
+	classes_student.value = result[0].classId
+	grade_student.value = result[0].gradeId
+	classInfo.value = result[0].name
+	uni.setStorageSync('grade_student', grade_student.value)
+	uni.setStorageSync('classes_student', classes_student.value)
+	uni.setStorageSync('currentClass', classInfo.value)
+	uni.setNavigationBarTitle({
+		title: classInfo.value
+	})
+	getData()
+}
+
 // 获取学生列表数据
 // 获取学生列表数据
 const getData = async () => {
 const getData = async () => {
 	const res = await myRequest({
 	const res = await myRequest({
 		url: '/wanzai/api/smartUser/queryClassUser',
 		url: '/wanzai/api/smartUser/queryClassUser',
 		data: {
 		data: {
 			userId: uni.getStorageSync('userInfo').id,
 			userId: uni.getStorageSync('userInfo').id,
-			keyWord: keyWord.value
+			keyWord: keyWord.value,
+			classId: classes_student.value
 		}
 		}
 	})
 	})
 	// console.log(res)
 	// console.log(res)
@@ -186,17 +240,28 @@ const getData = async () => {
 	list.value.forEach((ele) => {
 	list.value.forEach((ele) => {
 		ele.isChecked = false
 		ele.isChecked = false
 	})
 	})
-	classInfo.value = result.name
-	uni.setNavigationBarTitle({
-		title: result.name
-	})
 }
 }
 
 
 // 点击邀请家长按钮回调
 // 点击邀请家长按钮回调
 const handleInvitation = () => {
 const handleInvitation = () => {
-	uni.navigateTo({
-		url: '/pages/invitation/invitation'
-	})
+	let departmentId = uni.getStorageSync('departmentId')
+	let departmentId_list = uni.getStorageSync('departmentId_list')
+
+	if (departmentId && departmentId_list) {
+		uni.navigateTo({
+			url: '/pages/invitation/invitation'
+		})
+	} else {
+		uni.showToast({
+			title: '请先选择部门',
+			icon: 'none'
+		})
+		setTimeout(() => {
+			uni.navigateTo({
+				url: '/pages/set/set'
+			})
+		}, 1500)
+	}
 }
 }
 
 
 // 点击批量按钮回调
 // 点击批量按钮回调
@@ -208,9 +273,24 @@ const handleEdit = (type) => {
 
 
 // 点击添加按钮回调
 // 点击添加按钮回调
 const handleAdd = () => {
 const handleAdd = () => {
-	uni.navigateTo({
-		url: '/pages/addStudent/addStudent'
-	})
+	let departmentId = uni.getStorageSync('departmentId')
+	let departmentId_list = uni.getStorageSync('departmentId_list')
+
+	if (departmentId && departmentId_list) {
+		uni.navigateTo({
+			url: '/pages/addStudent/addStudent'
+		})
+	} else {
+		uni.showToast({
+			title: '请先选择部门',
+			icon: 'none'
+		})
+		setTimeout(() => {
+			uni.navigateTo({
+				url: '/pages/set/set'
+			})
+		}, 1500)
+	}
 }
 }
 
 
 // 批量删除按钮回调
 // 批量删除按钮回调
@@ -417,6 +497,21 @@ const handleClickSet = () => {
 		url: '/pages/set/set'
 		url: '/pages/set/set'
 	})
 	})
 }
 }
+
+// 学生部门筛选框选择时的回调
+const onchange_student = (e) => {
+	// console.log(e)
+	classes_student.value = e.classId
+	grade_student.value = e.gradeId
+	classInfo.value = e.name
+	uni.setStorageSync('currentClass', classInfo.value)
+	uni.setNavigationBarTitle({
+		title: classInfo.value
+	})
+	uni.setStorageSync('grade_student', grade_student.value)
+	uni.setStorageSync('classes_student', classes_student.value)
+	getData()
+}
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
@@ -473,6 +568,11 @@ const handleClickSet = () => {
 		}
 		}
 	}
 	}
 
 
+	.grade {
+		margin-top: 10rpx;
+		height: 70rpx;
+	}
+
 	// 学校名称区域样式
 	// 学校名称区域样式
 	.school {
 	.school {
 		display: flex;
 		display: flex;

+ 17 - 1
pages/switch/switch.vue

@@ -8,13 +8,21 @@
 			<!-- 每一个身份区域 -->
 			<!-- 每一个身份区域 -->
 			<view class="list_item" v-for="item in listData" :key="item.id" @click="handleChange(item)">
 			<view class="list_item" v-for="item in listData" :key="item.id" @click="handleChange(item)">
 				<!-- 头像 -->
 				<!-- 头像 -->
-				<img class="item_img" mode="aspectFill" :src="item.headImage || '/static/images/header.png'" />
+				<img
+					class="item_img"
+					mode="aspectFill"
+					:src="item.headImage || 'https://wanzai-1306339220.cos.ap-shanghai.myqcloud.com/excelModel/nupp7VVnHWpVa413437dba82ce85374b2a4ee1a6b973.png'"
+				/>
 				<!-- 姓名 -->
 				<!-- 姓名 -->
 				<view class="item_name">{{ item.name }}</view>
 				<view class="item_name">{{ item.name }}</view>
 				<!-- 身份类别 -->
 				<!-- 身份类别 -->
 				<view v-if="item.identityId === 1" class="item_type parents">家长</view>
 				<view v-if="item.identityId === 1" class="item_type parents">家长</view>
 				<view v-if="item.identityId === 2" class="item_type student">学生</view>
 				<view v-if="item.identityId === 2" class="item_type student">学生</view>
 				<view v-if="item.identityId === 3" class="item_type teacher">老师</view>
 				<view v-if="item.identityId === 3" class="item_type teacher">老师</view>
+				<view v-if="item.identityId === 14" class="item_type else">其他</view>
+				<view v-if="item.identityId === 18" class="item_type teacher">年级主任</view>
+				<view v-if="item.identityId === 19" class="item_type manage">超级管理员</view>
+				<view v-if="item.identityId === 20" class="item_type teacher">班主任</view>
 
 
 				<!-- 是否设置成默认身份 -->
 				<!-- 是否设置成默认身份 -->
 				<!-- <view class="item_default" @click="handleClick(item)">
 				<!-- <view class="item_default" @click="handleClick(item)">
@@ -131,6 +139,14 @@ const handleChange = (item) => {
 				background-color: orange;
 				background-color: orange;
 			}
 			}
 
 
+			.else {
+				background-color: #d43030;
+			}
+
+			.manage {
+				background-color: #d43030;
+			}
+
 			.item_default {
 			.item_default {
 				position: absolute;
 				position: absolute;
 				top: 118rpx;
 				top: 118rpx;

BIN
static/images/header.png


+ 14 - 0
utils/getParams.js

@@ -0,0 +1,14 @@
+//获取当前URL指定参数
+export const getQueryString = (v, name) => {
+	// 获取URL
+	let url = v;
+	// 正则匹配URL
+	let pattern = new RegExp("[?&]" + name + "=([^&]+)", "i");
+	let matcher = pattern.exec(url);
+	if (matcher == null || matcher.length < 1) {
+		return false;
+	}
+	// 输出指定的参数值
+	return decodeURIComponent(matcher[1]);
+	// return matcher[1];
+}