dedsudiyu 10 months ago
parent
commit
5954189ee3

+ 2 - 2
api/request/config.js

@@ -1,12 +1,12 @@
 const config = {
 	// base_url: 'http://192.168.1.43/api', //43服务器
-	//base_url: 'http://192.168.1.8/api',//1.8服务器
+	base_url: 'http://192.168.1.8/api',//1.8服务器
 	// base_url: 'http://192.168.1.9:8080',//柴
 	// base_url: 'http://192.168.1.24:8080',//林总
 	// base_url: 'http://192.168.1.7:8080',//刘波
 	//base_url: 'http://192.168.1.17:8080',//小飞
 	//base_url: 'http://192.168.1.43/api',//小飞
-	base_url: 'http://192.168.1.20:8080',//志伟
+	// base_url: 'http://192.168.1.20:8080',//志伟
 	//  base_url: 'http://192.168.1.39:8080',//高升
 	// base_url: 'http://192.168.1.29:8080',//何成
 	// base_url: 'https://demo.zjznai.com/xzgd/',

+ 5 - 0
pages/component/topWarn.vue

@@ -172,6 +172,11 @@
 				});
 			},
 		},
+		onHide() {
+			//清除定时器
+			let self = this;
+			self.offPlanMQTT();
+		},
 		beforeDestroy() {
 			//清除定时器
 			let self = this;

+ 11 - 328
pages/views/mine/mine.vue

@@ -1,76 +1,8 @@
 <!-- 我的 -->
 <template>
 	<view id="mine">
-		<teacherMine class="flex-box-page" v-if="userType==1"></teacherMine>
-		<pupilMine class="flex-box-page" v-if="userType==2"></pupilMine>
-		
-		
-		
-		<!-- 
-		<view class="top-max-big-box" v-if="pageType">
-			
-			<view class="top-max-box-two" v-if="userType==1">
-				<view class="user-img-box" @click="selectImage">
-					<img v-if="userData.avatar" :src="baseUrl+userData.avatar">
-					<img v-else src="@/pages/images/icon_01.png">
-					<view>{{userData.avatar?'编辑':'未上传'}}</view>
-				</view>
-				<view class="name-box">
-					<view>{{userData.userName}}</view>
-					<view>{{userData.deptName}}</view>
-				</view>
-			</view>
-			
-			<view class="user-top-max-box-one" v-if="userType==2">
-				<view class="back-posi"></view>
-				<view class="top-max-box-one">
-					<view class="user-img-box" @click="selectImage">
-						<img v-if="userData.avatar" :src="userData.avatarUrl">
-						<img v-else src="@/pages/images/icon_01.png">
-						<view>{{userData.avatar?'编辑':'未上传'}}</view>
-					</view>
-					<view class="name-box">
-						<view class="name-box-min">
-							<view>{{userData.userName}}</view>
-							<view
-								:class="userData.status == 2?'view-color-one':(userData.status == 3?'view-color-two':(userData.status == 1?'view-color-tree':''))">
-								{{userData.status == 2?'负面清单':(userData.status == 3?'黑名单':(userData.status == 1?'正常':''))}}
-							</view>
-						</view>
-						<view class="name-box-user">{{userData.professional}}丨{{userData.deptName}}</view>
-					</view>
-				</view>
-				<view class="num-max-box">
-					<view class="min-num-box" @click="goUserPage('none')">
-						<view class="min-num-view color-one">{{creditScore}}</view>
-						<view class="bottom-min-num-view">
-							<img class="img-one" src="@/pages/images/icon_wd_xyf.png">
-							<view>信用分</view>
-						</view>
-					</view>
-					<view class="null-p"></view>
-					<view class="min-num-box" @click="goUserPage('none')">
-						<view class="min-num-view color-two">{{bonusPoints}}</view>
-						<view class="bottom-min-num-view">
-							<img class="img-two" src="@/pages/images/icon_wd_jlf.png">
-							<view>奖励分</view>
-						</view>
-					</view>
-					<view class="null-p"></view>
-					<view class="min-num-box" @click="goUserPage(3)">
-						<view class="min-num-view">扫一扫</view>
-						<view class="bottom-min-num-view">
-							<img class="img-two" src="@/pages/images/icon_wd_dh.png">
-							<view>兑换礼品</view>
-						</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<mineConfigurationSlot v-for="(item,index) in mineConfigData" :key="index" :mineConfig="item">
-		</mineConfigurationSlot>
-		<view class="out-button" @click="clickOut">退出登录</view>
-		<tab-bar></tab-bar> -->
+		<teacherMine class="flex-box-page" ref="teacherMine" v-if="userType==1"></teacherMine>
+		<pupilMine class="flex-box-page" ref="pupilMine" v-if="userType==2"></pupilMine>
 	</view>
 </template>
 
@@ -82,38 +14,8 @@
 		pupilMine
 	} from '@/pages/views/pupilPage/pupilMine'
 	
