张平 преди 4 години
родител
ревизия
277a6ec621
променени са 7 файла, в които са добавени 0 реда и са изтрити 758 реда
  1. 0 71
      pages/confirm/confirm.css
  2. 0 64
      pages/confirm/confirm.vue
  3. 0 85
      pages/index/index.css
  4. 0 395
      pages/index/index.vue
  5. 0 53
      pages/show/show.css
  6. 0 55
      pages/show/show.vue
  7. 0 35
      pages/test/test.vue

+ 0 - 71
pages/confirm/confirm.css

@@ -1,71 +0,0 @@
-.container{
-		display: flex;
-		flex-direction: column;
-		color: #333333;
-		font-family: 'MicrosoftYaHei';
-		font-size: 28rpx;
-		height: 1206rpx;
-	}
-	
-	.image{
-		width: 692rpx;
-		height: 432rpx;
-		margin-top: 21rpx;
-		margin-left: 29rpx;
-	}
-	
-	.item_info_title{
-		margin-top: 40rpx;
-		margin-left: 30rpx;
-		font-size: 32rpx;
-		font-weight: 700;
-	}
-	
-	.item_info{
-		margin-left: 30rpx;
-		display: flex;
-		flex-wrap: wrap;
-	}
-	
-	.info_list_left{
-		width: 600rpx;
-		margin-top: 14.5rpx;
-		text-indent: 2em;
-		white-space: nowrap;
-	}
-	
-	.info_list_right{
-		width: 350rpx;
-		margin-top: 14.5rpx;
-		text-indent: 2em;
-		white-space: nowrap;
-	}
-	
-	.info_list_long{
-		width: 500rpx;
-		text-indent: 2em;
-		white-space: nowrap;
-		margin-top: 14.5rpx;
-	}
-	
-	.item_btu{
-		margin-top: 100rpx;
-	}
-	
-	.submit{
-		width: 600rpx;
-		height: 80rpx;
-		/* padding-top: 8rpx; */
-		/* border-radius: 10rpx; */
-		background-color: #6EAFF0;
-		color: #FFFFFF;
-		font-size: 28rpx;
-	}
-	
-	.last_info{
-		width: 578rpx;
-		height: 62rpx;
-		margin-top: 19rpx;
-		margin-left: 86rpx;
-		font-size: 24rpx;
-	}

+ 0 - 64
pages/confirm/confirm.vue

@@ -1,64 +0,0 @@
-<template>
-	<view class="container">
-		<view class="item_image">
-			<image src="../../static/images/test.png" class="image"></image>
-		</view>
-		<view class="item_info_title">
-			<text class="info_title">个人信息</text>
-		</view>
-		<view class="item_info">
-			<view class="info_list_left">
-				姓名:<text>{{name}}</text>
-			</view>
-			<view class="info_list_right">
-				性别:<text>{{sex}}</text>
-			</view>
-			<view class="info_list_left">
-				学号:<text>{{stu_info}}</text>
-			</view>
-			<view class="info_list_right">
-				准考证号:<text>{{ticket_id}}</text>
-			</view>
-			
-			<view class="info_list_long">
-				身份证号:<text>{{id_card}}</text>
-			</view>
-		</view>
-		<view class="item_btu">
-			<button class="submit" @tap="navigateToIndex">我已确认</button>
-			<view class="last_info">
-				<text>如信息有误,或有其他疑问,请联系校招生办,联系电话:xxxxxxxxxxx</text>
-			</view>
-		</view>
-		
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				name: '张三',
-				sex: '男',
-				stu_info: '20210210440101',
-				ticket_id: '22222222222222',
-				id_card: '360124199911112222',
-				card_number: '',
-			}
-		},
-		onLoad(){
-			
-		},
-		methods: {
-			navigateToIndex(){
-				uni.navigateTo({
-					url: '../test/test?card_number'
-				});
-			},
-		}
-	}
-</script>
-
-<style>
-	@import url("confirm.css");
-</style>

+ 0 - 85
pages/index/index.css

