heyang месяцев назад: 11
Родитель
Сommit
e0bfc8b051

+ 2 - 9
App.vue

@@ -8,13 +8,6 @@
 			const SystemInfomations = systemInfo()
 			this.navHeight = SystemInfomations.navHeight + SystemInfomations.statusBarHeight //头部导航栏总高度
 			uni.setStorageSync('navHeight', this.navHeight)
-			//获取openid
-			uni.login({
-				success(loginRes) {
-					console.log('获取code成功');
-					uni.setStorageSync('code', loginRes.code);
-				}
-			})
 			//小程序热更新
 			if (wx.canIUse('getUpdateManager')) {
 			  const updateManager = wx.getUpdateManager()
@@ -76,8 +69,8 @@
 			mqttPerformData:{},//是否正在执行灭火操作
         },
 		created() {
-			
-			
+
+
 		},
         methods: {
 			//删除报警监听

+ 0 - 197
component/mineConfigurationSlot.vue

@@ -1,197 +0,0 @@
-<!-- 
- 个人中心按钮匹配组件
-	<mineConfigurationSlot :mineConfig="mineConfigData"></mineConfigurationSlot>
-	
-	import { mineConfigurationSlot } from '@/component/mineConfigurationSlot'
-	import { getMineConfig } from '@/utils/mineConfig'
-	
-	components: {
-		mineConfigurationSlot,
-	},
-	
-	mineConfigData: [],
-	
-	//获取菜单配置
-	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));
-		  console.log('mineConfigData',this.mineConfigData)
-		}
-	},
- -->
-<template>
-	<view class="mineConfigurationSlot">
-		<view class="button-max-big-box">
-			<permissionsSlot class="button-for-box" v-for="(item,index) in mineConfig.layout" :key="index" :hasPermi="item.limits">
-				<view class="button-max-box" @click="buttonClick(item)">
-					<img class="left-img" :src="item.img">
-					<view>{{item.name}}</view>
-					<view class="view-three-one" v-if="item.route === 'mineWarningRecording' && securityAlertNum>0">{{securityAlertNum}}</view>
-					<view class="view-three-two" v-if="item.route === 'laboratory' && adminSubCount>0">{{adminSubCount}}</view>
-					<view class="view-three-two" v-if="item.route === 'PlanExecuteRecord' && wranDoCount>0">{{wranDoCount}}</view>
-					<view class="view-three-type" v-if="item.route === 'faceImage'"
-					:class="ifFaceFeature==''?'colorA':'marginType'">
-						{{ifFaceFeature==''?'去认证':'已认证'}}
-					</view>
-					<img class="right-img" src="@/images/basicsModules/icon_04.png">
-				</view>
-			</permissionsSlot>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		fingerprintQueryList
-	} from '@/api/basicsModules/index.js'
-	export default {
-		name: "mineConfigurationSlot",
-		props: {
-			mineConfig: {},
-			// 人脸
-			ifFaceFeature: "",
-			//签名
-			isUpload:"",
-			Quantity:0,//指纹录取数量	
-			//用户签名
-			signatureUrl: "",
-			//预案执行记录
-			wranDoCount: 10,
-			//我的实验室
-			adminSubCount: 0,
-			//预警记录
-			securityAlertNum: 10,
-		},
-		data() {
-			return {
-			}
-		},
-		created() {
-			this.$set(this,'ifFaceFeature',data.data.faceImg)
-		},
-		mounted() {
-			console.log('mineConfig',this.mineConfig)
-		},
-		methods: {
-			//按钮点击事件
-			buttonClick(item) {
-				if (item.buttonType === 'page') {
-					if (item.route === 'mineWarningRecording') {//预警记录
-						uni.navigateTo({
-							url: item.routeUrl,
-						});
-					}
-					if (item.route === 'laboratory') {//我的实验室
-						uni.navigateTo({
-							url: item.routeUrl,
-						});
-					}
-					if (item.route === 'PlanExecuteRecord') {//预案执行记录
-						uni.navigateTo({
-							url: item.routeUrl,
-						});
-					}
-					if (item.route === 'faceImage') {//身份验证
-						uni.navigateTo({
-							url: item.routeUrl,
-						});
-					}	
-					
-				} else if (item.buttonType === 'button') {
-					
-				} else if (item.buttonType === 'none') {
-					uni.showToast({
-						title: '暂未开放',
-						icon: "none",
-						mask: true,
-						duration: 2000
-					});
-				}
-			},
-		},
-	}
-</script>
-
-<style lang="stylus" scoped>
-	.mineConfigurationSlot {
-		margin: 0;
-		background: #fff;
-		padding: 0 20rpx;
-		margin-top: 30rpx;
-		.button-for-box:last-of-type{
-			.button-max-box{
-				border:none !important;
-			}
-		}
-		.button-max-box {
-			height: 100rpx;
-			display flex;
-			border-bottom: 1px solid #e0e0e0;
-			.left-img {
-				height: 30rpx;
-				width: 30rpx;
-				margin: 34rpx 44rpx 0 0;
-			}
-
-			view {
-				line-height: 100rpx;
-			}
-
-			view:nth-child(2) {
-				flex: 1;
-				color: #333333;
-				font-size: 30rpx;
-			}
-
-			.right-img {
-				height: 24rpx;
-				width: 12rpx;
-				margin: 39rpx 0 0 0;
-			}
-
-			.colorA {
-				color: #E45656 !important;
-			}
-
-			.marginType {
-				margin-right: 12rpx;
-			}
-
-			.view-three-one {
-				width: 30rpx;
-				height: 30rpx;
-				text-align center;
-				background #FF4552;
-				border-radius: 50%;
-				font-size: 20rpx;
-				line-height: 30rpx;
-				color: #fff;
-				margin: 36rpx 20rpx;
-			}
-
-			.view-three-two {
-				width: 30rpx;
-				height: 30rpx;
-				text-align center;
-				border-radius: 50%;
-				font-size: 20rpx;
-				line-height: 30rpx;
-				color: #999;
-				margin: 36rpx 20rpx;
-
-			}
-
-			.view-three-type {
-				width: 120rpx;
-				text-align center;
-				color: #CCCCCC;
-				font-size: 26rpx;
-			}
-		}
-	}
-</style>

