dedsudiyu 1 개월 전
부모
커밋
c3c97b1cc4
5개의 변경된 파일499개의 추가작업 그리고 39개의 파일을 삭제
  1. 2 2
      api/request/config.js
  2. 6 0
      pages.json
  3. 18 18
      pages/views/pupilPage/pupilHome.vue
  4. 19 19
      pages/views/teacherPage/teacherHome.vue
  5. 454 0
      pages_basics/views/chemicalsInfo/chemicalsInfo.vue

+ 2 - 2
api/request/config.js

@@ -2,7 +2,7 @@ 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',//刘波
@@ -22,7 +22,7 @@ const config = {
 	// base_url: 'https://lab.zjznai.com/api/', //暨大化材
 	// base_url: 'https://lab.zjznai.com/kdwclabSystem/', //矿大文昌地址
     //base_url: 'https://znyj.zjznai.suda.edu.cn/labSystem/', //苏大临时地址
-	base_url: 'https://labcontrol.nwafu.edu.cn/api/', //西北农林
+	// base_url: 'https://labcontrol.nwafu.edu.cn/api/', //西北农林
 	// base_url: 'http://172.16.0.65/api/', //西北农林
 	//base_url: 'https://lab.zjznai.com/labapp/', //43测试
 	// base_url: 'https://metersphere.zjznai.com/labSystem/', //中国海关

+ 6 - 0
pages.json

@@ -291,6 +291,12 @@
 					"style": {
 						"navigationBarTitleText": "电子签名"
 					}
+				},
+				{
+					"path": "views/chemicalsInfo/chemicalsInfo",
+					"style": {
+						"navigationBarTitleText": "化学品信息"
+					}
 				}
 			]
 		},

+ 18 - 18
pages/views/pupilPage/pupilHome.vue