@@ -1,85 +0,0 @@
-.item-camera {
-	/* position: fixed; */
-	/* top: 0;
-	left: 0; */
-	width: 100%;
-	height: 1300rpx;
-	background-color: #ffffff;
-}
-
-.camera {
-	width: 100%;
-	/* height: 760rpx; */
-	height: 912rpx;
-}
-
-.item-cover {
-	/* width: 669rpx;
-	height: 581.3rpx; */
-	width: 802.8rpx;
-	height: 697.56rpx;
-	/* margin-left: 40rpx; */
-	margin-left: -26.4rpx;
-	margin-top: 180rpx;
-}
-
-/* .submit-btn {
-	width: 100%;
-	margin-top: 5rpx;
-	display: flex;
-	flex-direction: row;
-	align-items: center;
-} */
-
-.item-list{
-	/* z-index: 1; */
-	width: 555rpx;
-	margin-top: 89rpx;
-	margin-left: 100rpx;
-	display: flex;
-	flex-direction: row;
-	justify-content: space-between;
-	align-items:center;
-}
-
-.image-btn {
-	width: 150rpx;
-	height: 150rpx;
-	/* margin-left: 130rpx; */
-}
-
-.image-light{
-	width: 70rpx;
-	height: 70rpx;
-	/* margin-top: 129rpx; */
-	/* margin-left: 100rpx; */
-}
-
-.image-change{
-	width: 70rpx;
-	height: 70rpx;
-	/* margin-top: 129rpx; */
-	/* margin-left: 135rpx; */
-}
-
-.item-btn-list{
-	width: 690rpx;
-	margin-top: 125rpx;
-	margin-left: 30rpx;
-	display: flex;
-	flex-direction: row;
-	justify-content: space-between;
-}
-
-.use-btn{
-	background-color: #6EAFF0;
-	width: 188rpx;
-	height: 80rpx;
-	border-radius: 10rpx;
-	font-size: 32rpx;
-	color: #FFFFFF;
-}
-
-.login-item{
-	z-index: 1;
-}

+ 0 - 395
pages/index/index.vue

