MS-CIAZDCOIXVRW\Administrator 3 vuotta sitten
vanhempi
commit
95ce47b2a6

+ 2 - 1
pagesClockIn/addRules/addRules.vue

@@ -242,7 +242,8 @@
 								url: "/attendance/api/settings/rule/add",
 								method: "post",
 								header: {
-									'Authorization': uni.getStorageSync("token")
+									'Authorization': uni.getStorageSync("token"),
+									'platform': 2
 								},
 								data: {
 									// 是否需要人脸识别

+ 9 - 4
pagesClockIn/authentication/authentication.vue

@@ -44,7 +44,7 @@
 		data() {
 			return {
 				// 错误文案提示
-				tipsText: '',
+				tipsText: '人脸检测初始化失败,请退出重试',
 				// 当前时间
 				nowTime: "",
 				// 本地图片路径 被匹对照片
@@ -69,6 +69,7 @@
 			};
 		},
 		onLoad(options) {
+			this.initData()
 			let userInfo = uni.getStorageSync("userInfo")
 			if (userInfo) {
 				this.name = userInfo.name
@@ -79,7 +80,6 @@
 			this.lng = options.longitude
 			this.location = options.address
 			this.sceneImage = options.imgUrl
-			this.initData()
 		},
 		methods: {
 			// 初始化相机引擎
@@ -134,7 +134,7 @@
 							if (err.x == -1 || err.y == -1) {
 								this.tipsText = '检测不到人'
 							} else {
-								this.tipsText = err.errMsg || '网络错误,请退出页面重试'
+								this.tipsText = '网络错误,请退出页面重试'
 							}
 						},
 					})
@@ -189,6 +189,9 @@
 						url: `https://chtech.ncjti.edu.cn/campusclock/attendance/api/file/upload`,
 						filePath: url,
 						name: 'file',
+						header: {
+							'platform': 2
+						},
 						success: (uploadFileRes) => {
 							let imgUrl = JSON.parse(uploadFileRes.data)
 								.data
@@ -208,7 +211,8 @@
 					url: "/attendance/api/sign/check/in/update",
 					method: "put",
 					header: {
-						'Authorization': uni.getStorageSync("token")
+						'Authorization': uni.getStorageSync("token"),
+						'platform': 2
 					},
 					data: {
 						id: this.id,
@@ -262,6 +266,7 @@
 			margin-top: 100rpx;
 			height: 40rpx;
 			text-align: center;
+			color: #5393FF;
 		}
 
 		.photo {

+ 2 - 0
pagesClockIn/components/chocolate-progress-bar/chocolate-progress-bar.vue

@@ -78,12 +78,14 @@
 		text-align: center;
 
 		.progress_bg {
+			z-index: 1;
 			position: absolute;
 			width: 100%;
 			height: 100%;
 		}
 
 		.progress_bar {
+			z-index: 1;
 			position: absolute;
 			width: 100%;
 			height: 100%;

+ 2 - 1
pagesClockIn/editRules/editRules.vue

@@ -280,7 +280,8 @@
 								url: "/attendance/api/settings/rule/update",
 								method: "put",
 								header: {
-									'Authorization': uni.getStorageSync("token")
+									'Authorization': uni.getStorageSync("token"),
+									'platform': 2
 								},
 								data: {
 									// 编辑的规则id

+ 2 - 1
pagesClockIn/group/group.vue

@@ -266,7 +266,8 @@
 					url: "/attendance/api/settings/group/add",
 					method: "post",
 					header: {
-						'Authorization': uni.getStorageSync("token")
+						'Authorization': uni.getStorageSync("token"),
+						'platform': 2
 					},
 					data: {
 						name: this.group_name,

+ 29 - 4
pagesClockIn/home/home.vue

@@ -1,5 +1,6 @@
 <template>
 	<view class="container">
+		<view class="placeholder"></view>
 		<!-- 头部学生信息区域 -->
 		<view class="header">
 			<view class="img">
@@ -269,7 +270,26 @@
 								icon: 'none'
 							})
 						}
-					}
+					},
+					fail: (error) => {
+						uni.showModal({
+							title: '提示',
+							content: '请先开启定位权限,否则将无法使用定位功能',
+							cancelText: '不授权',
+							confirmText: '授权',
+							success: function(res) {
+								if (res.confirm) {
+									uni.openSetting({
+										success(res) {}
+									})
+								} else if (res.cancel) {
+									uni.redirectTo({
+										url: "/pagesClockIn/index/index"
+									})
+								}
+							},
+						});
+					},
 				})
 			},
 			// 获取打卡规则列表
