heyang 2 vuotta sitten
vanhempi
commit
41bd9cdcfe

+ 9 - 0
App.vue

@@ -1,8 +1,13 @@
 <script>
+	import {systemInfo} from '@/component/system-info.js'
     import $mqtt from '@/utils/mqtt.min.js';
     import { config } from '@/api/request/config.js'
 	export default {
 		onLaunch: function() {
+			/* 获取设备信息 */
+			const SystemInfomations = systemInfo()
+			this.navHeight = SystemInfomations.navHeight + SystemInfomations.statusBarHeight //头部导航栏总高度
+			uni.setStorageSync('navHeight', this.navHeight)
 			//获取openid
 			uni.login({
 				success(loginRes) {
@@ -70,6 +75,10 @@
 			mqttOnlineData:{},//设备是否在线
 			mqttPerformData:{},//是否正在执行灭火操作
         },
+		created() {
+			
+			
+		},
         methods: {
 			//删除报警监听
 			delWarnData(){

+ 2 - 2
api/request/config.js

@@ -9,9 +9,9 @@ const config = {
 	// base_url: 'https://demo.sxitdlc.com/xzgd/',
 
 	// base_url: 'https://lab.sxitdlc.com/labNhSystem/',//43服务器高升测试
-	base_url: 'https://lab.sxitdlc.com/labAppTest/',//43服务器线上
+	//base_url: 'https://lab.sxitdlc.com/labAppTest/',//43服务器线上
     // base_url: 'https://lab.sxitdlc.com/appTest/',//88服务器线上
-	// base_url: 'https://lab.sxitdlc.com/labSystem/', //矿大地址
+	 base_url: 'https://lab.sxitdlc.com/labSystem/', //矿大地址
       // base_url: 'https://lab.sxitdlc.com/labSaasSystem/', //矿大化工
 	// base_url: 'https://lab.sxitdlc.com/jdlabSystem/', //交大地址
     // base_url: 'https://lab.sxitdlc.com/jndxlabSystem/', //暨大地址

+ 0 - 175
component/compress.vue

@@ -1,175 +0,0 @@
-<template>
-	<view class="compress">
-		<canvas :style="{ width: canvasSize.width,height: canvasSize.height}" canvas-id="myCanvas"></canvas>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				pic:'',
-				canvasSize: {
-					width: 0,
-					height: 0
-				}
-			}
-		},
-		methods: {
-			// 压缩
-			compress(params) {
-				return new Promise(async (resolve, reject) => {
-					// 等待图片信息
-					let info = await this.getImageInfo(params.src).then(info=>info).catch(err=>err);
-					
-					if(!info){
-						reject('获取图片信息异常');
-						return;
-					}
-					
-					// 设置最大 & 最小 尺寸
-					const maxSize = params.maxSize || 1080;
-					const minSize = params.minSize || 640;
-					
-					// 当前图片尺寸
-					let {width,height} = info;
-					
-					// 非 H5 平台进行最小尺寸校验
-					// #ifndef H5
-					if(width <= minSize && height <= minSize){
-						resolve(params.src);
-						return;
-					}
-					// #endif
-					
-					// 最大尺寸计算
-					if (width > maxSize || height > maxSize) {
-						if (width > height) {
-							height = Math.floor(height / (width / maxSize));
-							width = maxSize;
-						} else {
-							width = Math.floor(width / (height / maxSize));
-							height = maxSize;
-						}
-					}
-
-					// 设置画布尺寸
-					this.$set(this,"canvasSize",{
-						width: `${width}rpx`,
-						height: `${height}rpx`
-					});
-					
-					// Vue.nextTick 回调在 App 有异常,则使用 setTimeout 等待DOM更新
-					setTimeout(() => {
-						const ctx = uni.createCanvasContext('myCanvas', this);
-						ctx.clearRect(0,0,width, height)
-						ctx.drawImage(info.path, 0, 0, uni.upx2px(width), uni.upx2px(height));
-						ctx.draw(false, () => {
-							uni.canvasToTempFilePath({
-								x: 0,
-								y: 0,
-								width: uni.upx2px(width),
-								height: uni.upx2px(height),
-								destWidth: width,
-								destHeight: height,
-								canvasId: 'myCanvas',
-								fileType: params.fileType || 'png',
-								quality: params.quality || 0.9,
-								success: (res) => {
-									// 在H5平台下,tempFilePath 为 base64
-									resolve(res.tempFilePath);
-								},
-								fail:(err)=>{
-									reject(null);
-								}
-							},this);
-						});
-					}, 300);
-				});
-			},
-			// 获取图片信息
-			getImageInfo(src){
-				return new Promise((resolve, reject)=>{
-					uni.getImageInfo({
-						src,
-						success: (info)=> {
-							resolve(info);
-						},
-						fail: () => {
-							reject(null);
-						}
-					});
-				});
-			},
-			// 批量压缩
-			batchCompress(params){
-				// index:进度,done:成功,fail:失败
-				let [index,done,fail] = [0,0,0];
-				// 压缩完成的路径集合
-				let paths = [];
-				// 批量压缩方法
-				let batch = ()=>{
-					return new Promise((resolve, reject)=>{
-						// 开始
-						let start = async ()=>{
-							params.progress && params.progress({
-								done,
-								fail,
-								count:params.batchSrc.length
-							});
-							// 等待图片压缩方法返回
-							let path = await next();
-							if(path){
-								done++;
-								paths.push(path);
-							}else{
-								fail++;
-							}
-							
-							index++;
-							// 压缩完成
-							if(index >= params.batchSrc.length){
-								resolve(true);
-							}else{
-								start();
-							}
-						}
-						start();
-					});
-				}
-				// 依次调用压缩方法
-				let next = ()=>{
-					return this.compress({
-						src:params.batchSrc[index],
-						maxSize:params.maxSize,
-						fileType:params.fileType,
-						quality:params.quality,
-						minSize:params.minSize
-					})
-				}
-				
-				// 全部压缩完成后调用
-				return new Promise(async (resolve, reject)=>{
-					// 批量压缩方法回调
-					let res = await batch();
-					if(res){
-						resolve(paths);
-					}else{
-						reject(null);
-					}
-				});
-			}
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.compress{
-		position: fixed;
-		width: 12px;
-		height: 12px;
-		overflow: hidden;
-		top: -99999px;
-		left: 0;
-	}
-</style>

+ 2 - 4
pages.json

@@ -6,13 +6,11 @@
 			"style": {
 				"navigationBarTitleText": "实验室安全智能监测与控制系统",
 				"navigationBarTextStyle": "white", //导航文字颜色
-				"navigationBarBackgroundColor": "#0183FA" //导航背景色
+				"navigationBarBackgroundColor": "#0183FA" ,//导航背景色
+				"navigationStyle": "custom"
 			}
 		},
 
-
-
-
 		{
 			"path": "pages/supplierWorkbench",
 			"style": {

+ 8 - 2
pages/manageWorkbench.vue

@@ -1,6 +1,7 @@
 <!-- 管理端工作台 -->
 <template>
-  <view class="manage-workbench">
+  <view class="manage-workbench" :style="{paddingTop:navHeight+'rpx'}">
+	<nav-bar :title="title"></nav-bar>
     <img class="top-big-img" :src="homepageBanner">
     <top-warn></top-warn>
     <view class="min-icon-button-box" style="margin-bottom: 0;">
@@ -114,13 +115,17 @@ import { config } from '@/api/request/config.js'
 import { appReceivePhotoNote,getApprovalCount,subject_class,getSafeWarnList,laboratoryInfo,laboratoryList,getLoginUserInfo,outSubjectPhoto,gradingControl,listData} from '@/api/index.js'
 import { tabBar } from '@/component/tabBar.vue'
 import { topWarn } from '@/component/topWarn.vue'
+import { navBar } from '@/component/navbar.vue'
 export default {
   components: {
     tabBar,
-    topWarn
+    topWarn,
+	navBar
   },
   data() {
     return {
+	  navHeight: uni.getStorageSync('navHeight'),		
+	  title:'实验室安全智能监测与控制系统',
       //随手拍数量
       appReceivePhotoNoteNum:0,
       //准入数量
@@ -505,6 +510,7 @@ export default {
   height:100%;
   width:100%;
   overflow-y:scroll;
+  box-sizing: border-box;
   .top-big-img{
     height:342rpx;
     width:750rpx;

+ 13 - 7
pages/studentWorkbench.vue

@@ -1,6 +1,7 @@
 <!-- 学生端工作台 -->
 <template>
-  <view class="user-workbench">
+  <view class="user-workbench" :style="{paddingTop:navHeight+'rpx'}">
+	<nav-bar :title="title"></nav-bar>  
     <img class="top-big-img" :src="homepageBanner">
     <view class="min-icon-button-box">
       <view @click="goPage('casuallyPat')">
@@ -72,17 +73,21 @@
 <script>
 import { myViolationCount,queryMyCert,outSubjectPhoto,gradingControl} from '@/api/index.js'
 import { tabBar } from '@/component/tabBar.vue'
+import { navBar } from '@/component/navbar.vue'
 export default {
   components: {
-    tabBar
+    tabBar,
+	navBar
   },
   data() {
     return {
-      hintType:false,
-      dataList:[],
-      violationData:{},
-      gradingCount:0,
-      homepageBanner:uni.getStorageSync('homepageBanner'),
+		navHeight: uni.getStorageSync('navHeight'),
+	    title:'实验室安全智能监测与控制系统',		
+		hintType:false,
+		dataList:[],
+		violationData:{},
+		gradingCount:0,
+		homepageBanner:uni.getStorageSync('homepageBanner'),
     }
   },
   created() {
@@ -257,6 +262,7 @@ export default {
 .user-workbench{
   height:100%;
   flex:1;
+  box-sizing: border-box;
   .top-big-img{
     height:342rpx;
     width:750rpx;

+ 1 - 1
pages_student/workbench/photoInspection.vue

@@ -43,7 +43,7 @@
 </template>
 
 <script>
-	import helangCompress from '@/component/compress.vue';
+	import helangCompress from '../component/compress.vue';
     import { config } from '@/api/request/config.js'
     import { addPhotoInspection,outSubjectList } from '@/api/index.js'
     export default {