@@ -1,395 +0,0 @@
-<template>
-	<view class="content">
-		<view class="item-camera" v-if="showHeader">
-			<camera binderror="" :device-position="devicePosition" :flash="deviceLight" class="camera"
-				v-if="authCamera">
-				<cover-image src='../../static/images/head1.png' class="item-cover" v-if="cover">
-				</cover-image>
-			</camera>
-			<view class="item-list" v-if="list_btn">
-				<image src="../../static/images/light.png" class="image-light" @tap="takeLight"></image>
-				<image src="../../static/images/take.png" class="image-btn" @tap="takePhotoByHead"></image>
-				<image src="../../static/images/change.png" class="image-change" @tap="changeDevice"></image>
-			</view>
-			<view class="error-handler" v-if="!authCamera">
-				<button class="nobtn" openType="openSetting">打开相机授权</button>
-			</view>
-		</view>
-		<view class="item-camera" v-if="!showHeader">
-			<view>
-				<image :src="image" class="camera"></image>
-			</view>
-
-			<view class="item-btn-list">
-				<view><button class="use-btn" @tap="resetImage">重拍</button></view>
-				<view><button class="use-btn" @tap="checkImage">使用照片</button></view>
-			</view>
-		</view>
-		<view v-if="showLogin" class="login-item">
-			<login :ocode="ocode" :appkey="appkey" scope="snsapi_userinfo" :visible="visible" @success="callback()"
-				@cancel="callback()" @fail="callback()" />
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				cover: false, //覆盖层
-				visible: true,  //是否可见
-				authCamera: true, //控制camera
-				showHeader: true, //控制camera所在的view
-				list_btn: false, //控制三个按钮
-				showLogin: true,
-				ctxHeader: null,
-				devicePosition: 'front', //摄像头
-				deviceLight: 'off', //闪光灯
-				image: '',
-				card_number: '', //学生信息
-				appkey: '8C41E2FECF2E9925',
-				sub_appid: '1015730314_1941301045',
-				appid: 'wxd6f090391d410534', // 获取用户信息
-				ocode: '1015730314', // 获取用户信息
-				app_secret: '9C5EC8E3B7ABBF9C0641804000D8F28E', // 获取用户信息
-				wxcode: '',
-				access_token: '',
-				userinfo: {},
-			}
-		},
-		onLoad(options) {
-			// console.log(options)
-			// this.card_number = options.card_number   //获取后台传入参数
-			// if (!this.card_number) {
-			// 	this.get_wxcode() //授权
-			// 	// uni.showToast({
-			// 	// 	icon: 'false',
-			// 	// 	title: '请重新授权',
-			// 	// 	duration: 1000,
-			// 	// 	success: (res) => {
-			// 	// 		// this.my_display = true
-			// 	// 	}
-			// 	// })
-			// } else {
-			// this.list_btn = true
-			// this.get_image()
-			// this.show_Toast()
-			//获取摄像头权限
-			uni.authorize({
-				scope: 'scope.camera',
-				success: res => {
-				}
-			})
-			//判断是否获取摄像头权限
-			uni.getSetting({
-				success: (res) => {
-					// console.log(res)
-					if (res.authSetting["scope.camera"]) {
-						this.authCamera = true
-						// this.takePhotoByHead()
-					} else {
-						// this.handleCameraError()
-						this.authCamera = false
-					}
-				}
-			})
-			// console.log(this.authCamera)
-			// this.get_image()  //拍照获取人脸信息
-			// }
-		},
-		methods: {
-			//授权获取wxcode
-			callback: function({
-				detail
-			}) {
-				// console.log(detail)
-				// {wxcode: "7f7Qi9rN8zQ1nifQiysTZ3WIeIWlgcGk"}
-				if (detail === undefined) {
-					// this.userinfo = {};
-					uni.showToast({
-						icon: 'success',
-						title: '需要先授权'
-					});
-				} else {
-					const {
-						wxcode = ""
-					} = detail
-					
-					if (wxcode.length == 0) {
-						uni.showToast({
-							title: '未获得wxcode',
-							duration: 500
-						})
-					} else {
-						// 获取wxcode
-						this.wxcode = wxcode
-						// console.log(this.wxcode)
-						this.list_btn = true
-						this.cover = true
-						// 通过wxcode换取access_token
-						this.get_access_token()
-					}
-				}
-			},
-			/**
-			 * 通过wxcode换取access_token
-			 */
-			async get_access_token() {
-				const res = await this.$myRequest({
-					host: 'wecard',
-					url: '/connect/oauth2/token',
-					method: 'POST',
-					header: {
-						'content-type': 'application/json'
-					},
-					data: {
-						'wxcode': this.wxcode,
-						'app_key': this.appkey,
-						'app_secret': this.app_secret,
-						'grant_type': 'authorization_code',
-						'redirect_uri': 'mnp://wxd6f090391d410534'
-					}
-				})
-				if (res.statusCode == 200) {
-					if (res.data.access_token == '' || res.data.access_token == 'undefined') {
-						uni.showToast({
-							title: '未获得token'
-						})
-					} else {
-						// console.log(res)
-						this.access_token = res.data.access_token;
-						
-						// 通过access_token换取用户信息
-						this.get_user_info();
-					}
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: '请求失败,未获得token'
-					})
-				}
-			},
-			/**
-			 * 通过access_token换取用户信息
-			 */
-			async get_user_info() {
-				const res = await this.$myRequest({
-					host: 'wecard',
-					url: '/connect/oauth/get-user-info',
-					method: 'POST',
-					header: {
-						'content-type': 'application/json'
-					},
-					data: {
-						"access_token": this.access_token
-					}
-				});
-			
-				if (res.statusCode == 200) {
-					if (res.data.errcode == 0 && res.data.errmsg == 'OK') {
-						try {
-							this.userinfo = res.data
-							// // 存储用户信息
-							uni.setStorageSync('userinfo_storage_key', this.userinfo)
-							// 提示授权成功
-							uni.showToast({
-								icon: 'success',
-								title: '授权成功',
-								duration: 800,
-								success: (res) => {
-									// this.my_display = true
-									this.list_btn = true
-									this.cover = true
-								}
-							})
-							this.card_number = this.userinfo.card_number
-							// console.log(this.userinfo)
-						} catch (e) {
-							console.log(e)
-						}
-					} else {
-						uni.showToast({
-							title: '未获得用户信息',
-							duration: 1000
-						});
-					}
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: '请求失败,未授权成功'
-					});
-				}
-			},
-
-			// //拍照获取人脸相片
-			// get_image() {
-			// 	uni.chooseMedia({
-			// 		count: 1, //默认9
-			// 		mediaType: ['image'],
-			// 		sourceType: ['camera'],
-			// 		sizeType: ['original'], //可以指定是原图还是压缩图,默认二者都有
-			// 		camera: 'front',
-			// 		success: res => {
-			// 			// console.log(res)
-			// 			let imgFiles = res.tempFiles[0].tempFilePath
-			// 			this.image = imgFiles
-			// 			console.log('本地地址', this.image)
-			// 			this.preview()
-			// 			// this.uploadTheImg(imgFiles)  //向后台传送文件
-			// 		}
-			// 	});
-			// },
-			//拍摄头像
-			takePhotoByHead() {
-				this.showHeader = true //开启拍照
-				this.ctxHeader = uni.createCameraContext();
-				this.ctxHeader.takePhoto({
-					quality: 'high',
-					success: (res) => {
-						uni.compressImage({
-							src: res.tempImagePath,
-							quality: 90, //压缩比例
-							success: ress => {
-								this.image = ress.tempFilePath;
-								console.log(this.image)
-								// console.log(typeof(this.image))
-								this.showHeader = false; //关闭拍照
-								// this.uploadTheImg()
-							}
-						})
-					}
-				});
-			},
-			// //当摄像头无法启动时显示
-			// handleCameraError() {
-			// 	uni.showToast({
-			// 		title: '用户拒绝使用摄像头',
-			// 		icon: 'none'
-			// 	})
-			// },
-			//刷新页面
-			onPullDownRefresh: function() {
-				uni.navigateTo({
-					url: '../index/index',
-				});
-				// console.log('触发了下拉刷新')
-			},
-			//相片预览
-			preview() {
-				console.log('路径' + this.image)
-				uni.previewImage({
-					// 对选中的图片进行预览
-					urls: [this.image, ],
-					// urls:['','']  图片的地址 是数组形式
-				});
-			},
-			//重新拍摄
-			resetImage() {
-				this.showHeader = true
-			},
-			//调用另一个摄像头
-			changeDevice() {
-				if (this.devicePosition == 'front') {
-					this.devicePosition = 'back'
-					uni.showToast({
-						title: '开启后摄像头',
-						icon: 'none'
-					})
-				} else {
-					this.devicePosition = 'front'
-					uni.showToast({
-						title: '开启前摄像头',
-						icon: 'none'
-					})
-				}
-			},
-			//设置闪光灯
-			takeLight() {
-				if (this.deviceLight == 'off') {
-					this.deviceLight = 'on'
-					uni.showToast({
-						title: '开启闪光灯',
-						icon: 'success'
-					})
-				} else {
-					this.deviceLight = 'off'
-					uni.showToast({
-						title: '关闭闪光灯',
-						icon: 'false'
-					})
-				}
-			},
-			//确定使用图片
-			checkImage() {
-				// console.log(this.image)
-				uni.showLoading({
-					title: '图片正在上传中'
-				});
-				this.uploadTheImg() //向后台传送文件
-			},
-			
-			//上传图片
-			uploadTheImg() {
-				uni.uploadFile({
-					url: 'http://pwawgw.natappfree.cc', //后端用于处理图片并返回图片地址的接口
-					// header: {
-					// 	"Content-Type": "multipart/form-data" // formdata提交格式
-					// },
-					filePath: this.image,
-					name: 'uploadFile', // 默认
-					fileType: 'image',
-					formData: { // 其他的formdata参数
-						card_number: this.card_number,
-					},
-					success: (res) => {
-						console.log(res)
-						// let data = JSON.parse(res.data) //返回的是字符串,需要转成对象格式,打印data如下图
-						// if (data.code == 200) {
-							// console.log(data.msg) //图片地址
-						// }
-						uni.hideLoading();
-						// var code = '200'
-						// if (code == 200) {
-						if (res.statusCode == 200) {
-							uni.showToast({
-								icon: 'success',
-								title: '人脸采集成功',
-								success: (res) => {
-									setTimeout(function() {
-										uni.navigateTo({
-											url: '../confirm/confirm',
-										})
-									}, 1500);
-								}
-							})
-						} else {
-							uni.showModal({
-								title: '人脸采集失败',
-								content: '请重新拍照上传',
-								confirmText: '重新拍照',
-								cancelText: '直接跳转',
-								// showCancel: false,
-								success: res => {
-									if (res.confirm) {
-										this.showHeader = true
-									} else if (res.cancel) {
-										uni.navigateTo({
-											url: '../confirm/confirm',
-										})
-									}
-								}
-							});
-						}
-					},
-					fail: (res) => {
-						console.log(res)
-					}
-				})
-			},
-		},
-	}
-</script>
-
-<style>
-	@import url("index.css");
-</style>

