xiaoxin před 2 roky
rodič
revize
f60f4fb10e

+ 7 - 0
pages.json

@@ -32,6 +32,13 @@
 				"navigationBarTitleText": "热水钱包充值",
 				"enablePullDownRefresh": false
 			}
+		}, {
+			"path": "pages/web/web",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	"subPackages": [{

+ 375 - 367
pages/index/index.vue

@@ -11,24 +11,28 @@
 				</navigator>
 				<navigator :url="'/pagesElectric/jiaofei/jiaofei?o=index'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/recharge2x.png" mode=""></image>
-					<text>墨轩湖水电充值</text>
+					<text>墨轩湖1-16栋水电充值</text>
 				</navigator>
+				<!-- <navigator :url="'/pages/web/web'" open-type="navigate" class="menu_item">
+					<image src="../../static/images/1.png" mode=""></image>
+					<text>墨轩湖17-22栋水电充值</text>
+				</navigator> -->
 				<navigator :url="'/pagesAir/shareAir/shareAir'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/air.png" mode=""></image>
 					<text>共享空调</text>
 				</navigator>
-				<navigator :url="'/pagesRepairs/index/index'" open-type="navigate" class="menu_item">
+				<!-- <navigator :url="'/pagesRepairs/index/index'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/money.png" mode=""></image>
 					<text>报修</text>
-				</navigator>
+				</navigator> -->
 				<!-- <navigator :url="'/pagesBus/bus/bus'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/bus.png" mode=""></image>
 					<text>校车预约</text>
 				</navigator> -->
-				<!-- <navigator :url="'/pagesClockIn/index/index'" open-type="navigate" class="menu_item">
+				<navigator :url="'/pagesClockIn/index/index'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/clockIn.png" mode=""></image>
 					<text>校园打卡</text>
-				</navigator> -->
+				</navigator>
 				<!-- <navigator :url="'/pagesClockIn/money/money'" open-type="navigate" class="menu_item">
 					<image src="../../static/images/money.png" mode=""></image>
 					<text>学费缴纳</text>
@@ -42,8 +46,15 @@
 			</view>
 		</view>
 		<view v-if="showLogin">
-			<login :ocode="ocode" :appkey="appkey" scope="snsapi_userinfo" :visible="visible" @success="login_success_callback" @cancel="login_cancel_callback"
-				@fail="login_fail_callback" />
+			<login
+				:ocode="ocode"
+				:appkey="appkey"
+				scope="snsapi_userinfo"
+				:visible="visible"
+				@success="login_success_callback"
+				@cancel="login_cancel_callback"
+				@fail="login_fail_callback"
+			/>
 		</view>
 		<Popup :showPopup="showPopup" @close="showPopup = false">
 			<view class="pupup-content">
@@ -55,419 +66,416 @@
 </template>
 
 <script>
-	import Popup from '@/components/Popup.vue'
-	export default {
-		components: {
-			Popup
-		},
-		data() {
-			return {
-				ceshi: 'code',
-				huanjing: '部署环境', // 部署环境是key,用来获取环境
-				visible: false, // 是否授权可见
-				showLogin: true, // 是否启动授权
-				appkey: '3183DC96A6DABA8D', // 商户appkey
-				appid: 'wxd6f090391d410534', // 获取用户信息
-				ocode: '1015730314', // 获取用户信息
-				app_secret: '05742955578EC5BD29B7BC4CAC5AFACA', // 获取用户信息
-				userinfo: '', // 用户信息
-				showQR_code: false, // 显示校园卡二维码
-				validation_failed: false, // 验证失败
-				validation_times: 0, // 授权次数
-				from: 0, // 跳转参数
-				execed_onload: false,
-				showPopup: false
-			}
-		},
-		onLoad(options) {
-			// console.log(options)
-			// 测试环境
-			if (typeof options.from != 'undefined') {
-				this.from = options.from
-			}
+import Popup from '@/components/Popup.vue'
+export default {
+	components: {
+		Popup
+	},
+	data() {
+		return {
+			ceshi: 'code',
+			huanjing: '部署环境', // 部署环境是key,用来获取环境
+			visible: false, // 是否授权可见
+			showLogin: true, // 是否启动授权
+			appkey: '3183DC96A6DABA8D', // 商户appkey
+			appid: 'wxd6f090391d410534', // 获取用户信息
+			ocode: '1015730314', // 获取用户信息
+			app_secret: '05742955578EC5BD29B7BC4CAC5AFACA', // 获取用户信息
+			userinfo: '', // 用户信息
+			showQR_code: false, // 显示校园卡二维码
+			validation_failed: false, // 验证失败
+			validation_times: 0, // 授权次数
+			from: 0, // 跳转参数
+			execed_onload: false,
+			showPopup: false
+		}
+	},
+	onLoad(options) {
+		// console.log(options)
+		// 测试环境
+		if (typeof options.from != 'undefined') {
+			this.from = options.from
+		}
+		// 检查是否存在用户信息
+		this.has_user_info()
+		// 是否是测试环境,查询数据接口中参数的值决定,方便以后测试
+		this.isTestEnvironment()
+
+		this.execed_onload = true
+	},
+	onShow() {
+		if (!this.execed_onload) {
 			// 检查是否存在用户信息
 			this.has_user_info()
-			// 是否是测试环境,查询数据接口中参数的值决定,方便以后测试
-			this.isTestEnvironment()
+		}
+	},
+	methods: {
+		/**
+		 * 控制环境,test为true测试环境,false则是正式环境
+		 */
+		async isTestEnvironment() {
+			const res = await this.$myRequest({
+				host: this.ceshi,
+				url: '/HotWaters/conEnvi.action',
+				method: 'POST',
+				header: {
+					'content-type': 'application/x-www-form-urlencoded'
+				},
+				data: {
+					name: this.huanjing
+				}
+			})
 
-			this.execed_onload = true
-		},
-		onShow() {
-			if (!this.execed_onload) {
-				// 检查是否存在用户信息
-				this.has_user_info()
+			// console.log(res);
+			if (res.data.mess == '返回成功') {
+				// value为0 测试环境, 为1 部署环境;amount限制启动金额
+				this.$store.state.amount = res.data.data[0].amount
+				if (res.data.data[0].value == 0) {
+					// 测试模式
+					this.$store.state.test = true
+				} else if (res.data.data[0].value == 2) {
+					// 系统正在维护...
+					this.$store.state.test = 'weihuzhong'
+
+					uni.showModal({
+						title: '提示信息',
+						content: '系统维护中...\r\n暂时请不要使用!\r\n避免造成不必要的损失!',
+						showCancel: false
+					})
+				} else {
+					// 正式模式
+					this.$store.state.test = false
+				}
+			} else {
+				uni.showToast({
+					title: res.data.mess,
+					icon: 'success'
+				})
 			}
 		},
-		methods: {
-			/**
-			 * 控制环境,test为true测试环境,false则是正式环境
-			 */
-			async isTestEnvironment() {
-				const res = await this.$myRequest({
-					host: this.ceshi,
-					url: '/HotWaters/conEnvi.action',
-					method: 'POST',
-					header: {
-						'content-type': 'application/x-www-form-urlencoded'
-					},
-					data: {
-						name: this.huanjing
-					}
-				})
-
-				// console.log(res);
-				if (res.data.mess == '返回成功') {
-					// value为0 测试环境, 为1 部署环境;amount限制启动金额
-					this.$store.state.amount = res.data.data[0].amount
-					if (res.data.data[0].value == 0) {
-						// 测试模式
-						this.$store.state.test = true
-					} else if (res.data.data[0].value == 2) {
-						// 系统正在维护...
-						this.$store.state.test = 'weihuzhong'
-
-						uni.showModal({
-							title: '提示信息',
-							content: '系统维护中...\r\n暂时请不要使用!\r\n避免造成不必要的损失!',
-							showCancel: false
-						})
-					} else {
-						// 正式模式
-						this.$store.state.test = false
-					}
+		/**
+		 * 是否有用户信息
+		 */
+		has_user_info() {
+			try {
+				// console.log(111111);
+				const value = uni.getStorageSync('userinfo_storage_key')
+				// console.log(value);
+				if (value == '') {
+					this.showLogin = true
+					this.visible = true
 				} else {
-					uni.showToast({
-						title: res.data.mess,
-						icon: 'success'
-					})
+					this.showLogin = false
+					this.userinfo = value
+					this.$store.state.userInfo = this.userinfo
 				}
-			},
-			/**
-			 * 是否有用户信息
-			 */
-			has_user_info() {
+			} catch (e) {
+				// console.log(e)
+				uni.showToast({
+					title: '异常:' + e,
+					duration: 3000
+				})
+			}
+		},
+		/**
+		 * 授权登陆取消回调
+		 */
+		login_cancel_callback() {
+			this.reauthorization()
+		},
+		/**
+		 * 重新授权
+		 */
+		reauthorization() {
+			this.validation_times = this.validation_times + 1
+
+			if (this.validation_times >= 2) {
+				this.login_fail_callback()
+			} else {
 				try {
-					// console.log(111111);
-					const value = uni.getStorageSync('userinfo_storage_key')
-					// console.log(value);
-					if (value == '') {
+					// uni.removeStorageSync('userinfo_storage_key')
+					setTimeout(() => {
+						this.showLogin = false
+						this.userinfo = {}
+					}, 30)
+
+					setTimeout(() => {
 						this.showLogin = true
 						this.visible = true
-					} else {
-						this.showLogin = false
-						this.userinfo = value
-						this.$store.state.userInfo = this.userinfo
-					}
+					}, 30)
 				} catch (e) {
-					// console.log(e)
-					uni.showToast({
-						title: '异常:' + e,
-						duration: 3000
-					})
+					console.log(e)
 				}
-			},
-			/**
-			 * 授权登陆取消回调
-			 */
-			login_cancel_callback() {
-				this.reauthorization()
-			},
-			/**
-			 * 重新授权
-			 */
-			reauthorization() {
-				this.validation_times = this.validation_times + 1
+			}
+		},
+		/**
+		 * 授权登陆取消回调
+		 */
+		login_fail_callback() {
+			var _this = this
+			_this.userinfo = {}
+			if (!_this.validation_failed) {
+				_this.validation_failed = false
+				uni.showModal({
+					title: '提示',
+					content: '授权:请先领取校园卡、并激活!',
+					// cancelText: '取消',
+					confirmText: '领取',
+					success: (res1) => {
+						if (res1.confirm) {
+							// 截屏,用户利用微信识别二维码添加校园卡、激活
+							_this.showPopup = true
+						} else if (res1.cancel) {
+							// console.log('用户点击取消');
+							// uni.showToast({
+							// 	icon: 'none',
+							// 	title: '10秒后自动隐藏二维码,可重新授权调起!',
+							// 	duration: 1000,
+							// 	success: (com) => {
+							// 		this.showQR_code = true
+							// 		setTimeout(() => {
+							// 			this.showQR_code = false
+							// 		}, 10000)
+							// 	}
+							// });
+						}
+					}
+				})
+			}
+		},
+		/**
+		 * 授权登陆成功回调
+		 */
+		login_success_callback: function ({ detail }) {
+			const { wxcode = '' } = detail
 
-				if (this.validation_times >= 2) {
-					this.login_fail_callback()
-				} else {
-					try {
-						// uni.removeStorageSync('userinfo_storage_key')
-						setTimeout(() => {
-							this.showLogin = false
-							this.userinfo = {}
-						}, 30)
+			this.validation_failed = false
 
-						setTimeout(() => {
-							this.showLogin = true
-							this.visible = true
-						}, 30)
-					} catch (e) {
-						console.log(e)
-					}
-				}
-			},
-			/**
-			 * 授权登陆取消回调
-			 */
-			login_fail_callback() {
-				var _this = this
-				_this.userinfo = {}
-				if (!_this.validation_failed) {
-					_this.validation_failed = false
-					uni.showModal({
-						title: '提示',
-						content: '授权:请先领取校园卡、并激活!',
-						// cancelText: '取消',
-						confirmText: '领取',
-						success: (res1) => {
-							if (res1.confirm) {
-								// 截屏,用户利用微信识别二维码添加校园卡、激活
-								_this.showPopup = true
-							} else if (res1.cancel) {
-								// console.log('用户点击取消');
-								// uni.showToast({
-								// 	icon: 'none',
-								// 	title: '10秒后自动隐藏二维码,可重新授权调起!',
-								// 	duration: 1000,
-								// 	success: (com) => {
-								// 		this.showQR_code = true
-								// 		setTimeout(() => {
-								// 			this.showQR_code = false
-								// 		}, 10000)
-								// 	}
-								// });
-							}
-						}
-					})
-				}
-			},
-			/**
-			 * 授权登陆成功回调
-			 */
-			login_success_callback: function({
-				detail
-			}) {
-				const {
-					wxcode = ''
-				} = detail
+			// 屏蔽用户操作
+			uni.showLoading({
+				title: '获取数据中…',
+				mask: true
+			})
 
-				this.validation_failed = false
+			// 通过wxcode换取access_token
+			this.get_access_token(wxcode)
+		},
+		/**
+		 * 通过wxcode换取access_token
+		 */
+		async get_access_token(param_wxcode) {
+			const res = await this.$myRequest({
+				host: 'wecard',
+				url: '/connect/oauth2/token',
+				method: 'POST',
+				header: {
+					'content-type': 'application/json'
+				},
+				data: {
+					wxcode: param_wxcode,
+					app_key: this.appkey,
+					app_secret: this.app_secret,
+					grant_type: 'authorization_code',
+					redirect_uri: 'mnp://' + this.appid
+				}
+			})
 
-				// 屏蔽用户操作
-				uni.showLoading({
-					title: '获取数据中…',
-					mask: true
+			if (res.data.refresh_token == '' || typeof res.data.refresh_token == 'undefined') {
+				uni.hideLoading()
+				uni.showToast({
+					title: '未获得token'
 				})
+			} else {
+				// 通过access_token换取用户信息
+				this.get_user_info(res.data.access_token)
+			}
+		},
+		/**
+		 * 通过access_token换取用户信息
+		 */
+		async get_user_info(param_access_token) {
+			const res = await this.$myRequest({
+				host: 'wecard',
+				url: '/connect/oauth/get-user-info',
+				method: 'POST',
+				header: {
+					'content-type': 'application/json'
+				},
+				data: {
+					access_token: param_access_token
+				}
+			})
 
-				// 通过wxcode换取access_token
-				this.get_access_token(wxcode)
-			},
-			/**
-			 * 通过wxcode换取access_token
-			 */
-			async get_access_token(param_wxcode) {
-				const res = await this.$myRequest({
-					host: 'wecard',
-					url: '/connect/oauth2/token',
-					method: 'POST',
-					header: {
-						'content-type': 'application/json'
-					},
-					data: {
-						wxcode: param_wxcode,
-						app_key: this.appkey,
-						app_secret: this.app_secret,
-						grant_type: 'authorization_code',
-						redirect_uri: 'mnp://' + this.appid
-					}
-				})
+			// console.log(res);
+			if (res.data.errcode == 0 && res.data.errmsg == 'OK') {
+				try {
+					this.userinfo = res.data
+					this.$store.state.userInfo = res.data
 
-				if (res.data.refresh_token == '' || typeof res.data.refresh_token == 'undefined') {
+					// 获取code,然后去检查是否存在数据库中
+					this.getCode()
+				} catch (e) {
 					uni.hideLoading()
-					uni.showToast({
-						title: '未获得token'
-					})
-				} else {
-					// 通过access_token换取用户信息
-					this.get_user_info(res.data.access_token)
+					console.log(e)
 				}
-			},
-			/**
-			 * 通过access_token换取用户信息
-			 */
-			async get_user_info(param_access_token) {
-				const res = await this.$myRequest({
-					host: 'wecard',
-					url: '/connect/oauth/get-user-info',
-					method: 'POST',
-					header: {
-						'content-type': 'application/json'
-					},
-					data: {
-						access_token: param_access_token
-					}
+			} else {
+				uni.hideLoading()
+				uni.showToast({
+					title: '未获得用户信息,请领取校园卡并激活',
+					duration: 3000
 				})
-
-				// console.log(res);
-				if (res.data.errcode == 0 && res.data.errmsg == 'OK') {
-					try {
-						this.userinfo = res.data
-						this.$store.state.userInfo = res.data
-
-						// 获取code,然后去检查是否存在数据库中
-						this.getCode()
-					} catch (e) {
+			}
+		},
+		/**
+		 * 获得code
+		 */
+		getCode() {
+			var _this = this
+			uni.login({
+				success: (res) => {
+					// console.log('reshui', res);
+					if (res.code) {
+						// 检查用户是否存在第三方库
+						_this.chk_user_is_in_db(res.code)
+					} else {
 						uni.hideLoading()
-						console.log(e)
+						uni.showToast({
+							title: res.errMsg,
+							icon: 'none'
+						})
 					}
-				} else {
+				},
+				fail() {
 					uni.hideLoading()
-					uni.showToast({
-						title: '未获得用户信息,请领取校园卡并激活',
-						duration: 3000
-					})
 				}
-			},
-			/**
-			 * 获得code
-			 */
-			getCode() {
-				var _this = this
-				uni.login({
+			})
+		},
+		/**
+		 * 检查数据库中是否有该用户信息
+		 */
+		async chk_user_is_in_db(param_code) {
+			var _this = this
+			const res = await _this.$myRequest({
+				// host: 'local',
+				host: _this.ceshi,
+				url: '/HotWaters/wpopenid.action',
+				method: 'POST',
+				header: {
+					'content-type': 'application/x-www-form-urlencoded'
+				},
+				data: {
+					userinfo: JSON.stringify(_this.userinfo),
+					code: param_code
+				}
+			})
+
+			// console.log(res);
+			if (res.data.code == 0 || res.data.code == 100) {
+				// 存储用户信息
+				uni.setStorageSync('userinfo_storage_key', _this.userinfo)
+				uni.hideLoading()
+				// 提示授权成功
+				uni.showToast({
+					icon: 'success',
+					title: '授权成功',
+					duration: 800,
 					success: (res) => {
-						// console.log('reshui', res);
-						if (res.code) {
-							// 检查用户是否存在第三方库
-							_this.chk_user_is_in_db(res.code)
-						} else {
-							uni.hideLoading()
-							uni.showToast({
-								title: res.errMsg,
-								icon: 'none'
+						if (_this.from != 0 || _this.from != '0') {
+							// 页面跳转回去
+							uni.setStorageSync('navigateBack', 1)
+
+							uni.navigateBack({
+								delta: 1
 							})
 						}
-					},
-					fail() {
-						uni.hideLoading()
 					}
 				})
-			},
-			/**
-			 * 检查数据库中是否有该用户信息
-			 */
-			async chk_user_is_in_db(param_code) {
-				var _this = this
-				const res = await _this.$myRequest({
-					// host: 'local',
-					host: _this.ceshi,
-					url: '/HotWaters/wpopenid.action',
-					method: 'POST',
-					header: {
-						'content-type': 'application/x-www-form-urlencoded'
-					},
-					data: {
-						userinfo: JSON.stringify(_this.userinfo),
-						code: param_code
-					}
+			} else {
+				uni.hideLoading()
+				uni.showToast({
+					icon: 'none',
+					title: '授权失败:' + res.data.msg,
+					success: (res) => {}
 				})
-
-				// console.log(res);
-				if (res.data.code == 0 || res.data.code == 100) {
-					// 存储用户信息
-					uni.setStorageSync('userinfo_storage_key', _this.userinfo)
-					uni.hideLoading()
-					// 提示授权成功
-					uni.showToast({
-						icon: 'success',
-						title: '授权成功',
-						duration: 800,
-						success: (res) => {
-							if (_this.from != 0 || _this.from != '0') {
-								// 页面跳转回去
-								uni.setStorageSync('navigateBack', 1)
-
-								uni.navigateBack({
-									delta: 1
-								})
-							}
-						}
-					})
-				} else {
-					uni.hideLoading()
-					uni.showToast({
-						icon: 'none',
-						title: '授权失败:' + res.data.msg,
-						success: (res) => {}
-					})
-				}
 			}
 		}
 	}
+}
 </script>
 
 <style scoped lang="scss">
-	.container {
-		display: flex;
-		flex-direction: column;
-		width: 750rpx;
-		font-family: Microsoft YaHei-3970(82674968);
-		color: #333333;
+.container {
+	display: flex;
+	flex-direction: column;
+	width: 750rpx;
+	font-family: Microsoft YaHei-3970(82674968);
+	color: #333333;
 
-		.banner {
-			width: 100%;
-			height: 360rpx;
+	.banner {
+		width: 100%;
+		height: 360rpx;
 
-			image {
-				width: 100%;
-				height: 100%;
-			}
+		image {
+			width: 100%;
+			height: 100%;
 		}
+	}
 
-		.nav {
-			position: relative;
-			width: 100%;
-			background-color: #eee;
+	.nav {
+		position: relative;
+		width: 100%;
+		background-color: #eee;
+		box-sizing: border-box;
+
+		.menu {
+			display: flex;
+			flex-wrap: wrap;
+			width: 750rpx;
 			box-sizing: border-box;
 
-			.menu {
+			.menu_item {
 				display: flex;
-				flex-wrap: wrap;
-				width: 750rpx;
-				box-sizing: border-box;
+				flex-direction: column;
+				flex: 1 0 30%;
+				text-align: center;
+				padding: 30rpx 0 39rpx;
+				font-family: Microsoft YaHei-3970(82674968);
+				color: #333333;
+				background-color: #fff;
+				margin: 1rpx;
 
-				.menu_item {
-					display: flex;
-					flex-direction: column;
-					flex: 1 0 30%;
-					text-align: center;
-					padding: 30rpx 0 39rpx;
-					font-family: Microsoft YaHei-3970(82674968);
-					color: #333333;
-					background-color: #fff;
-					margin: 1rpx;
-
-					image {
-						width: 90rpx;
-						height: 90rpx;
-						margin: 0 auto;
-					}
+				image {
+					width: 90rpx;
+					height: 90rpx;
+					margin: 0 auto;
+				}
 
-					text {
-						margin-top: 18rpx;
-						height: 29rpx;
-						line-height: 29rpx;
-						font-size: 30rpx;
-						color: #333333;
-					}
+				text {
+					box-sizing: border-box;
+					padding: 0 10rpx;
+					margin-top: 18rpx;
+					line-height: 46rpx;
+					font-size: 30rpx;
+					color: #333333;
 				}
 			}
 		}
+	}
 
-		.pupup-content {
-			display: flex;
-			flex-direction: column;
-			justify-content: center;
-			align-items: center;
-			height: 100%;
+	.pupup-content {
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		height: 100%;
 
-			.pupup-title {
-				padding-bottom: 20rpx;
-			}
+		.pupup-title {
+			padding-bottom: 20rpx;
+		}
 
-			.pupup-img {
-				height: 90%;
-			}
+		.pupup-img {
+			height: 90%;
 		}
 	}
+}
 </style>

+ 14 - 0
pages/web/web.vue

@@ -0,0 +1,14 @@
+<template>
+	<web-view src="https://chtech.ncjti.edu.cn/rxsd/wxms/"></web-view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {}
+	},
+	methods: {}
+}
+</script>
+
+<style></style>

+ 54 - 11
pagesClockIn/authentication/authentication.vue

@@ -85,7 +85,7 @@ export default {
 			// 2、创建 camera 上下文 CameraContext 对象
 			this.cameraEngine = wx.createCameraContext()
 			// 3、获取 Camera 实时帧数据
-			const listener = this.cameraEngine.onCameraFrame(frame => {
+			const listener = this.cameraEngine.onCameraFrame((frame) => {
 				if (this.tempImg) {
 					return
 				}
@@ -98,7 +98,7 @@ export default {
 					enableConf: true,
 					enableAngle: true,
 					enableMultiFace: true,
-					success: faceData => {
+					success: (faceData) => {
 						// let face = faceData.faceInfo[0]
 						// if (faceData.x == -1 || faceData.y == -1) {
 						// 	this.tipsText = '检测不到人'
@@ -124,7 +124,7 @@ export default {
 						// 	}
 						// }
 					},
-					fail: err => {
+					fail: (err) => {
 						if (err.x == -1 || err.y == -1) {
 							this.tipsText = '检测不到人'
 						} else {
@@ -144,11 +144,11 @@ export default {
 			// 	return
 			// }
 			uni.getSetting({
-				success: res => {
+				success: (res) => {
 					if (!res.authSetting['scope.camera']) {
 						this.isAuthCamera = true
 						uni.openSetting({
-							success: res => {
+							success: (res) => {
 								if (res.authSetting['scope.camera']) {
 									this.isAuthCamera = true
 								}
@@ -177,18 +177,61 @@ export default {
 				title: '认证中,请稍后...'
 			})
 			setTimeout(() => {
+				// uni.uploadFile({
+				// 	url: `https://chtech.ncjti.edu.cn/campusclock/attendance/api/file/upload`,
+				// 	filePath: url,
+				// 	name: 'file',
+				// 	header: {
+				// 		platform: 2,
+				// 		'Accept-Language': 'zh-CN,zh;q=0.9'
+				// 	},
+				// 	success: uploadFileRes => {
+				// 		let imgUrl = JSON.parse(uploadFileRes.data).data
+				// 		// this.handleUploading(imgUrl)
+				// 		this.handleEncrypt(imgUrl)
+				// 	},
+				// 	fail: () => {
+				// 		uni.showToast({
+				// 			title: '上传失败',
+				// 			icon: 'error'
+				// 		})
+				// 	}
+				// })
+
 				uni.uploadFile({
-					url: `https://chtech.ncjti.edu.cn/campusclock/attendance/api/file/upload`,
+					// url: `https://chtech.ncjti.edu.cn/gxy/facedemo/face-api/ihotel/mapper/face/compareTwoFace`,
+					url: `http://192.168.161.220:8089/ihotel/mapper/face/compareTwoFace`,
 					filePath: url,
 					name: 'file',
+					formData: {
+						mIdCard: this.cardNumber
+					},
 					header: {
 						platform: 2,
 						'Accept-Language': 'zh-CN,zh;q=0.9'
 					},
-					success: uploadFileRes => {
-						let imgUrl = JSON.parse(uploadFileRes.data).data
-						// this.handleUploading(imgUrl)
-						this.handleEncrypt(imgUrl)
+					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
+						}
+
+						// this.handleEncrypt(imgUrl)
 					},
 					fail: () => {
 						uni.showToast({
@@ -222,7 +265,7 @@ export default {
 						)
 					)
 				},
-				success: res => {
+				success: (res) => {
 					if (res.data.status == 200) {
 						let result = JSON.parse(decrypt(res.data.authorization))
 						// console.log(result)

+ 45 - 18
pagesRepairs/offer/offer.vue

@@ -73,7 +73,9 @@ export default {
 			// 订单信息
 			info: {},
 			// 是否允许页面滚动
-			isScroll: true
+			isScroll: true,
+			// 区别报价还是改价
+			type: ''
 		}
 	},
 	computed: {
@@ -96,6 +98,7 @@ export default {
 		this.phone = this.info.maintenancerPhone || ''
 		if (options.type) {
 			this.goodList = this.info.goodsList || []
+			this.type = options.type
 			uni.setNavigationBarTitle({
 				title: '改价'
 			})
@@ -147,26 +150,50 @@ export default {
 				content: '确认提交吗?',
 				success: async (res) => {
 					if (res.confirm) {
-						const res = await this.$myRequest_repairs({
-							url: '/repairConsumables/insertMaintenanceConsumables',
-							method: 'post',
-							data: {
-								recordId: this.info.id,
-								totalPrice: this.countMoney,
-								consumes: this.goodList
+						if (this.type) {
+							const res = await this.$myRequest_repairs({
+								url: '/repairConsumables/changeMaintenanceConsumables',
+								method: 'post',
+								data: {
+									recordId: this.info.id,
+									totalPrice: this.countMoney,
+									consumes: this.goodList
+								}
+							})
+							// console.log(res)
+							if (res.code === '200') {
+								uni.showToast({
+									title: '改价成功',
+									icon: 'success'
+								})
+								setTimeout(() => {
+									uni.reLaunch({
+										url: '/pagesRepairs/box/box'
+									})
+								}, 1500)
 							}
-						})
-						// console.log(res)
-						if (res.code === '200') {
-							uni.showToast({
-								title: '提交成功',
-								icon: 'success'
+						} else {
+							const res = await this.$myRequest_repairs({
+								url: '/repairConsumables/insertMaintenanceConsumables',
+								method: 'post',
+								data: {
+									recordId: this.info.id,
+									totalPrice: this.countMoney,
+									consumes: this.goodList
+								}
 							})
-							setTimeout(() => {
-								uni.reLaunch({
-									url: '/pagesRepairs/box/box'
+							// console.log(res)
+							if (res.code === '200') {
+								uni.showToast({
+									title: '提交成功',
+									icon: 'success'
 								})
-							}, 1500)
+								setTimeout(() => {
+									uni.reLaunch({
+										url: '/pagesRepairs/box/box'
+									})
+								}, 1500)
+							}
 						}
 					}
 				}

binární
static/images/1.png