+ 0 - 149
component/tabBar.vue

@@ -1,149 +0,0 @@
-<!-- 底部导航组件 -->
-<template>
-	<view class="tabBar" :style="{'padding-bottom': paddingBottomHeight + 'rpx'}">
-		<view class="tab-bar-box">
-			<view class="null-box"></view>
-			<view class="tba-bar-min-box" @click="tabBarGoPage(1)">
-				<img src="@/images/basicsModules/btn_sy_xz.png" v-if="currentRoute == 'pages/home'">
-				<img src="@/images/basicsModules/btn_sy_zc.png" v-else>
-				<view :class="currentRoute == 'pages/home'?'primary':''">首页</view>
-			</view>
-			<view class="null-box"></view>
-			<view class="tba-bar-min-box" @click="tabBarGoPage(2)">
-				<img src="@/images/basicsModules/btn_xx_xz.png" v-if="currentRoute == 'pages/information/information'">
-				<img src="@/images/basicsModules/btn_xx_zc.png" v-else>
-				<view class="tip" v-if="totalCount!=0">{{totalCount}}</view>
-				<view :class="currentRoute == 'pages/information/information'?'primary':''">消息</view>
-			</view>
-			<view class="null-box"></view>
-			<view class="tba-bar-min-box" @click="tabBarGoPage(3)">
-				<img src="@/images/basicsModules/btn_wd_xz.png" v-if="currentRoute == 'pages/mine'">
-				<img src="@/images/basicsModules/btn_wd_zc.png" v-else>
-				<view :class="currentRoute == 'pages/mine'?'primary':''">我的</view>
-			</view>
-			<view class="null-box"></view>
-		</view>
-	</view>
-</template>
-
-<script>
- import { infoTotalCount } from '@/api/apiDemo/index.js'
-	export default {
-		data() {
-			return {
-				paddingBottomHeight: 0,  //苹果X以上手机底部适配高度
-				currentRoute:"",
-				userType:"",
-				totalCount:0,
-			}
-		},
-		created() {
-			let that = this;
-			uni.getSystemInfo({
-			    success: function (res) {
-			        let model = ['X', 'XR', 'XS', '11', '12', '13', '14', '15'];
-			        model.forEach(item => {
-			            //适配iphoneX以上的底部,给tabbar一定高度的padding-bottom
-			            if(res.model.indexOf(item) != -1 && res.model.indexOf('iPhone') != -1) {
-			                that.paddingBottomHeight = 40;
-			            }
-			        })
-			    }
-			});
-		},
-
-		onShow(){
-			this.getTotalList();
-		},
-		mounted(){
-
-			this.getTotalList();
-			this.totalCount=uni.getStorageSync('totalCount')
-            // 获取当前路由
-            let pages = getCurrentPages();
-            let page = pages[pages.length - 1];
-            this.currentRoute = page.route;
-            // 获取当前角色
-			this.userType = uni.getStorageSync('userType');
-		},
-		methods: {
-			//获取消息总数接口
-			async getTotalList(){
-				const {data} = await infoTotalCount();
-				if(data.code==200){
-					this.totalCount=data.data.totalCount
-				}
-
-			},
-            tabBarGoPage(type){
-                if(type === 1){
-                    if (this.currentRoute !== 'pages/home/home') {
-                        uni.redirectTo({
-                            url: '/pages/home/home',
-                        });
-                    }
-				}else if(type === 2){
-                    if (this.currentRoute !== 'pages/information/information') {
-                        uni.redirectTo({
-                            url: '/pages/information/information',
-                        });
-                    }
-                }else if(type === 3){
-                    if (this.currentRoute !== 'pages/mine/mine') {
-                        uni.redirectTo({
-                            url: '/pages/mine/mine',
-                        });
-                    }
-                }
-
-			},
-		}
-	}
-</script>
-
-<style lang="stylus" scoped>
-	.tabBar{
-		z-index:9999;
-		width:100%;
-		height:98rpx;
-		background:#ffffff;
-		position fixed
-		bottom:0;
-		left:0;
-		box-shadow: 0 -3rpx 13rpx 0 rgba(0, 0, 0, 0.1);
-		.tab-bar-box{
-			display flex;
-			.null-box{
-				flex:1;
-			}
-			.tba-bar-min-box{
-				width:64rpx;
-				position :relative;
-				img{
-					width:44rpx;
-					height:44rpx;
-					margin:14rpx auto 0;
-				}
-				view{
-					line-height:37rpx;
-					font-size:19rpx;
-					text-align center;
-					color:#666666;
-				}
-				.tip{
-					display inline-block;
-					background :#EF0909;
-					border-radius 50%;
-					position :absolute;
-					font-size 24rpx;
-					line-height 24rpx;
-					color #fff;
-					top :10rpx;
-					left :44rpx;
-					padding:6rpx 10rpx;
-					box-sizing border-box;
-				}
-			}
-		}
-	}
-</style>