@@ -159,25 +159,25 @@
 				uni.scanCode({
 					onlyFromCamera: true,
 					success: function(res) {
-						let list = res.result.split("?")[1].split("&");
-						let codeData = {};
-						list.forEach((item) => {
-							codeData[item.split("=")[0]] = item.split("=")[1];
-						})
-						if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
-							5 || codeData.type == 7 ||
-							codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
-							codeData.type == 11 || codeData.type == 12 || codeData.type == 13 || codeData.type == 14) {
+						if(res.result.indexOf('type') != -1){
+							//项目二维码
+							let list = res.result.split("?")[1].split("&");
+							let codeData = {};
+							list.forEach((item) => {
+								codeData[item.split("=")[0]] = item.split("=")[1];
+							})
+							if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
+								5 || codeData.type == 7 ||
+								codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
+								codeData.type == 11 || codeData.type == 12 || codeData.type == 13 || codeData.type == 14) {
+								uni.navigateTo({
+									url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
+								});
+							}
+						}else{
+							//化学品信息
 							uni.navigateTo({
-								url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
-							});
-						} else {
-							uni.showToast({
-								mask: true,
-								icon: "none",
-								position: "center",
-								title: '请扫描正确的小程序二维码',
-								duration: 2000
+								url: "/pages_basics/views/chemicalsInfo/chemicalsInfo",
 							});
 						}
 					}

+ 19 - 19
pages/views/teacherPage/teacherHome.vue

@@ -227,25 +227,25 @@
 				uni.scanCode({
 					onlyFromCamera: true,
 					success: function(res) {
-						let list = res.result.split("?")[1].split("&");
-						let codeData = {};
-						list.forEach((item) => {
-							codeData[item.split("=")[0]] = item.split("=")[1];
-						})
-						if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
-							5 || codeData.type == 7 ||
-							codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
-							codeData.type == 11 || codeData.type == 12 || codeData.type == 13 || codeData.type == 14) {
-							uni.reLaunch({
-								url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
-							});
-						} else {
-							uni.showToast({
-								mask: true,
-								icon: "none",
-								position: "center",
-								title: '请扫描正确的小程序二维码',
-								duration: 2000
+						if(res.result.indexOf('type') != -1){
+							//项目二维码
+							let list = res.result.split("?")[1].split("&");
+							let codeData = {};
+							list.forEach((item) => {
+								codeData[item.split("=")[0]] = item.split("=")[1];
+							})
+							if (codeData.type == 1 || codeData.type == 2 || codeData.type == 3 || codeData.type ==
+								5 || codeData.type == 7 ||
+								codeData.type == 8 || codeData.type == 9 || codeData.type == 10 ||
+								codeData.type == 11 || codeData.type == 12 || codeData.type == 13 || codeData.type == 14) {
+								uni.reLaunch({
+									url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
+								});
+							}
+						}else{
+							//化学品信息
+							uni.navigateTo({
+								url: "/pages_basics/views/chemicalsInfo/chemicalsInfo",
 							});
 						}
 					}

+ 454 - 0
pages_basics/views/chemicalsInfo/chemicalsInfo.vue

@@ -0,0 +1,454 @@
+<!-- 化学品信息(扫码进入) -->
+<template>
+	<view id="chemicalsInfo">
+		<view class="info-data-box">
+			<img class="logo-img" :src="circularLogo">
+			<view class="title-box">
+				<view class="title-one-box">
+					<view>{{newData.data1}}</view>
+					<view>{{newData.data2?'管控':'非管控'}}</view>
+					<view>{{newData.data3}}</view>
+				</view>
+				<view class="title-two-box">编号:{{newData.data4}}</view>
+				<view class="title-three-box">余量:{{newData.data5}}</view>
+			</view>
+		</view>
+		<view class="table-button-max-box">
+			<view class="table-button-box" @click='tableButtonCheck(1)'
+			:class="pageType==1?'checkClass':''">
+				<view>基本信息</view>
+				<view></view>
+			</view>
+			<view class="table-button-box" @click='tableButtonCheck(2)'
+			:class="pageType==2?'checkClass':''">
+				<view>使用记录</view>
+				<view></view>
+			</view>
+		</view>
+		<!-- 基础信息 -->
+		<view class="info-max-big-box" v-if="pageType == 1">
+			<view class="info-big-box">
+				<view class="info-box">
+					<view>C A S</view>
+					<view>:</view>
+					<view>{{newData.data6}}</view>
+				</view>
+				<view class="info-box">
+					<view>别名</view>
+					<view>:</view>
+					<view>{{newData.data7}}</view>
+				</view>
+				<view class="info-box">
+					<view>类别</view>
+					<view>:</view>
+					<view>{{newData.data8}}</view>
+				</view>
+				<view class="info-box">
+					<view>规格</view>
+					<view>:</view>
+					<view>{{newData.data9}}</view>
+				</view>
+				<view class="info-box">
+					<view>归属人</view>
+					<view>:</view>
+					<view>{{newData.data10}}</view>
+				</view>
+				<view class="info-box">
+					<view style="width:120rpx;">存储位置</view>
+					<view>:</view>
+					<view>{{newData.data11}}</view>
+				</view>
+			</view>
+			<view class="info-big-box">
+				<view class="info-box">
+					<view>学院</view>
+					<view>:</view>
+					<view>{{newData.data12}}</view>
+				</view>
+				<view class="info-box">
+					<view>楼栋</view>
+					<view>:</view>
+					<view>{{newData.data13}}</view>
+				</view>
+				<view class="info-box">
+					<view>实验室</view>
+					<view>:</view>
+					<view>{{newData.data14}}</view>
+				</view>
+			</view>
+		</view>
+		<!-- 使用记录 -->
+		<scroll-view class="info-list-box" v-if="pageType == 2" scroll-y @scrolltolower="scrollGet">
+			<view class="for-max-big-box" v-for="(item,index) in dataList" :key="index">
+				<view class="for-title-box">
+					<view class="time-box">{{item.for0}}</view>
+					<view class="position-top-right" :class="item.for9?'colorA':'colorB'">{{item.for9?'领用':'归还'}}</view>
+					<view class="border-box"></view>
+					<view class="position-left"></view>
+					<view class="position-right"></view>
+				</view>
+				<view class="for-info-box" v-if="item.for9">
+					<view class="for-info-min-box">
+						<view>领用人</view>
+						<view>:</view>
+						<view>{{item.for1}}</view>
+					</view>
+					<view class="for-info-min-box">
+						<view>领用量</view>
+						<view>:</view>
+						<view>{{item.for2}}</view>
+					</view>
+					<view class="for-info-min-box">
+						<view style="width:120rpx;">双人认证</view>
+						<view>:</view>
+						<view>{{item.for3}}</view>
+					</view>
+				</view>
+				<view class="for-info-box" v-if="!item.for9">
+					<view class="for-info-min-box">
+						<view>归还人</view>
+						<view>:</view>
+						<view>{{item.for4}}</view>
+					</view>
+					<view class="for-info-min-box">
+						<view>使用量</view>
+						<view>:</view>
+						<view>{{item.for5}}</view>
+					</view>
+					<view class="for-info-min-box">
+						<view>余量</view>
+						<view>:</view>
+						<view>{{item.for6}}</view>
+					</view>
+					<view class="for-info-min-box">
+						<view style="width:120rpx;">双人认证</view>
+						<view>:</view>
+						<view>{{item.for7}}</view>
+					</view>
+				</view>
+			</view>
+			<view class="null-box" v-if="!dataList[0]">
+				<img :src="imagesUrl('commonality/chemicalsInfoNull.png')">
+				<view>暂无数据</view>
+			</view>
+			<view class="get-null-box">仅展示最近三个月使用记录</view>
+			<view class="get-null-box" v-if="getDataType">暂无更多数据</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				circularLogo: uni.getStorageSync('circularLogo'),
+				newData:{
+					data1:'化学品名称',
+					data2:'1',
+					data3:'使用中',
+					data4:'123456789',
+					data5:'450ml',
+					data6:'123456789',
+					data7:'别名名称',
+					data8:'普通危化品',
+					data9:'450ml/瓶',
+					data10:'课题组',
+					data11:'化学品柜-柜门-柜层',
+					data12:'学院名称',
+					data13:'校区-楼栋',
+					data14:'实验室名称-(房间号)',
+				},
+				pageType:1,
+				//使用记录 相关
+				queryParams: {
+					page: 1,
+					pageSize: 10,
+				},
+				total: 0,
+				dataList: [
+					{
+						for0:'2024-03-03  10:33',
+						for1:'黄老师',
+						for2:'300ml',
+						for3:'李腾腾  杨森',
+						for4:'黄老师',
+						for5:'300ml',
+						for6:'100ml',
+						for7:'李腾腾  杨森',
+						for9:true,
+					},
+					{
+						for0:'2024-03-03  10:33',
+						for1:'黄老师',
+						for2:'300ml',
+						for3:'李腾腾  杨森',
+						for4:'黄老师',
+						for5:'300ml',
+						for6:'100ml',
+						for7:'李腾腾  杨森',
+						for9:false,
+					},
+				],
+				getDataType: false,
+			}
+		},
+		onLoad(option) {
+			
+		},
+		onShow() {
+			
+		},
+		methods: {
+			tableButtonCheck(type){
+				if(this.pageType != type){
+					this.$set(this,'pageType',type);
+				}
+			},
+			//滚动事件
+			scrollGet() {
+				let self = this;
+				if (self.total / self.queryParams.pageSize <= self.queryParams.page) {
+					this.$set(this, 'getDataType', true);
+				} else {
+					this.queryParams.page += 1;
+					this.$nextTick(() => {
+						this.getList();
+					})
+				}
+			},
+			getList(){
+				// let self = this;
+				// const {
+				// 	data
+				// } = await systemNoticeGetNoticeList(this.queryParams);
+				// if (data.code == 200) {
+				// 	if (self.queryParams.page == 1) {
+				// 		this.$set(this,'dataList',data.data.records);
+				// 		this.$set(this,'total',data.data.total);
+				// 		if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
+				// 			this.$set(this, 'getDataType', true);
+				// 		}
+				// 	} else {
+				// 		this.$set(this,'dataList',[...this.dataList, ...data.data.records]);
+				// 		this.$set(this,'total',data.data.total);
+				// 		if (data.data.total / self.queryParams.pageSize <= self.queryParams.page) {
+				// 			this.$set(this, 'getDataType', true);
+				// 		}
+				// 	}
+				// }
+			},
+		},
+	}
+</script>
+
+
+<style lang="stylus" scoped>
+	#chemicalsInfo {
+		height: 100%;
+		display flex;
+		flex-direction: column;
+		.info-data-box{
+			display: flex;
+			background-color: #fff;
+			.logo-img{
+				width:120rpx;
+				height:120rpx;
+				display: inline-block;
+				margin:40rpx 40rpx 40rpx 30rpx;
+			}
+			.title-box{
+				.title-one-box{
+					display: flex;
+					view:nth-child(1){
+						font-size:30rpx;
+						color:#333;
+					}
+					view:nth-child(2){
+						
+					}
+					view:nth-child(3){
+						
+					}
+				}
+				.title-two-box{
+					
+				}
+				.title-three-box{
+					
+				}
+			}
+		}
+		.table-button-max-box{
+			display: flex;
+			height:100rpx;
+			.table-button-box{
+				height:75rpx;
+				width:120rpx;
+				margin:25rpx 30rpx 0 30rpx;
+				view:nth-child(1){
+					font-size:30rpx;
+					line-height:50rpx;
+					height:50rpx;
+				}
+			}
+			.checkClass{
+				view:nth-child(1){
+					color:#0183FA;
+				}
+				view:nth-child(2){
+					height:4rpx;
+					width:90rpx;
+					margin:0 15rpx;
+					background-color:#0183FA;
+				}
+			}
+		}
+		.info-max-big-box{
+			margin:0 30rpx 0;
+			.info-big-box{
+				background-color:#fff;
+				margin-bottom:20rpx;
+				border-radius:20rpx;
+				.info-box:nth-child(1){
+					border-top:none;
+				}
+				.info-box{
+					display: flex;
+					border-top:1rpx solid #E0E0E0;
+					margin:0 30rpx;
+					view{
+						height:80rpx;
+						line-height:80rpx;
+						font-size:28rpx;
+						color:#333;
+					}
+					view:nth-child(1){
+						width:90rpx;
+						text-align: justify;
+						word-break: break-all;
+						text-align-last: justify;
+					}
+					view:nth-child(2){
+						margin-left:5rpx;
+					}
+					view:nth-child(3){
+						flex:1;
+						text-align: right
+					}
+				}
+			}
+		}
+		.info-list-box{
+			flex: 1;
+			overflow: scroll;
+			.for-max-big-box{
+				background-color: #fff;
+				margin:0 30rpx 20rpx 30rpx;
+				border-radius:10rpx;
+				.for-title-box{
+					height:118rpx;
+					position: relative;
+					overflow: hidden;
+					.time-box{
+						height:100rpx;
+						line-height:93rpx;
+						font-size:28rpx;
+						color:#333;
+						padding-left:30rpx;
+					}
+					.position-top-right{
+						position: absolute;
+						top:0;
+						right:0;
+						width:100rpx;
+						height:36rpx;
+						line-height:36rpx;
+						font-size:24rpx;
+						text-align: center;
+						border-radius: 0rpx 10rpx 0rpx 6rpx;
+					}
+					.colorA{
+						color:#0183FA;
+						background: rgba(1,131,250,0.2);
+					}
+					.colorB{
+						color:#07BC11;
+						background: rgba(7,188,17,0.2);
+					}
+					.border-box{
+						border-top:1rpx dashed #F5F5F5;
+						height:18rpx;
+					}
+					.position-left{
+						width:30rpx;
+						height:30rpx;
+						z-index:1;
+						position:absolute;
+						bottom:3rpx;
+						left:-15rpx;
+						background-color: #F5F5F5;
+						border-radius:50%;
+					}
+					.position-right{
+						width:30rpx;
+						height:30rpx;
+						z-index:1;
+						position:absolute;
+						bottom:3rpx;
+						right:-15rpx;
+						background-color: #F5F5F5;
+						border-radius:50%;
+						
+					}
+				}
+				.for-info-box{
+					.for-info-min-box{
+						display: flex;
+						padding:0 30rpx;
+						view{
+							height:80rpx;
+							line-height:80rpx;
+							font-size:28rpx;
+							color:#333;
+						}
+						view:nth-child(1){
+							width:90rpx;
+							text-align: justify;
+							word-break: break-all;
+							text-align-last: justify;
+						}
+						view:nth-child(2){
+							margin-left:5rpx;
+						}
+						view:nth-child(3){
+							flex:1;
+							text-align: right
+						}
+					}
+				}
+			}
+			.null-box{
+				img{
+					width:300rpx;
+					height:300rpx;
+					margin:150rpx 225rpx 0;
+					display: inline-block;
+				}
+				view{
+					color:#999;
+					font-size:28rpx;
+					line-height:40rpx;
+					text-align: center;
+					margin-top:15rpx;
+				}
+			}
+			.get-null-box {
+				height: 100rpx;
+				line-height: 100rpx;
+				color: #999;
+				text-align center
+				padding-bottom:200rpx;
+			}
+		}
+	}
+</style>