xiaoxin 2 anos atrás
pai
commit
13fe1d87bc

+ 0 - 7
pages.json

@@ -421,13 +421,6 @@
 					}
 				},
 				{
-					"path": "authentication/authentication",
-					"style": {
-						"navigationBarTitleText": "拍照",
-						"enablePullDownRefresh": false
-					}
-				},
-				{
 					"path": "rulesDetail/rulesDetail",
 					"style": {
 						"navigationBarTitleText": "规则明细",

+ 6 - 6
pages/index/index.vue

@@ -32,10 +32,10 @@
 					<text>校园打卡</text>
 				</navigator>
 
-				<!-- <navigator :url="'/pages/web/web'" open-type="navigate" class="menu_item">
+				<navigator :url="'/pages/web/web'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/1.png" mode=""></image>
-					<text>课表</text>
-				</navigator> -->
+					<text>课表查询</text>
+				</navigator>
 				<!-- <navigator :url="'/pagesClockIn/money/money'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/money.png" mode=""></image>
 					<text>学费缴纳</text>
@@ -43,9 +43,9 @@
 				<!-- <view class="menu_item">
 					<text></text>
 				</view> -->
-				<view class="menu_item">
+				<!-- <view class="menu_item">
 					<text></text>
-				</view>
+				</view> -->
 			</view>
 		</view>
 		<view v-if="showLogin">
@@ -481,4 +481,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 3 - 3
pagesClockIn/addRules/addRules.vue

@@ -63,10 +63,10 @@
 			<view class="val2"><switch style="transform: scale(0.8)" color="#3396FB" :checked="takePicture" @change="switchChange_takePicture" /></view>
 		</view>
 
-		<view class="box">
+		<!-- <view class="box">
 			<view class="name">是否需要拍摄人脸:</view>
 			<view class="val2"><switch style="transform: scale(0.8)" color="#3396FB" :checked="faceRecognition" @change="switchChange_faceRecognition" /></view>
-		</view>
+		</view> -->
 
 		<view class="box">
 			<view class="name">是否提前通知全部人员:</view>
@@ -399,4 +399,4 @@ export default {
 		background-color: #3396fb;
 	}
 }
-</style>
+</style>

+ 0 - 299
pagesClockIn/authentication/authentication.vue

@@ -1,299 +0,0 @@
-<template>
-	<view class="container">
-		<view class="msg">{{ name }} {{ cardNumber }}</view>
-		<view class="photo">
-			<camera class="img" v-if="isAuthCamera" device-position="front" flash="off" resolution="high" />
-			<img v-else :src="tempImg" />
-		</view>
-		<view class="button" @click="handleTakePhotoClick">开始拍照</view>
-
-		<!-- 认证结果弹窗 -->
-		<uni-popup ref="popup" :is-mask-click="false">
-			<view class="popup-content">
-				<view class="title">
-					<view class="icon"><img src="./imgs/success.png" /></view>
-					<view class="title_info">打卡成功</view>
-				</view>
-				<view class="time">{{ nowTime }}</view>
-				<view class="popup_button" @click="handleGoHome">我知道了</view>
-			</view>
-		</uni-popup>
-	</view>
-</template>
-
-<script>
-import { encrypt, decrypt } from '../util/encryp.js'
-import { RSAencrypt } from '../util/WxmpRsa.js'
-export default {
-	data() {
-		return {
-			// 当前时间
-			nowTime: '',
-			// 本地图片路径 被匹对照片
-			tempImg: '',
-			// 场景照片
-			sceneImage: '',
-			// 经纬度
-			lat: '',
-			lng: '',
-			// 地址
-			location: '',
-			// 规则id
-			id: '',
-			// 相机引擎
-			cameraEngine: null,
-			// 是否拥有相机权限
-			isAuthCamera: true,
-			// 姓名
-			name: '',
-			// 身份证号
-			cardNumber: '',
-			// 是否需要场景照片,值为1时是不需要
-			flag: ''
-		}
-	},
-	onLoad(options) {
-		let userInfo = uni.getStorageSync('userInfo')
-		if (userInfo) {
-			this.name = userInfo.name
-			this.cardNumber = userInfo.cardNumber
-		}
-		this.id = options.id
-		this.lat = options.latitude
-		this.lng = options.longitude
-		this.location = options.address
-		if (options.imgUrl) {
-			this.sceneImage = options.imgUrl
-		}
-		if (options.flag) {
-			this.flag = options.flag
-		}
-		this.initData()
-	},
-	methods: {
-		// 初始化相机引擎
-		initData() {
-			// 创建 camera 上下文 CameraContext 对象
-			this.cameraEngine = uni.createCameraContext()
-			// 获取 Camera 实时帧数据
-			const listener = this.cameraEngine.onCameraFrame((frame) => {
-				if (this.tempImg) {
-					return
-				}
-			})
-			// 5、开始监听帧数据
-			listener.start()
-		},
-
-		// 拍照点击
-		handleTakePhotoClick() {
-			uni.getSetting({
-				success: (res) => {
-					if (!res.authSetting['scope.camera']) {
-						this.isAuthCamera = true
-						uni.openSetting({
-							success: (res) => {
-								if (res.authSetting['scope.camera']) {
-									this.isAuthCamera = true
-								}
-							}
-						})
-					}
-				}
-			})
-			this.cameraEngine.takePhoto({
-				quality: 'high',
-				success: ({ tempImagePath }) => {
-					this.tempImg = tempImagePath
-					this.isAuthCamera = false
-					this.handleOkClick()
-				}
-			})
-		},
-		// 上传
-		handleOkClick() {
-			//  这里的 this.tempImg 是拍照拿到的图片路径
-			this.upLoadOne(this.tempImg)
-		},
-		upLoadOne(url) {
-			uni.showLoading({
-				title: '认证中,请稍后...'
-			})
-			setTimeout(() => {
-				uni.uploadFile({
-					url: `https://chtech.ncjti.edu.cn/gxy/facedemo/face-api/ihotel/mapper/face/compareTwoFace`,
-					filePath: url,
-					name: 'file',
-					formData: {
-						mCardNumber: this.cardNumber
-					},
-					header: {
-						platform: 2,
-						'Accept-Language': 'zh-CN,zh;q=0.9'
-					},
-					success: (uploadFileRes) => {
-						// console.log(uploadFileRes)
-						let temRes = JSON.parse(uploadFileRes.data)
-						if (temRes.code === '200') {
-							let imgUrl = temRes.data.fileUrl
-							uni.showToast({
-								title: '对比成功'
-							})
-							setTimeout(() => {
-								this.handleUploading(imgUrl)
-							}, 1500)
-						} else {
-							uni.showToast({
-								title: `${temRes.message},请重新认证`,
-								icon: 'none',
-								duration: 2000
-							})
-							this.tempImg = ''
-							this.isAuthCamera = true
-						}
-					},
-					fail: () => {
-						uni.showToast({
-							title: '上传失败',
-							icon: 'error'
-						})
-					}
-				})
-			}, 1000)
-		},
-		async handleUploading(imgUrl) {
-			let res = await this.$myRequest_clockIn({
-				url: '/attendance/api/sign/check/in/update',
-				method: 'put',
-				header: {
-					Authorization: uni.getStorageSync('token'),
-					platform: 2,
-					'Accept-Language': 'zh-CN,zh;q=0.9'
-				},
-				data: {
-					id: this.id,
-					lat: this.lat,
-					lng: this.lng,
-					location: this.location,
-					matchFaceImage: imgUrl,
-					sceneImage: this.flag == 1 ? '' : this.sceneImage
-				}
-			})
-			// console.log(res);
-			if (res.code == 200) {
-				this.getNowTime()
-				this.$refs.popup.open()
-			}
-		},
-		// 点击 我知道了按钮 跳回首页
-		handleGoHome() {
-			this.$refs.popup.close()
-			uni.reLaunch({
-				url: '/pagesClockIn/home/home'
-			})
-		},
-		// 获取当前时间
-		getNowTime() {
-			let date = new Date()
-			let hours = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
-			let minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
-			let seconds = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
-			this.nowTime = hours + ':' + minutes + ':' + seconds
-		}
-	}
-}
-</script>
-
-<style lang="scss" scoped>
-.container {
-	// .notes {
-	// 	margin-top: 110rpx;
-	// 	text-align: center;
-	// 	font-size: 28rpx;
-	// }
-
-	.msg {
-		margin-top: 120rpx;
-		text-align: center;
-		font-size: 28rpx;
-	}
-
-	.photo {
-		margin: 0 auto;
-		margin-top: 180rpx;
-		width: 375rpx;
-		height: 375rpx;
-		border-radius: 188rpx;
-		overflow: hidden;
-
-		.img {
-			width: 100%;
-			height: 100%;
-			border-radius: 50%;
-		}
-
-		img {
-			width: 100%;
-			height: 100%;
-		}
-	}
-
-	.button {
-		margin: 0 auto;
-		margin-top: 127rpx;
-		width: 430rpx;
-		height: 100rpx;
-		line-height: 100rpx;
-		text-align: center;
-		color: #fff;
-		border-radius: 21rpx;
-		font-size: 32rpx;
-		background: linear-gradient(180deg, rgba(0, 172, 252, 1) 0%, rgba(0, 130, 252, 1) 100%);
-	}
-
-	.popup-content {
-		display: flex;
-		flex-direction: column;
-		justify-content: space-around;
-		align-items: center;
-		width: 630rpx;
-		height: 376rpx;
-		border-radius: 33rpx;
-		background-color: #fff;
-
-		.title {
-			display: flex;
-			justify-content: center;
-			align-items: center;
-
-			.icon {
-				width: 40rpx;
-				height: 40rpx;
-
-				img {
-					width: 100%;
-					height: 100%;
-				}
-			}
-
-			.title_info {
-				margin-left: 8rpx;
-				font-size: 36rpx;
-				font-weight: 800;
-				color: #0082fc;
-			}
-		}
-
-		.time {
-			font-size: 32rpx;
-		}
-
-		.popup_button {
-			width: 50%;
-			text-align: center;
-			font-size: 32rpx;
-			color: #0082fc;
-		}
-	}
-}
-</style>

BIN
pagesClockIn/authentication/imgs/success.png


+ 3 - 21
pagesClockIn/home/home.vue

@@ -125,8 +125,6 @@ export default {
 			pageUrl: '',
 			// 是否显示底部 我的 导航栏
 			showTab: false,
-			// 是否需要拍摄人脸
-			faceRecognition: true,
 			// 是否需要拍摄场景照片
 			takePicture: true,
 			// 刷新定位定时器
@@ -329,7 +327,6 @@ export default {
 					this.flags = true
 					this.list = res.data
 					this.activeid = this.list[0].id
-					this.faceRecognition = this.list[0].faceRecognition
 					this.takePicture = this.list[0].takePicture
 					this.contrastObj = this.list[0]
 					this.changeType()
@@ -431,7 +428,6 @@ export default {
 			this.getTimestamp()
 			this.contrastObj = item
 			this.activeid = item.id
-			this.faceRecognition = item.faceRecognition
 			this.takePicture = item.takePicture
 			this.changeType()
 		},
@@ -439,28 +435,14 @@ export default {
 		handlePunch(info) {
 			if (this.flags) {
 				let obj = JSON.stringify(info)
-				// 如果场景照片和拍摄人脸都需要
-				if (this.faceRecognition && this.takePicture) {
+
+				if (this.takePicture) {
 					uni.navigateTo({
 						url: `/pagesClockIn/location/location?obj=${obj}`
 					})
-				}
-				// 如果都不需要
-				else if (!this.faceRecognition && !this.takePicture) {
+				} else {
 					this.handleUploading()
 				}
-				// 如果只需要场景照片
-				else if (this.takePicture) {
-					uni.navigateTo({
-						url: `/pagesClockIn/location/location?obj=${obj}&flag=1`
-					})
-				}
-				// 如果只需要拍摄人脸
-				else if (this.faceRecognition) {
-					uni.navigateTo({
-						url: `/pagesClockIn/authentication/authentication?id=${this.contrastObj.id}&address=${this.address}&latitude=${this.myLat}&longitude=${this.myLng}&flag=1`
-					})
-				}
 			}
 		},
 

+ 2 - 14
pagesClockIn/location/location.vue

@@ -65,16 +65,11 @@ export default {
 			timeRange: '',
 			// 规则id
 			id: '',
-			// 是否需要拍摄人脸,值为1时是不需要
-			flag: '',
 			// 弹窗当前时间
 			nowTime_pop: ''
 		}
 	},
 	onLoad(options) {
-		if (options.flag) {
-			this.flag = options.flag
-		}
 		let obj = JSON.parse(options.obj)
 		this.timeRange = obj.timeRange
 		this.id = obj.id
@@ -152,14 +147,7 @@ export default {
 								},
 								success: (uploadFileRes) => {
 									let imgUrl = JSON.parse(uploadFileRes.data).data
-									if (this.flag == 1) {
-										this.handleUploading(imgUrl)
-									} else {
-										uni.redirectTo({
-											url: `/pagesClockIn/authentication/authentication?imgUrl=${imgUrl}&id=${this.id}&address=${this.address}&latitude=${this.latitude}&longitude=${this.longitude}`
-										})
-									}
-									// this.handleUploading(imgUrl)
+									this.handleUploading(imgUrl)
 								},
 								fail: () => {
 									uni.showToast({
@@ -382,4 +370,4 @@ export default {
 		}
 	}
 }
-</style>
+</style>

+ 0 - 17
pagesClockIn/util/WxmpRsa.js

@@ -1,17 +0,0 @@
-// 导入包
-import WxmpRsa from 'wxmp-rsa'
-
-const publicKey =
-	'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMOcPB06u5yKyQsPjfVWiWgbEIrd14kiXNNihciaVKb6HnkQvq7zpQuZ80WEX94spnUMI3iOAl/GmIvHrpGwcbB4hJbznm+PajiwnUSPuCCXA68YJF640cJKb/8KeM7WVz69OFkIEPHhVxOy4FFF5QWe/kt6zOZ19HmE+ak+5x/QIDAQAB'
-
-// 加密方法
-export function RSAencrypt(pas) {
-	// 实例化rsa
-	const rsa = new WxmpRsa()
-	// 设置公钥
-	rsa.setPublicKey(publicKey)
-	// 加密后的密码
-	const res = rsa.encryptLong(pas)
-	// console.log('加密:' + res)
-	return res
-}

+ 0 - 31
pagesClockIn/util/encryp.js

@@ -1,31 +0,0 @@
-/**
- * 工具类
- */
-import Vue from 'vue'
-import CryptoJS from 'crypto-js'
-let keyStr = "Vl3726F2RE62zPjH"
-
-//加密
-// export function encrypt(word, keyStr){ 
-export function encrypt(word) {
-	keyStr = keyStr ? keyStr : 'Vl3726F2RE62zPjH';
-	var key = CryptoJS.enc.Utf8.parse(keyStr); //Latin1 w8m31+Yy/Nw6thPsMpO5fg==
-	var srcs = CryptoJS.enc.Utf8.parse(word);
-	var encrypted = CryptoJS.AES.encrypt(srcs, key, {
-		mode: CryptoJS.mode.ECB,
-		padding: CryptoJS.pad.Pkcs7
-	});
-	return encrypted.toString();
-}
-
-//解密
-// export function decrypt(word, keyStr){  
-export function decrypt(word) {
-	keyStr = keyStr ? keyStr : 'Vl3726F2RE62zPjH';
-	var key = CryptoJS.enc.Utf8.parse(keyStr); //Latin1 w8m31+Yy/Nw6thPsMpO5fg==
-	var decrypt = CryptoJS.AES.decrypt(word, key, {
-		mode: CryptoJS.mode.ECB,
-		padding: CryptoJS.pad.Pkcs7
-	});
-	return CryptoJS.enc.Utf8.stringify(decrypt).toString();
-}

BIN
static/images/1.png