+ 26 - 1
manifest.json

@@ -72,5 +72,30 @@
     },
     "uniStatistics" : {
         "enable" : false
-    }
+    },
+	"h5" : {
+		"router" : {
+			"mode" : "hash" // 路由模式
+		},
+		"devServer" : {
+			"https" : false, // 是否启用 https 协议,默认false
+			"port": 8080, // 端口号
+			"disableHostCheck": true, // 禁用 Host 检查,默认false
+			"proxy": { // 与vue中的proxyTable配置大致上一致,此处我同时代理了两个
+				"/dev": { // 测试
+					"target": "http://xxx.xxx.x.xxx:xxxx", // 目标接口域名
+					"changeOrigin": true, // 是否跨域
+					"secure": false, // 设置支持https协议的代理
+					"pathRewrite":{"^/dev":""} // 这个一定要加,意思就是把你项目中一dev开头的接口自动替换为 target + pathRewrite第二个参数来进行数据的请求(pathRewrite没有第二个参数的话直接为target)
+				},
+				"/pre": { // 预发布
+					"target": "http://xxx.xxx.x.xxx", // 目标接口域名
+					"changeOrigin": true, // 是否跨域
+					"secure": false, // 设置支持https协议的代理
+					"pathRewrite":{"^/pre":"/api"} // 此处pathRewrite加第二个参数是因为我的接口最后都有一个/api,在这个地方加/api等价于直接在target后加/api
+				}
+			}
+		}
+	}
+
 }

