dedsudiyu 1 år sedan
förälder
incheckning
2568fad81e

+ 10 - 0
pages/component/tabBar.vue

@@ -33,6 +33,7 @@
 </template>
 
 <script>
+	import { pageRestrictVerify } from '@/utils/index'
 	import {
 		systemNoticeGetNoticeCount
 	} from '@/pages/api/index.js'
@@ -82,6 +83,15 @@
 						});
 					}
 				} else if (type === 2) {
+					if (!pageRestrictVerify('laboratoryManagement')) {
+						uni.showToast({
+							title: '没有相关权限,请联系管理员',
+							icon: "none",
+							mask: true,
+							duration: 2000
+						});
+						return
+					}
 					if (this.currentRoute !== 'pages/views/teacherPage/laboratoryList') {
 						uni.redirectTo({
 							url: '/pages/views/teacherPage/laboratoryList',

+ 2 - 2
pages/views/home/home.vue

@@ -1,7 +1,7 @@
 <template>
 	<view id="home">
-		<teacherHome class="flex-box-page" v-if="userType==1"></teacherHome>
-		<pupilHome class="flex-box-page" v-if="userType==2"></pupilHome>
+		<teacherHome class="flex-box-page" v-if="userType==2"></teacherHome>
+		<pupilHome class="flex-box-page" v-if="userType==1"></pupilHome>
 		<!-- <manage-home v-if="userType==1" ref="manage"></manage-home> -->
 		<!-- <user-home v-if="userType==2"></user-home> -->
 		<!-- <supplier-home v-if="userType==3"></supplier-home> -->

+ 2 - 1
pages/views/login/login.vue

@@ -76,7 +76,7 @@
 			}
 		},
 		onShow() {
-			// this.getConfigInfo();
+			this.getConfigInfo();
 		},
 		methods: {
 			//顶部tab点击
@@ -171,6 +171,7 @@
 						}
 					})
 					uni.setStorageSync('circularLogo', config.base_url + newData.circularLogo)
+					uni.setStorageSync('rectangleLogo', config.base_url + newData.rectangleLogo)
 					uni.setStorageSync('videoCover', config.base_url + newData.videoCover)
 					this.$set(this, 'loginBanner', config.base_url + newData.loginBanner);
 					uni.setStorageSync('loginBanner', config.base_url + newData.loginBanner)

+ 271 - 13
pages/views/pupilPage/pupilHome.vue

@@ -1,6 +1,58 @@
 <!-- 学生首页 -->
 <template>
-	<view class="pupilHome">
+	<view class="pupilHome" :style="{paddingTop:navHeight+'rpx'}">
+		<nav-bar :title="title"></nav-bar>
+		<view class="top-back-img" :style="{top:navHeight+'rpx'}">
+			<view class="position-data-button" @click="goPage('dataBoard')"
+			v-if="dataPageType">数据看板</view>
+			<img class="position-img" :src="rectangleLogo">
+		</view>
+		<view class="button-one-box">
+			<view class="button-min" @click="goPage('securityExamination')">
+				<img class="button-img" src="@/pages/images/newImage/icon_sy_aqks@1x.png">
+				<view class="button-name">安全考试</view>
+			</view>
+			<view class="button-min" @click="goPage('securityAdmittance')">
+				<img class="button-img" src="@/pages/images/newImage/icon_sy_aqzr@1x.png">
+				<view class="button-name">安全准入</view>
+			</view>
+			<view class="button-min" @click="goPage('hierarchicalControl')">
+				<img class="button-img" src="@/pages/images/newImage/icon_sy_hxp@1x.png">
+				<view class="button-name">化学品</view>
+			</view>
+			<view class="button-min" @click="goPage('securityResponsibility')">
+				<img class="button-img" src="@/pages/images/newImage/icon_sy_lwgl@1x.png">
+				<view class="button-name">笼位预约</view>
+			</view>
+		</view>
+		<view class="button-two-box">
+			<view class="button-big-box" @click="goPage('snapshot')"
+			style="background-color: #DFF0FF;margin-right:20rpx;">
+				<img src="@/pages/images/newImage/icon_sy_ssp@1x.png">
+				<view class="button-min-box">
+					<view>随手拍</view>
+					<view>发现隐患</view>
+				</view>
+			</view>
+			<view class="button-big-box" @click="goPage('remoteDoorOpening')"
+			style="background-color: #D6EBDA;">
+				<img src="@/pages/images/newImage/img_sy_lkjc@1x.png">
+				<view class="button-min-box">
+					<view>离开检查</view>
+					<view>拍照检查</view>
+				</view>
+			</view>
+		</view>
+		<view class="button-three-box">
+			<view class="button-big-box" @click="goPage('chemicalsManagement')">
+				<img src="@/pages/images/newImage/img_wd_wgjl@1x.png">
+				<view class="button-min-box">
+					<view>违规记录</view>
+					<view>实验室安全违规行为查询</view>
+				</view>
+			</view>
+		</view>
+		<tab-bar></tab-bar>
 	</view>
 </template>
 