@@ -300,7 +320,7 @@
 					// 没有到打卡时间 或者 超过打卡时间 的状态
 					if (this.timestamp < this.contrastObj.beginTime || this.timestamp > this.contrastObj.endTime) {
 						this.flags = false
-						this.notes = "未到打卡时间无法打卡"
+						this.notes = "不在打卡时间段内,无法打卡"
 					}
 					// 到了打卡时间,判断是否在打卡范围内
 					else {
@@ -393,9 +413,14 @@
 
 <style lang="scss" scoped>
 	.container {
-		padding-top: 20rpx;
+		width: 100vw;
+		height: 100vh;
 		background-color: #F2F2F2;
 
+		.placeholder {
+			height: 20rpx;
+		}
+
 		.header {
 			display: flex;
 			margin: 0 30rpx 30rpx 30rpx;
@@ -435,7 +460,7 @@
 		.body {
 			margin: 0 30rpx;
 			width: 690rpx;
-			height: 919rpx;
+			height: 75vh;
 			background-color: #fff;
 
 			.card {

+ 1 - 0
pagesClockIn/index/index.vue

@@ -97,6 +97,7 @@
 					method: "post",
 					header:{
 						'content-type': 'application/json',
+						'platform': 2
 					},
 					data: {
 						redirect_uri: `mnp://${this.appid}`,

+ 3 - 0
pagesClockIn/location/location.vue

@@ -130,6 +130,9 @@
 									url: `https://chtech.ncjti.edu.cn/campusclock/attendance/api/file/upload`,
 									filePath: res.tempFilePaths[0],
 									name: 'file',
+									header: {
+										'platform': 2
+									},
 									success: (uploadFileRes) => {
 										let imgUrl = JSON.parse(uploadFileRes.data)
 											.data

+ 2 - 2
pagesClockIn/particulars/particulars.vue

@@ -20,7 +20,7 @@
 						{{item.name}}
 					</view>
 					<view class="status">
-						<span class="right">全勤:{{item.peopleTotal}}人</span>
+						<span class="right">全勤:{{item.peopleTotal-item.failCount}}人</span>
 						<span>异常:{{item.failCount}}人</span>
 					</view>
 				</view>
@@ -69,7 +69,7 @@
 				uni.setNavigationBarTitle({
 					title: '日汇总明细'
 				})
-			}else{
+			} else {
 				uni.setNavigationBarTitle({
 					title: '月汇总明细'
 				})

+ 4 - 2
pagesClockIn/powerSet/powerSet.vue

@@ -129,7 +129,8 @@
 								url: "/attendance/api/system/role/update/user",
 								method: "put",
 								header: {
-									'Authorization': uni.getStorageSync("token")
+									'Authorization': uni.getStorageSync("token"),
+									'platform': 2
 								},
 								data: {
 									id: this.roleId,
@@ -178,7 +179,8 @@
 									url: "/attendance/api/system/role/update/user",
 									method: "put",
 									header: {
-										'Authorization': uni.getStorageSync("token")
+										'Authorization': uni.getStorageSync("token"),
+										'platform': 2
 									},
 									data: {
 										id: this.roleId,

+ 38 - 2
pagesClockIn/setPunchTime/setPunchTime.vue

@@ -94,6 +94,8 @@
 				flag: null,
 				// 时间列表索引
 				index: null,
+				// 判断时间筛选框是否点击过
+				clickType: false
 			}
 		},
 		onLoad(options) {
@@ -140,6 +142,13 @@
 					})
 					return
 				}
+				if (!this.clickType && this.flag == 1) {
+					uni.showToast({
+						title: "打卡开始时间和结束时间不能相同",
+						icon: 'none'
+					})
+					return
+				}
 				uni.showModal({
 					title: '提示',
 					content: '确定保存吗?',
@@ -206,11 +215,38 @@
 			},
 			// 选择时间段回调
 			bindTimeChange(e, val, item) {
+				// console.log(e.detail.value);
+				this.clickType = true
 				if (val == 1) {
 					item.beginTime = e.detail.value
 				} else {
 					item.endTime = e.detail.value
 				}
+				let timeFlag = this.compareTime(item.beginTime, item.endTime)
+				// console.log(timeFlag);
+				if (!timeFlag) {
+					uni.showModal({
+						content: "打卡结束时间不能小于或等于开始时间",
+						showCancel: false
+					})
+				}
+			},
+			// 如果time2大于time1 返回true 否则 返回false
+			compareTime(time1, time2) {
+				if (this.time_to_sec(time2) - this.time_to_sec(time1) > 0) {
+					return true;
+				}
+				return false;
+			},
+			//将时分转为时间戳
+			time_to_sec(time) {
+				if (time !== null) {
+					var s = "";
+					var hour = time.split(":")[0];
+					var min = time.split(":")[1];
+					s = Number(hour * 3600) + Number(min * 60)
+					return s;
+				}
 			},
 			// 添加时段回调
 			handleAddTime() {
@@ -261,8 +297,8 @@
 		min-width: 100vw;
 		min-height: 100vh;
 		background-color: #F2F2F2;
-		
-		.placeholder{
+
+		.placeholder {
 			height: 33rpx;
 		}
 

+ 5 - 1
pagesClockIn/stat/stat.vue

@@ -386,6 +386,7 @@
 					data: {
 						time: this.nowTime,
 						page: this.page,
+						size: 9
 					}
 				})
 				// console.log(res);
@@ -431,6 +432,7 @@
 				this.success_count = ""
 				// this.list2 = []
 				this.errList = []
+				this.page = 1
 				// console.log(e.currentIndex);
 				this.current = e.currentIndex
 				if (e.currentIndex == 0) {
@@ -456,7 +458,8 @@
 									method: "post",
 									data,
 									header: {
-										'Authorization': uni.getStorageSync("token")
+										'Authorization': uni.getStorageSync("token"),
+										'platform': 2
 									}
 								})
 								// console.log(res);
@@ -929,6 +932,7 @@
 		}
 
 		.tab_bar {
+			z-index: 9999;
 			position: fixed;
 			left: 0;
 			bottom: 0;

+ 5 - 2
pagesClockIn/util/api.js

@@ -14,7 +14,8 @@ export const myRequest_clockIn = (options) => {
 			data: options.data || {},
 			header: options.header || {
 				'content-type': 'application/x-www-form-urlencoded',
-				'Authorization': uni.getStorageSync("token")
+				'Authorization': uni.getStorageSync("token"),
+				'platform': 2
 			},
 			success: (res) => {
 				uni.hideLoading();
@@ -25,7 +26,8 @@ export const myRequest_clockIn = (options) => {
 							url: 'https://chtech.ncjti.edu.cn/campusclock/attendance/api/home/permissions',
 							header: {
 								'content-type': 'application/x-www-form-urlencoded',
-								'Authorization': uni.getStorageSync("token")
+								'Authorization': uni.getStorageSync("token"),
+								'platform': 2
 							},
 							success: (res) => {
 								if (res.data.code == 200) {
@@ -60,6 +62,7 @@ export const myRequest_clockIn = (options) => {
 							showCancel: false,
 							success: function(res) {
 								if (res.confirm) {
+									uni.removeStorageSync("userInfo")
 									uni.reLaunch({
 										url: "/pagesClockIn/index/index",
 									});