+ 1 - 1
pages/home/home.vue

@@ -10,7 +10,7 @@
 import { manageHome } from '@/pages/home/manageWorkbench'
 import { userHome } from '@/pages/home/studentWorkbench.vue'
 import { supplierHome } from '@/pages/home/supplierWorkbench.vue'
-import { tabBar } from '@/component/tabBar.vue'
+import { tabBar } from '@/components/tabBar.vue'
 export default {
   name: "home",
   components: {

+ 3 - 3
pages/home/manageWorkbench.vue

@@ -65,7 +65,7 @@
   import {getSafeWarnList, laboratoryAppletSubList,
     systemAppletLayoutSelect,laboratoryAppletGetSubDetailInfo
   } from '@/api/basicsModules/index.js'
-  import {tabBar} from '@/component/tabBar.vue'
+  import {tabBar} from '@/components/tabBar.vue'
   import {topWarn} from '@/component/topWarn.vue'
   import {navBar} from '@/component/navbar.vue'
   import {homeConfigurationSlot} from '@/component/homeConfigurationSlot'
@@ -116,7 +116,7 @@
       }
     },
     created() {
-		
+
     },
     mounted() {
       this.systemAppletLayoutSelect();
@@ -174,7 +174,7 @@
 	  },
     },
     beforeDestroy() {
-     
+
     }
   }
 </script>

+ 9 - 9
pages/home/studentWorkbench.vue

@@ -1,11 +1,11 @@
 <!-- 学生端工作台 -->
 <template>
   <view class="user-workbench" :style="{paddingTop:navHeight+'rpx'}">
-	<nav-bar :title="title"></nav-bar>  
+	<nav-bar :title="title"></nav-bar>
     <img class="top-big-img" :src="homepageBanner">
-	
+
     <homeConfigurationSlot v-for="(item,index) in homeConfigData" :key="index" :homeConfig="item"></homeConfigurationSlot>
-   
+
 	<view class="big-icon-button-box">
       <view class="left-box">
         <img class="left-top-img" @click="goNull" src="@/images/basicsModules/img_bg_cjcx.png">
@@ -35,7 +35,7 @@
 
 <script>
 import { myViolationCount,queryMyCert,outSubjectPhoto,gradingControl,getGentleIdentifier,systemAppletLayoutSelect} from '@/api/basicsModules/index.js'
-import { tabBar } from '@/component/tabBar.vue'
+import { tabBar } from '@/components/tabBar.vue'
 import { navBar } from '@/component/navbar.vue'
 import { homeConfigurationSlot } from '@/component/homeConfigurationSlot'
 import { getHomeConfig } from '@/utils/homeConfig'