@@ -8,35 +60,241 @@
 	import {
 		tabBar
 	} from '@/pages/component/tabBar.vue'
+	import {navBar} from '@/pages/component/navbar.vue'
 	export default {
 		name: "pupilHome",
 		components: {
-			tabBar,
+      tabBar,
+      navBar,
 		},
 		data() {
 			return {
+				pageType:2,
+        navHeight: uni.getStorageSync('navHeight'),
+				dataPageType:false,
+        title: '实验室安全智慧化管控系统',
+				rectangleLogo:uni.getStorageSync('rectangleLogo')
 			}
 		},
-		onLoad() {
-
+		created() {
+			if(pageRestrictVerify('dataBoard')){
+				this.dataPageType = true;
+				// this.pageType = 1;
+			}
 		},
-		onShow() {
+		mounted() {
 
 		},
 		methods: {
-
-		},
-		onHide() {
-
-		},
-		onUnload() {
-
+			goPage(type){
+				if (!pageRestrictVerify(type)) {
+					uni.showToast({
+						title: '没有相关权限,请联系管理员',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
+				if(type == 'dataBoard'){
+					//数据看板
+					
+				}else if(type == 'securityCheck'){
+					//安全检查
+					
+				}else if(type == 'securityExamination'){
+					//安全考试
+					
+				}else if(type == 'securityAdmittance'){
+					//安全准入
+					
+				}else if(type == 'hierarchicalControl'){
+					//分级管控
+					
+				}else if(type == 'securityResponsibility'){
+					//安全责任
+					
+				}else if(type == 'deviceManagement'){
+					//设备管理
+					
+				}else if(type == 'emergencyDisposal'){
+					//应急处置
+					
+				}else if(type == 'cageSiteManagement'){
+					//笼位管理
+					
+				}else if(type == 'snapshot'){
+					//随手拍
+					
+				}else if(type == 'remoteDoorOpening'){
+					//远程开门
+					
+				}else if(type == 'chemicalsManagement'){
+					//化学品管控
+					
+				}
+			},
 		}
 	}
 </script>
 
 <style lang="stylus" scoped>
 	.pupilHome {
-		height: 100%;
+		flex: 1;
+		display: flex;
+		flex-direction: column;
+		overflow: hidden;
+
+		.top-page-title {
+			text-align: center;
+			font-size: 28rpx;
+			background-color: #0183FA;
+			color: #fff;
+		}
+
+		.top-back-img {
+			position: absolute;
+			top: 0;
+			left: 0;
+			width: 750rpx;
+			height: 539rpx;
+			background: url("@/pages/images/newImage/img_sy_bg@1x.png");
+			background-size 100%;
+			background-repeat: no-repeat;
+
+			.position-img {
+				z-index: 5;
+				position: absolute;
+				left: 0;
+				top: 10rpx;
+				width: 400rpx;
+				height: 88rpx;
+			}
+
+			.position-data-button {
+				z-index: 5;
+				position: absolute;
+				right: 0;
+				top: 40rpx;
+				width: 160rpx;
+				height: 50rpx;
+				line-height: 50rpx;
+				background-color: #0183fa;
+				color: #fff;
+				font-size: 28rpx;
+				text-align: center;
+				border-top-left-radius: 30rpx;
+				border-bottom-left-radius: 30rpx;
+			}
+		}
+
+		.button-one-box {
+			z-index: 5;
+			background: #fff;
+			width: 690rpx;
+			border-radius: 20rpx;
+			padding: 13px 0 20px;
+			overflow: hidden;
+			margin: 330rpx 30rpx 0;
+
+			.button-min {
+				display: inline-block;
+				overflow: hidden;
+				width: 172rpx;
+				height: 123rpx;
+				margin-top: 23rpx;
+
+				.button-img {
+					display: block;
+					width: 80rpx;
+					height: 80rpx;
+					margin: 0 auto;
+				}
+
+				.button-name {
+					margin-top: 15rpx;
+					height: 28rpx;
+					line-height: 28rpx;
+					font-size: 28rpx;
+					text-align: center;
+					color: #333;
+				}
+			}
+		}
+
+		.button-two-box {
+			z-index: 5;
+			width: 690rpx;
+			height: 120rpx;
+			display: flex;
+			margin: 20rpx 30rpx 0;
+
+			.button-big-box {
+				width: 335rpx;
+				display: flex;
+				border-radius: 20rpx;
+
+				img {
+					display: block;
+					margin: 20rpx 31rpx 0 36rpx;
+					height: 80rpx;
+					width: 80rpx;
+				}
+
+				.button-min-box {
+					view:nth-child(1) {
+						line-height: 32rpx;
+						height: 32rpx;
+						font-size: 32rpx;
+						color: #333;
+						margin: 20rpx 0 18rpx;
+					}
+
+					view:nth-child(2) {
+						line-height: 28rpx;
+						height: 28rpx;
+						font-size: 28rpx;
+						color: #999;
+					}
+				}
+			}
+		}
+
+		.button-three-box {
+			z-index: 5;
+			width: 690rpx;
+			height: 150rpx;
+			margin: 20rpx 30rpx 0;
+
+			.button-big-box {
+				border-radius: 20rpx;
+				background-color: #FFF0DD;
+				display: flex;
+
+				img {
+					display: block;
+					width: 134rpx;
+					height: 104rpx;
+					margin: 23rpx 34rpx 0 30rpx;
+				}
+
+				.button-min-box {
+					view:nth-child(1) {
+						line-height: 30rpx;
+						height: 30rpx;
+						font-size: 30rpx;
+						color: #FF8C00;
+						margin: 35rpx 0 20rpx;
+					}
+
+					view:nth-child(2) {
+						line-height: 26rpx;
+						height: 26rpx;
+						font-size: 26rpx;
+						color: #666666;
+					}
+				}
+			}
+		}
 	}
 </style>

+ 107 - 26
pages/views/teacherPage/teacherHome.vue

@@ -1,56 +1,61 @@
 <!-- 教师首页 -->
 <template>
-	<view class="teacherHome">
+	<view class="teacherHome" :style="{paddingTop:navHeight+'rpx'}">
 		<view class="data-board" v-if="pageType == 1">
 
 		</view>
 		<view class="home-page" v-if="pageType == 2">
-			<view class="top-page-title" :style="'line-height:'+navHeight+'rpx;'">实验室安全智慧化管控系统</view>
-			<img class="top-back-img" :style="{top:navHeight+'rpx'}"
-			src="@/pages/images/newImage/img_sy_bg@1x.png">
+			<nav-bar :title="title"></nav-bar>
+			<view class="top-back-img" :style="{top:navHeight+'rpx'}">
+				<view class="position-data-button" @click="goPage('dataBoard')"
+				v-if="dataPageType">数据看板</view>
+				<img class="position-img" :src="rectangleLogo">
+			</view>
 			<view class="button-one-box">
-				<view class="button-min">
+				<view class="button-min" @click="goPage('securityCheck')">
 					<img class="button-img" src="@/pages/images/newImage/icon_sy_aqjc@1x.png">
 					<view class="button-name">安全检查</view>
 				</view>
-				<view class="button-min">
+				<view class="button-min" @click="goPage('securityExamination')">
 					<img class="button-img" src="@/pages/images/newImage/icon_sy_aqks@1x.png">
 					<view class="button-name">安全考试</view>
 				</view>
-				<view class="button-min">
+				<view class="button-min" @click="goPage('securityAdmittance')">
 					<img class="button-img" src="@/pages/images/newImage/icon_sy_aqzr@1x.png">
 					<view class="button-name">安全准入</view>
 				</view>
-				<view class="button-min">
+				<view class="button-min" @click="goPage('hierarchicalControl')">
 					<img class="button-img" src="@/pages/images/newImage/icon_sy_fjgk@1x.png">
 					<view class="button-name">分级管控</view>
 				</view>
-				<view class="button-min">
+				<view class="button-min" @click="goPage('securityResponsibility')">
 					<img class="button-img" src="@/pages/images/newImage/icon_sy_aqzrr@1x.png">
 					<view class="button-name">安全责任</view>
 				</view>
-				<view class="button-min">
+				<view class="button-min" @click="goPage('deviceManagement')">
 					<img class="button-img" src="@/pages/images/newImage/icon_sy_sbgl@1x.png">
 					<view class="button-name">设备管理</view>
 				</view>
-				<view class="button-min">
+				<view class="button-min" @click="goPage('emergencyDisposal')">
 					<img class="button-img" src="@/pages/images/newImage/icon_sy_yjcz@1x.png">
 					<view class="button-name">应急处置</view>
 				</view>
-				<view class="button-min">
+				<view class="button-min" @click="goPage('cageSiteManagement')">
 					<img class="button-img" src="@/pages/images/newImage/icon_sy_lwgl@1x.png">
 					<view class="button-name">笼位管理</view>
 				</view>
 			</view>
 			<view class="button-two-box">
-				<view class="button-big-box" style="background-color: #DFF0FF;margin-right:20rpx;">
+				<view class="button-big-box" @click="goPage('snapshot')"
+				style="background-color: #DFF0FF;margin-right:20rpx;">
 					<img src="@/pages/images/newImage/icon_sy_ssp@1x.png">
 					<view class="button-min-box">
 						<view>随手拍</view>
 						<view>发现隐患</view>
 					</view>
 				</view>
-				<view class="button-big-box" style="background-color: #D6EBDA;">
+				<view class="button-big-box" @click="goPage('remoteDoorOpening')"
+				style="background-color: #D6EBDA;">
 					<img src="@/pages/images/newImage/img_sy_yckm@1x.png">
 					<view class="button-min-box">
 						<view>远程开门</view>
@@ -59,7 +64,7 @@
 				</view>
 			</view>
 			<view class="button-three-box">
-				<view class="button-big-box">
+				<view class="button-big-box" @click="goPage('chemicalsManagement')">
 					<img src="@/pages/images/newImage/img_bg_hxpgk@1x.png">
 					<view class="button-min-box">
 						<view>化学品智能管控</view>
@@ -73,34 +78,84 @@
 </template>
 
 <script>
+  import { pageRestrictVerify } from '@/utils/index'
 	import {
 		tabBar
 	} from '@/pages/component/tabBar.vue'
+	import {navBar} from '@/pages/component/navbar.vue'
 	export default {
 		name: "teacherHome",
 		components: {
 			tabBar,
+      navBar,
 		},
 		data() {
 			return {
 				pageType:2,
         navHeight: uni.getStorageSync('navHeight'),
+				dataPageType:false,
+        title: '实验室安全智慧化管控系统',
+				rectangleLogo:uni.getStorageSync('rectangleLogo')
 			}
 		},
-		onLoad() {
-
+		created() {
+			if(pageRestrictVerify('dataBoard')){
+				this.dataPageType = true;
+				// this.pageType = 1;
+			}
 		},
-		onShow() {
+		mounted() {
 
 		},
 		methods: {
-
-		},
-		onHide() {
-
-		},
-		onUnload() {
-
+			goPage(type){
+				if (!pageRestrictVerify(type)) {
+					uni.showToast({
+						title: '没有相关权限,请联系管理员',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
+				if(type == 'dataBoard'){
+					//数据看板
+					
+				}else if(type == 'securityCheck'){
+					//安全检查
+					
+				}else if(type == 'securityExamination'){
+					//安全考试
+					
+				}else if(type == 'securityAdmittance'){
+					//安全准入
+					
+				}else if(type == 'hierarchicalControl'){
+					//分级管控
+					
+				}else if(type == 'securityResponsibility'){
+					//安全责任
+					
+				}else if(type == 'deviceManagement'){
+					//设备管理
+					
+				}else if(type == 'emergencyDisposal'){
+					//应急处置
+					
+				}else if(type == 'cageSiteManagement'){
+					//笼位管理
+					
+				}else if(type == 'snapshot'){
+					//随手拍
+					
+				}else if(type == 'remoteDoorOpening'){
+					//远程开门
+					
+				}else if(type == 'chemicalsManagement'){
+					//化学品管控
+					
+				}
+			},
 		}
 	}
 </script>
@@ -125,7 +180,7 @@
 			overflow: scroll;
 			.top-page-title{
 				text-align: center;
-				font-size:32rpx;
+				font-size:28rpx;
 				background-color:#0183FA;
 				color:#fff;
 			}
@@ -135,6 +190,32 @@
 				left:0;
 				width:750rpx;
 				height:539rpx;
+				background: url("@/pages/images/newImage/img_sy_bg@1x.png");
+				background-size 100%;
+				background-repeat: no-repeat;
+				.position-img{
+					z-index:5;
+					position: absolute;
+					left: 0;
+					top: 10rpx;
+					width: 400rpx;
+					height: 88rpx;
+				}
+				.position-data-button{
+					z-index:5;
+					position: absolute;
+					right:0;
+					top:40rpx;
+					width:160rpx;
+					height:50rpx;
+					line-height:50rpx;
+					background-color:#0183fa;
+					color:#fff;
+					font-size:28rpx;
+					text-align: center;
+					border-top-left-radius: 30rpx;
+					border-bottom-left-radius: 30rpx;
+				}
 			}
 			.button-one-box{
 				z-index:5;

+ 8 - 0
pages/views/teacherPage/teacherMine.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 11 - 0
utils/index.js

@@ -10,4 +10,15 @@ export function controlsRestrictVerify(str) {
   }else{
     return false
   }
+}
+/*            页面权限验证
+* str 为权限字符 用于匹配操作角色的字符
+*/
+export function pageRestrictVerify(str) {
+  if(str){
+    let permissions = uni.getStorageSync('permissions')+'';
+    return permissions.indexOf(str) != -1;
+  }else{
+    return false
+  }
 }