-	
-	// import {
-	// 	config
-	// } from '@/api/request/config.js'
-	// import {
-	// 	logout,
-	// 	studentinfoFacemy,
-	// 	simpleInfo,
-	// 	getSafeWarnList,
-	// 	fingerprintQuantity,
-	// 	fingerprintQueryList,
-	// 	systemAppletLayoutSelect,
-	// 	systemUserProfile,
-	// 	examPointsRecordGetMyPointsLogInfo
-	// } from '@/pages/api/index.js'
-	// import {
-	// 	getMineConfig
-	// } from '@/utils/mineConfig'
-
-	// import {
-	// 	tabBar
-	// } from '@/pages/component/tabBar.vue'
-	// import {
-	// 	mineConfigurationSlot
-	// } from '@/pages/component/mineConfigurationSlot'
-
 	export default {
-
-		// components: {
-		// 	tabBar,
-		// 	mineConfigurationSlot,
-		// },
+		
 		components: {
 			teacherMine,
 			pupilMine,
@@ -122,36 +24,6 @@
 		data() {
 			return {
 				userType: 0,
-				
-				// baseUrl: config.base_url,
-				// mineConfigData: [],
-				// //页面状态
-				// pageType: false,
-				// //认证数据
-				// certification: {
-
-				// },
-				// userType: 0,
-				// userData: {
-				// 	deptName: "",
-				// 	professional: "",
-				// 	userName: "",
-				// },
-				// securityAlertNum: 0,
-				// adminSubCount: 0,
-				// wranDoCount: 0,
-				// //奖励分
-				// bonusPoints: 0,
-				// //信用分
-				// creditScore: 0,
-				// //用户签名
-				// signatureUrl: '',
-				// // 人脸
-				// ifFaceFeature: "",
-				// //签名
-				// isUpload: "",
-				// Quantity: 0, //指纹录取数量
-
 			}
 		},
 		onLoad() {
@@ -159,205 +31,16 @@
 		},
 		onShow() {
 			this.userType = uni.getStorageSync('userType')
-			// this.simpleInfo();
-			// this.systemAppletLayoutSelect();
-			// if (uni.getStorageSync('token') && uni.getStorageSync('userId') && uni.getStorageSync('userType')) {
-			// 	this.userType = uni.getStorageSync('userType')
-			// 	if(this.userType == '2'){
-			// 		this.examPointsRecordGetMyPointsLogInfo();
-			// 	}
-			// } else {
-			// 	uni.removeStorageSync('token');
-			// 	uni.removeStorageSync('userId');
-			// 	uni.removeStorageSync('userType');
-			// 	uni.redirectTo({
-			// 		url: '/pages/login',
-			// 	});
-			// }
+			this.$nextTick(()=>{
+				if(this.userType == 1){
+					this.$refs.teacherMine.initialize();
+				}else if(this.userType == 2){
+					this.$refs.pupilMine.initialize();
+				}
+			})
 		},
-
 		methods: {
-			//获取菜单配置
-			async systemAppletLayoutSelect() {
-				const {
-					data
-				} = await systemAppletLayoutSelect({
-					module: 'mine'
-				})
-				if (data.code == 200) {
-					let list = JSON.parse(JSON.stringify(data.data))
-					for (let i = 0; i < list.length; i++) {
-						list[i].layout = JSON.parse(list[i].layout);
-					}
-					this.$set(this, 'mineConfigData', getMineConfig(list));
-				}
-			},
-			//查询学生-信用分/奖励分
-			async examPointsRecordGetMyPointsLogInfo() {
-				const {
-					data
-				} = await examPointsRecordGetMyPointsLogInfo();
-				if (data.code == 200) {
-					this.bonusPoints = data.data.bonusPoints;
-					this.creditScore = data.data.creditScore;
-				}
-			},
-			//学生端-信用分/奖励分/扫一扫按钮
-			goUserPage(type) {
-				let self = this;
-				if (type == 1) {
-					uni.navigateTo({
-						url: '/pages_student/views/mine/creditPoints',
-					});
-				} else if (type == 2) {
-					uni.navigateTo({
-						url: '/pages_student/views/mine/rewardPoints',
-					});
-				} else if (type == 3) {
-					uni.scanCode({
-						onlyFromCamera: true,
-						success: function(res) {
-							uni.navigateTo({
-								url: '/pages_student/views/integralManage/codeSuccess?q=' +
-									encodeURIComponent(JSON.stringify(res.result))
-							});
-						}
-					});
-				} else if (type == 'none') {
-					uni.showToast({
-						title: '暂未开放',
-						icon: "none",
-						mask: true,
-						duration: 2000
-					});
-				}
-			},
-			//获取个人信息
-			async simpleInfo() {
-				const {
-					data
-				} = await systemUserProfile();
-				if (data.code == 200) {
-					this.$set(this, 'userData', data.data)
-					uni.setStorageSync('faceImg', data.data.faceImg);
-					this.$set(this, 'pageType', true)
-				}
-			},
-			//获取报警信息列表
-			async getSafeWarnList() {
-				let obj = {
-					pageNum: 1,
-					pageSize: 1,
-					count: 0,
-					groupStatus: 1,
-				};
-				const {
-					data
-				} = await getSafeWarnList(obj);
-				if (data.code == 200) {
-					if (data.rows[0]) {
-						this.securityAlertNum = data.rows[0].todayHappenCount;
-					} else {
-						this.securityAlertNum = 0;
-					}
-				}
-			},
-			//获取当前身份人脸验证状态与学生卡上传状态
-			async studentinfoFacemy() {
-				let obj = {
-					studentsId: uni.getStorageSync('userId')
-				}
-				const {
-					data
-				} = await studentinfoFacemy(obj)
-				if (data.code == 200) {
-					this.certification = data.data;
-					this.ifFaceFeature = data.data.ifFaceFeature;
-				}
-			},
-			//退出按钮
-			clickOut() {
-				let self = this;
-				uni.showModal({
-					// title: '确认要退出吗?',
-					content: '确认要退出吗',
-					cancelColor: "#999",
-					confirmColor: "#0183FA",
-					success: function(res) {
-						if (res.confirm) {
-							self.logout();
-						} else if (res.cancel) {}
-					}
-				});
-			},
-			//退出登录
-			async logout() {
-				let self = this;
-				const {
-					data
-				} = await logout();
-				if (data.code == 200) {
-					uni.removeStorageSync('token');
-					uni.removeStorageSync('userId');
-					uni.removeStorageSync('userType');
-					uni.redirectTo({
-						url: '/pages/views/login/login',
-					});
-				}
-			},
-			// 头像上传
-			selectImage() {
-				let self = this;
-				wx.chooseImage({
-					count: 1,
-					sizeType: ["original", "compressed"],
-					sourceType: ["album", "camera"],
-					success: function(res) {
-						let tempFilePaths = res.tempFilePaths[0];
-						self.uploadImg(tempFilePaths);
-					}
-				});
-			},
-			async uploadImg(tempFilePaths) {
-				var self = this;
-				uni.showLoading({
-					title: '上传中',
-					mask: true
-				});
-				uni.uploadFile({
-					url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
-					header: {
-						'Authorization': uni.getStorageSync('token')
-					},
-					filePath: tempFilePaths,
-					name: 'file',
-					formData: {
-						'user': 'test'
-					},
-					success: (uploadFileRes) => {
-						let res = JSON.parse(uploadFileRes.data);
-						if (res.code == 200) {
-							uni.navigateTo({
-								url: '/pages_basics/views/avatar?src=' + config.base_url + res.data.url,
-							});
-
-
-
-						} else {
-							uni.showToast({
-								title: res.msg,
-								icon: "none",
-								mask: true,
-								duration: 2000
-							});
-						}
-					},
-					fail: err => {},
-					complete: () => {
-						uni.hideLoading()
-					}
-				});
-			},
+			
 		},
 	}
 </script>

+ 6 - 4
pages/views/pupilPage/pupilMine.vue

@@ -107,14 +107,16 @@
 			}
 		},
 		created() {
-
 		},
 		mounted() {
-			this.systemUserProfile();
-			this.examPointsRecordGetMyPointsLogInfo();
+		},
+		onShow(){
 		},
 		methods: {
-		
+			initialize(){
+				this.systemUserProfile();
+				this.examPointsRecordGetMyPointsLogInfo();
+			},
 			scanCode() {
 				uni.scanCode({
 					onlyFromCamera: true,

+ 7 - 9
pages/views/teacherPage/teacherMine.vue

@@ -4,7 +4,7 @@
 		<view class="back-img-box"></view>
 		<!-- 信息面板 -->
 		<view class="user-info-box">
-			<view class="left-img-box">
+			<view class="left-img-box" @click="selectImage()">
 				<img v-if="userData.avatar" class="avatar-img" :src="userData.avatar">
 				<img v-else class="avatar-img" src="@/pages/images/icon_01.png">
 				<img class="edit-img" src="@/pages/images/newImage/icon_wd_bj@1x.png">
@@ -117,14 +117,16 @@
 			}
 		},
 		created() {
-
 		},
 		mounted() {
-			this.systemUserProfile();
-			this.examPointsRecordGetMyPointsLogInfo();
+		},
+		onShow(){
 		},
 		methods: {
-		
+			initialize(){
+				this.systemUserProfile();
+				this.examPointsRecordGetMyPointsLogInfo();
+			},
 			scanCode() {
 				uni.scanCode({
 					onlyFromCamera: true,
@@ -200,7 +202,6 @@
 					data
 				} = await systemUserProfile();
 				if (data.code == 200) {
-					console.log(data.data)
 					this.$set(this, 'userData', data.data)
 					this.faceImg=data.data.faceImg;
 					this.signatureUrl=data.data.signature
@@ -285,9 +286,6 @@
 								url: '/pages_basics/views/avatar?src=' + config.base_url + res.data
 									.url,
 							});
-
-
-
 						} else {
 							uni.showToast({
 								title: res.msg,

+ 10 - 0
pages_manage/views/emergencyEvacuationBig.vue

@@ -1103,6 +1103,11 @@
 						mask: true,
 						duration: 2000
 					});
+					if (this.warnData) {
+						this.getDataA();
+					} else {
+						this.laboratoryBigViewGetBuildByBigView();
+					}
 				}
 			},
 			videoErrorCallback(e) {
@@ -1182,6 +1187,11 @@
 				}
 			},
 		},
+		onHide() {
+			//清除定时器
+			let self = this;
+			self.offMQTT();
+		},
 		beforeDestroy() {
 			//清除定时器
 			let self = this;

+ 5 - 0
pages_manage/views/laboratory/iotControl.vue

@@ -358,6 +358,11 @@
 			},
 
 
+		},
+		onHide() {
+			//清除定时器
+			let self = this;
+			self.offMQTT();
 		},
 		beforeDestroy() {
 			//清除定时器