@@ -49,7 +49,7 @@ export default {
     return {
 		homeConfigData: [],
 		navHeight: uni.getStorageSync('navHeight'),
-	    title:'实验室安全智能监测与控制系统',		
+	    title:'实验室安全智能监测与控制系统',
 		hintType:false,
 		dataList:[],
 		violationData:{},
@@ -61,7 +61,7 @@ export default {
 
   },
   mounted(){
-	this.systemAppletLayoutSelect();  
+	this.systemAppletLayoutSelect();
     this.myViolationCount();
     this.getGrading();
 
@@ -78,7 +78,7 @@ export default {
 			  }
 			  this.$set(this,'homeConfigData',getHomeConfig(list));
 			}
-	},  
+	},
     //获取分级管控未完成总数
     async getGrading(){
       let obj = {
@@ -175,7 +175,7 @@ export default {
         // uni.navigateTo({
         //   url: '/pages_manage/workbench/problemRectification/rectifyList',//安全检查
         // });
-		
+
       }else if(type == 'gas'){//气瓶管理
         uni.navigateTo({
           url: '/pages_student/gasManage/gasManage',
@@ -241,7 +241,7 @@ export default {
 		const {data} = await getGentleIdentifier();
 		if(data.code==200){
 			let pageType = null
-		  // 如果是管理员 检查者和整改者 
+		  // 如果是管理员 检查者和整改者
 		  if(data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && data.data.rectifyGentle){
 			  pageType=1
 		  }else if(data.data.adminGentle && (data.data.applyGentle || data.data.myApplyGentle) && !data.data.rectifyGentle){

+ 5 - 5
pages/information/information.vue

@@ -21,7 +21,7 @@
 
 <script>
     import {systemNoticeGetNoticeList } from '@/api/basicsModules/index.js'
-    import { tabBar } from '@/component/tabBar.vue'
+    import { tabBar } from '@/components/tabBar.vue'
 	export default {
         components: {
             tabBar
@@ -40,7 +40,7 @@
 
 		},
 		onShow(){
-            
+
 		},
 		mounted() {
 			this.getList();
@@ -56,9 +56,9 @@
 							self.queryParams.page += 1;
 							self.getList();
 						},1000)
-	
+
 				}
-	
+
 			},
             //获取列表数据
             async getList(){
@@ -67,7 +67,7 @@
                 if(data.code==200){
 					this.dataList=[...this.dataList,...data.data.records]
 					this.total=data.data.total;
-				}   
+				}
             },
             formatDate(date) {
                 let newDate = new Date(date);

+ 2 - 79
pages/login/login.vue

@@ -27,10 +27,6 @@
         <view>记住我</view>
       </view>
       <view class="button-box" @click="login">登录</view>
-      <view class="supplier" v-if="curTab==1">
-        <view class="supplier_l" @click="handleClick('forget')">忘记密码</view>
-        <view class="supplier_r" @click="handleClick('register')">没有账号,<text>立即注册</text></view>
-      </view>
     </view>
   </view>
 </template>
@@ -62,7 +58,7 @@ export default {
       checkedType: false,
       loginBanner: uni.getStorageSync('loginBanner'),
       infoList: [], //模板消息Id
-      tabText: ['师生登录', '供应商登录'],
+      tabText: ['师生登录'],
       curTab: 0,
       pageType: 0,
       supplierType: false,
@@ -153,59 +149,6 @@ export default {
         uni.setStorageSync('permissions', data.data.data)
       }
     },
-    //获取用户身份标识"adminGentle": false,
-    //管理员身份 "rectifyGentle": false,
-    //整改身份"applyGentle": false    检查者身份
-    async getGentleIdentifier() {
-      let self = this;
-      const {
-        data
-      } = await getGentleIdentifier();
-      if (data.code == 200) {
-        uni.setStorageSync('gentleIdentifierData', data.data)
-        let list = [];
-        if (data.data.adminGentle || data.data.collegeGentle) { //校级管理员
-          list.push({
-            name: '管理员',
-            pageType: 1
-          })
-        }
-        if (data.data.applyGentle || data.data.myApplyGentle) {
-          list.push({
-            name: '检查者',
-            pageType: 2
-          })
-        }
-        if (data.data.rectifyGentle) {
-          list.push({
-            name: '整改者',
-            pageType: 3
-          })
-        }
-        if (!data.data.adminGentle && !data.data.applyGentle && !data.data.myApplyGentle && !data.data.applyGentle &&
-            !data.data.collegeGentle) {
-          self.pageType = 'mine'
-          list.push({
-            name: '暂无权限',
-            pageType: 'mine'
-          })
-        }
-        uni.setStorageSync('gentleIdentifier', list)
-        if (uni.getStorageSync('saoCode')) {
-          uni.redirectTo({
-            url: '/pages/saoCode/saoCode'
-          });
-        } else if (self.pageType == 'mine') {
-          uni.redirectTo({
-            url: '/pages/mine/mine',
-          });
-        } else {
-          uni.redirectTo({
-            url: '/pages/home/home',
-          });
-        }
-      }
-    },
     switchClick() {
       if (this.identityStatus == 1) {
         this.identityStatus = 2;
@@ -268,23 +211,7 @@ export default {
     checkboxChange() {
       this.checkedType = !this.checkedType;
     },
-    //点击事件
-    handleClick(doType) {
-      if (doType == 'register') { //供应商注册
-        uni.redirectTo({
-          url: '/pages_supplier/register/register?pageStatus=0'
-        });
-      } else if (doType == 'forget') { //忘记密码
-        uni.showModal({
-          showCancel: false,
-          confirmColor: '#0183FA',
-          content: '请您联系学校相关管理人员申请重置密码',
-          success: function(res) {
-            if (res.confirm) {}
-          }
-        });
-      }
-    },
+    
   },
 
 }
@@ -323,10 +250,6 @@ export default {
       top: 50rpx;
       justify-content: center;
 
-      >view:nth-of-type(1) {
-        margin-right: 100rpx;
-      }
-
       .tabTitle_li {
         width: 168rpx;
         text-align center;

+ 16 - 12
pages/mine/mine.vue

@@ -62,9 +62,8 @@
       </view>
 
     </view>
-
-    <mineConfigurationSlot v-for="(item,index) in mineConfigData" :key="index" :mineConfig="item">
-    </mineConfigurationSlot>
+    <mine-Configuration-Slot v-for="(item,index) in mineConfigData" :key="item.id" :mineConfig="item">
+    </mine-Configuration-Slot>
     <view class="out-button" @click="clickOut">退出登录</view>
     <tab-bar></tab-bar>
   </view>
@@ -85,22 +84,27 @@ import {
   fingerprintQueryList,
   systemAppletLayoutSelect
 } from '@/api/basicsModules/index.js'
-import {
-  tabBar
-} from '@/component/tabBar.vue'
+//#ifdef MP-WEIXIN
+import { tabBar} from '@/components/tabBar.vue'
+import {mineConfigurationSlot} from '@/components/mineConfigurationSlot'
+//#endif
 
-import {
-  mineConfigurationSlot
-} from '@/component/mineConfigurationSlot'
-import {
-  getMineConfig
-} from '@/utils/mineConfig'
+import { getMineConfig} from '@/utils/mineConfig'
 
 export default {
+  name:'mine',
+//#ifdef MP-WEIXIN
   components: {
     tabBar,
     mineConfigurationSlot,
   },
+//#endif
+//#ifdef H5
+  components: {
+  	"tabBar": () => import('@/components/tabBar.vue'),
+  	"mineConfigurationSlot": () => import('@/components/mineConfigurationSlot.vue'),
+  },
+//#endif
   data() {
     return {
       mineConfigData: [],

+ 1 - 1
pages_safetyExamine/safetyExamineWorkbench.vue

@@ -224,7 +224,7 @@
 
 <script>
 import { config } from '@/api/request/config.js'
-import { tabBar } from '@/component/tabBar.vue'
+import { tabBar } from '@/components/tabBar.vue'
 import {checkPlanList,getCheckStatusCount,getManageStatusCount,dataStatistics,checkManageList,checkHazardAppList,checkClapList,getCheckPlanBySubId} from '@/api/apiDemo/index.js'
 export default {
   name: "rectifyList",

+ 6 - 2
utils/mineConfig.js

@@ -1,5 +1,6 @@
 let routeDataList = [
-	{
+	{	
+		id:'1',
 		name: "预警记录",
 		limits:"",
 		route: "mineWarningRecording",
@@ -7,7 +8,8 @@ let routeDataList = [
 		img: require('@/images/basicsModules/icon_003.png'),
 		buttonType:"page",
 	},
-	{
+	{	
+		id:'2',
 		name: "我的实验室",
 		limits:"",
 		route: "laboratory",
@@ -16,6 +18,7 @@ let routeDataList = [
 		buttonType:"page",
 	},
 	{
+		id:'3',
 		name: "预案执行记录",
 		limits:"",
 		route: "PlanExecuteRecord",
@@ -24,6 +27,7 @@ let routeDataList = [
 		buttonType:"page",
 	},
 	{
+		id:'4',
 		name: "身份验证",
 		limits:"",
 		route: "faceImage",