Browse Source

打卡项目优化

MS-CIAZDCOIXVRW\Administrator 3 years ago
parent
commit
dfa3eabeeb

+ 142 - 143
pages.json

@@ -127,151 +127,150 @@
 		},
 		},
 		{
 		{
 			"root": "pagesClockIn",
 			"root": "pagesClockIn",
-			"pages": [
+			"pages": [{
+					"path": "home/home",
+					"style": {
+						"navigationBarTitleText": "智慧校园打卡",
+						"enablePullDownRefresh": true
+					}
+				},
 				{
 				{
-				"path": "home/home",
-				"style": {
-					"navigationBarTitleText": "智慧校园打卡",
-					"enablePullDownRefresh": true
-				}
-			}, 
-			{
-				"path": "stat/stat",
-				"style": {
-					"navigationBarTitleText": "统计",
-					"enablePullDownRefresh": false
-				}
-			}, 
-			{
-				"path": "my/my",
-				"style": {
-					"navigationBarTitleText": "我的",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "ruleSet/ruleSet",
-				"style": {
-					"navigationBarTitleText": "规则设置",
-					"enablePullDownRefresh": false
-				}
-			},{
-				"path": "powerSet/powerSet",
-				"style": {
-					"navigationBarTitleText": "权限设置",
-					"enablePullDownRefresh": false
-				}
-			},{
-				"path": "cardRecord/cardRecord",
-				"style": {
-					"navigationBarTitleText": "全部打卡记录",
-					"enablePullDownRefresh": false
-				}
-			},{
-				"path": "group/group",
-				"style": {
-					"navigationBarTitleText": "考勤组",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "addRules/addRules",
-				"style": {
-					"navigationBarTitleText": "新增规则",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "ruleName/ruleName",
-				"style": {
-					"navigationBarTitleText": "规则名称",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "punchTime/punchTime",
-				"style": {
-					"navigationBarTitleText": "打卡时间",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "punchLocation/punchLocation",
-				"style": {
-					"navigationBarTitleText": "打卡位置",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "setPunchTime/setPunchTime",
-				"style": {
-					"navigationBarTitleText": "添加打卡时间",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "addLocation/addLocation",
-				"style": {
-					"navigationBarTitleText": "添加位置",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "editRules/editRules",
-				"style": {
-					"navigationBarTitleText": "编辑规则",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "statDetail/statDetail",
-				"style": {
-					"navigationBarTitleText": "月打卡记录",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "particulars/particulars",
-				"style": {
-					"navigationBarTitleText": "汇总明细",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "404/404",
-				"style": {
-					"navigationBarTitleText": "404",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "location/location",
-				"style": {
-					"navigationBarTitleText": "打卡位置",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "authentication/authentication",
-				"style": {
-					"navigationBarTitleText": "身份认证",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "rulesDetail/rulesDetail",
-				"style": {
-					"navigationBarTitleText": "规则明细",
-					"enablePullDownRefresh": false
-				}
-			},
-			{
-				"path": "index/index",
-				"style": {
-					"navigationBarTitleText": "授权中",
-					"enablePullDownRefresh": false
+					"path": "stat/stat",
+					"style": {
+						"navigationBarTitleText": "统计",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "my/my",
+					"style": {
+						"navigationBarTitleText": "我的",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "ruleSet/ruleSet",
+					"style": {
+						"navigationBarTitleText": "规则设置",
+						"enablePullDownRefresh": false
+					}
+				}, {
+					"path": "powerSet/powerSet",
+					"style": {
+						"navigationBarTitleText": "权限设置",
+						"enablePullDownRefresh": false
+					}
+				}, {
+					"path": "cardRecord/cardRecord",
+					"style": {
+						"navigationBarTitleText": "全部打卡记录",
+						"enablePullDownRefresh": false
+					}
+				}, {
+					"path": "group/group",
+					"style": {
+						"navigationBarTitleText": "考勤组",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "addRules/addRules",
+					"style": {
+						"navigationBarTitleText": "新增规则",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "ruleName/ruleName",
+					"style": {
+						"navigationBarTitleText": "规则名称",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "punchTime/punchTime",
+					"style": {
+						"navigationBarTitleText": "打卡时间",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "punchLocation/punchLocation",
+					"style": {
+						"navigationBarTitleText": "打卡位置",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "setPunchTime/setPunchTime",
+					"style": {
+						"navigationBarTitleText": "添加打卡时间",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "addLocation/addLocation",
+					"style": {
+						"navigationBarTitleText": "添加位置",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "editRules/editRules",
+					"style": {
+						"navigationBarTitleText": "编辑规则",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "statDetail/statDetail",
+					"style": {
+						"navigationBarTitleText": "月打卡记录",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "particulars/particulars",
+					"style": {
+						"navigationBarTitleText": "汇总明细",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "404/404",
+					"style": {
+						"navigationBarTitleText": "404",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "location/location",
+					"style": {
+						"navigationBarTitleText": "打卡位置",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "authentication/authentication",
+					"style": {
+						"navigationBarTitleText": "身份认证",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "rulesDetail/rulesDetail",
+					"style": {
+						"navigationBarTitleText": "规则明细",
+						"enablePullDownRefresh": false
+					}
+				},
+				{
+					"path": "index/index",
+					"style": {
+						"navigationBarTitleText": "授权中",
+						"enablePullDownRefresh": false
+					}
 				}
 				}
-			}
 			]
 			]
 		}
 		}
 	],
 	],

+ 5 - 5
pagesClockIn/authentication/authentication.vue

@@ -69,17 +69,17 @@
 			};
 			};
 		},
 		},
 		onLoad(options) {
 		onLoad(options) {
+			let userInfo = uni.getStorageSync("userInfo")
+			if (userInfo) {
+				this.name = userInfo.name
+				this.cardNumber = userInfo.cardNumber
+			}
 			this.id = options.id
 			this.id = options.id
 			this.lat = options.latitude
 			this.lat = options.latitude
 			this.lng = options.longitude
 			this.lng = options.longitude
 			this.location = options.address
 			this.location = options.address
 			this.sceneImage = options.imgUrl
 			this.sceneImage = options.imgUrl
 			this.initData()
 			this.initData()
-			let userInfo = uni.getStorageSync("userInfo")
-			if (userInfo) {
-				this.name = userInfo.name
-				this.cardNumber = userInfo.cardNumber
-			}
 		},
 		},
 		methods: {
 		methods: {
 			// 初始化相机引擎
 			// 初始化相机引擎

+ 5 - 13
pagesClockIn/home/home.vue

@@ -163,8 +163,6 @@
 			this.getPageUrl()
 			this.getPageUrl()
 			// 获取当前位置的详细信息
 			// 获取当前位置的详细信息
 			this.getLocationData()
 			this.getLocationData()
-			// 获取当天的打卡列表数组
-			this.getRulesList()
 			// 获取当前时间的时间戳
 			// 获取当前时间的时间戳
 			this.getTimestamp()
 			this.getTimestamp()
 		},
 		},
@@ -185,7 +183,6 @@
 			this.getTimestamp()
 			this.getTimestamp()
 			this.getUserInfo()
 			this.getUserInfo()
 			this.getLocationData()
 			this.getLocationData()
-			this.getRulesList()
 			setTimeout(() => {
 			setTimeout(() => {
 				uni.stopPullDownRefresh()
 				uni.stopPullDownRefresh()
 			}, 1500)
 			}, 1500)
@@ -266,6 +263,8 @@
 							this.address = res.result.address
 							this.address = res.result.address
 							this.myLat = res.result.location.lat
 							this.myLat = res.result.location.lat
 							this.myLng = res.result.location.lng
 							this.myLng = res.result.location.lng
+							// 获取当天的打卡列表数组
+							this.getRulesList()
 						} else {
 						} else {
 							uni.showToast({
 							uni.showToast({
 								title: "请求定位失败",
 								title: "请求定位失败",
@@ -289,10 +288,7 @@
 						this.list = res.data.reverse()
 						this.list = res.data.reverse()
 						this.activeid = this.list[0].id
 						this.activeid = this.list[0].id
 						this.contrastObj = this.list[0]
 						this.contrastObj = this.list[0]
-						setTimeout(()=>{
-							this.changeType()
-						},300)
-						// console.log(this.contrastObj);
+						this.changeType()
 					}
 					}
 				}
 				}
 			},
 			},
@@ -315,10 +311,6 @@
 								this.centerLat = ele.lat
 								this.centerLat = ele.lat
 								this.centerLng = ele.lng
 								this.centerLng = ele.lng
 								this.radius = ele.radius
 								this.radius = ele.radius
-								console.log(this.myLat);
-								console.log(this.myLng);
-								console.log(this.centerLat);
-								console.log(this.centerLng);
 								let red1 = this.myLat * Math.PI / 180.0;
 								let red1 = this.myLat * Math.PI / 180.0;
 								let red2 = this.centerLat * Math.PI / 180.0;
 								let red2 = this.centerLat * Math.PI / 180.0;
 								let a = red1 - red2;
 								let a = red1 - red2;
@@ -329,8 +321,8 @@
 									Math.cos(red2) *
 									Math.cos(red2) *
 									Math.pow(Math.sin(b / 2), 2)));
 									Math.pow(Math.sin(b / 2), 2)));
 								this.distance = distance.toFixed(2) * 1;
 								this.distance = distance.toFixed(2) * 1;
-								console.log(this.distance);
-								console.log(this.radius);
+								// console.log(this.distance);
+								// console.log(this.radius);
 								if (this.distance <= this.radius) {
 								if (this.distance <= this.radius) {
 									return 1
 									return 1
 								} else {
 								} else {

+ 34 - 33
pagesClockIn/stat/stat.vue

@@ -295,6 +295,7 @@
 				}, 10)
 				}, 10)
 			},
 			},
 		},
 		},
+		// 页面拉到底部触发函数
 		onReachBottom() {
 		onReachBottom() {
 			if (this.current == 0) {
 			if (this.current == 0) {
 				if (this.errList.length < this.total) {
 				if (this.errList.length < this.total) {
@@ -306,18 +307,7 @@
 						icon: 'none'
 						icon: 'none'
 					})
 					})
 				}
 				}
-			} 
-			// else {
-			// 	if (this.list2.length < this.total_my) {
-			// 		this.page_my++
-			// 		this.getRulesList()
-			// 	} else {
-			// 		uni.showToast({
-			// 			title: "没有更多数据了",
-			// 			icon: 'none'
-			// 		})
-			// 	}
-			// }
+			}
 		},
 		},
 		methods: {
 		methods: {
 			getPageUrl() {
 			getPageUrl() {
@@ -396,7 +386,6 @@
 					data: {
 					data: {
 						time: this.nowTime,
 						time: this.nowTime,
 						page: this.page,
 						page: this.page,
-						size: 9
 					}
 					}
 				})
 				})
 				// console.log(res);
 				// console.log(res);
@@ -455,29 +444,36 @@
 			},
 			},
 			// 点击通知回调
 			// 点击通知回调
 			handleInform() {
 			handleInform() {
-				uni.showModal({
-					title: '提示',
-					content: `当前列表中有 ${this.total} 位异常人员,确定需要全部通知吗?`,
-					success: async (res) => {
-						if (res.confirm) {
-							let data = JSON.stringify(this.nowTime)
-							let res = await this.$myRequest_clockIn({
-								url: "/attendance/api/sign/check/in/abnormal/notify/app",
-								method: "post",
-								data,
-								header: {
-									'Authorization': uni.getStorageSync("token")
-								}
-							})
-							// console.log(res);
-							if (res.code == 200) {
-								uni.showToast({
-									title: "通知成功"
+				if (this.total > 0) {
+					uni.showModal({
+						title: '提示',
+						content: `当前列表中有 ${this.total} 位异常人员,确定需要全部通知吗?`,
+						success: async (res) => {
+							if (res.confirm) {
+								let data = JSON.stringify(this.nowTime)
+								let res = await this.$myRequest_clockIn({
+									url: "/attendance/api/sign/check/in/abnormal/notify/app",
+									method: "post",
+									data,
+									header: {
+										'Authorization': uni.getStorageSync("token")
+									}
 								})
 								})
+								// console.log(res);
+								if (res.code == 200) {
+									uni.showToast({
+										title: "通知成功"
+									})
+								}
 							}
 							}
 						}
 						}
-					}
-				});
+					});
+				} else {
+					uni.showToast({
+						title: "当前异常人员名单为空,无法通知",
+						icon: 'none'
+					})
+				}
 			},
 			},
 			// 点击查看明细回调
 			// 点击查看明细回调
 			handleLookDetail() {
 			handleLookDetail() {
@@ -900,7 +896,12 @@
 					}
 					}
 
 
 					.e_name {
 					.e_name {
+						width: 180rpx;
+						text-align: center;
 						font-size: 28rpx;
 						font-size: 28rpx;
+						overflow: hidden;
+						white-space: nowrap;
+						text-overflow: ellipsis;
 					}
 					}
 
 
 					.e_msg {
 					.e_msg {

+ 1 - 1
pagesClockIn/util/api.js

@@ -1,5 +1,5 @@
 // 线上地址
 // 线上地址
-// const BASE_URL = "https://chtech.ncjti.edu.cn/jiaofei/jiaofei-api/tuitionpayment"
+// const BASE_URL = "https://chtech.ncjti.edu.cn/campusclock"
 // 本地地址
 // 本地地址
 const BASE_URL = "https://www.web-server.top"
 const BASE_URL = "https://www.web-server.top"
 export const myRequest_clockIn = (options) => {
 export const myRequest_clockIn = (options) => {