+ 0 - 53
pages/show/show.css

@@ -1,53 +0,0 @@
-
-.item-iamge .image{
-	width: 749rpx;
-	height: 360rpx;
-	
-}
-
-.item-title{
-	margin-top: 39rpx;
-	margin-left: 30rpx;
-	width: 400rpx;
-	display: flex;
-	flex-direction: row;
-}
-
-.item-title-line{
-	height: 32rpx;
-	width: 10rpx;
-	background-color: #3FB0FF;
-}
-
-.item-title-font{
-	font-size: 32rpx;
-	color: #333333;
-	margin-left: 15rpx;
-	font-weight: 700;
-	margin-top: -5rpx;
-}
-
-.item-list{
-	width: 590rpx;
-	margin-top: 40rpx;
-	margin-left: 80rpx;
-	display: flex;
-	flex-direction: row;
-	justify-content: space-between;
-}
-
-.item-list-one{
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-}
-
-.img-btn{
-	width: 90rpx;
-	height: 90rpx;
-}
-.list-txt{
-	margin-top: 29rpx;
-	font-size: 30rpx;
-	color: #333333;
-}

+ 0 - 55
pages/show/show.vue

@@ -1,55 +0,0 @@
-<template>
-	<view class="container">
-		<view class="item-iamge">
-			<image src="../../static/images/showhead.png" class="image"></image>
-		</view>
-		<view class="item-title">
-			<view class="item-title-line"></view>
-			<view class="item-title-font">迎新指南</view>
-		</view>
-		<view class="item-list">
-			<view class="item-list-one" @tap="navigateToExplain">
-				<image src="../../static/images/explain.png" class="img-btn"></image>
-				<text class="list-txt">报道指南</text>
-			</view>
-			<view class="item-list-one" @tap="navigateToMap">
-				<image src="../../static/images/map.png" class="img-btn"></image>
-				<text class="list-txt">地图导览</text>
-			</view>
-			<view class="item-list-one" @tap="navigateToCard">
-				<image src="../../static/images/card.png" class="img-btn"></image>
-				<text class="list-txt">临时卡领取</text>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				
-			}
-		},
-		methods: {
-			navigateToExplain(){
-				uni.navigateTo({
-					url: '../test/test',
-				});
-			},
-			navigateToMap(){
-				uni.navigateTo({
-					url: '',
-				});
-			},navigateToCard(){
-				uni.navigateTo({
-					url: '',
-				});
-			}
-		}
-	}
-</script>
-	
-<style>
-	@import url("show.css");
-</style>

+ 0 - 35
pages/test/test.vue

@@ -1,35 +0,0 @@
-<template>
-	<view>
-		<web-view :src="link" bindmessage="getMessage"></web-view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				link: "https://wj.qq.com/s2/8767613/e476?openid" + this.card_number,
-				card_number: ''
-			}
-		},
-		onLoad(){
-			try {
-				// 获取存储的用户数据
-				const value = uni.getStorageSync('userinfo_storage_key')
-				// console.log(item)
-				// console.log(value)
-				this.card_number = value.card_number
-				console.log(this.card_number)
-			} catch (e) {
-				console.log(e)
-			}
-		},
-		methods: {
-			
-		}
-	}
-</script>
-
-<style>
-
-</style>