dedsudiyu il y a 10 mois
Parent
commit
3802dbf56b

+ 2 - 2
api/request/config.js

@@ -1,7 +1,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.9:8080',//柴
+	// 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',//小飞

+ 2 - 0
pages/component/topWarn.vue

@@ -175,11 +175,13 @@
 		onHide() {
 			//清除定时器
 			let self = this;
+			console.log('onHide')
 			self.offPlanMQTT();
 		},
 		beforeDestroy() {
 			//清除定时器
 			let self = this;
+			console.log('beforeDestroy')
 			self.offPlanMQTT();
 		},
 	}

+ 26 - 1
pages/views/home/home.vue

@@ -2,6 +2,7 @@
 	<view id="home">
 		<teacherHome class="flex-box-page" v-if="userType==1"></teacherHome>
 		<pupilHome class="flex-box-page" v-if="userType==2"></pupilHome>
+		<img class="scan_btn" @click.stop="saoCode" src="@/pages_safetyExamine/images/icon_xyxc_sm.png" />
 	</view>
 </template>
 <script>
@@ -38,7 +39,23 @@
 			}
 		},
 		methods: {
-
+			/* 扫一扫*/
+			saoCode() {
+				let self = this;
+				uni.scanCode({
+					onlyFromCamera: true,
+					success: function(res) {
+						console.log('res',res)
+						console.log('res.result',res.result)
+						// uni.navigateTo({
+						// 	url: '/pages/views/saoCode/saoCode?q=' + res.result
+						// });
+						uni.navigateTo({
+							url: '/pages/views/saoCode/saoCode?q=' + encodeURIComponent(res.result)
+						});
+					}
+				});
+			},
 		},
 		onHide() {
 			this.userType = 0;
@@ -59,5 +76,13 @@
 			display: flex;
 			flex-direction: column;
 		}
+		.scan_btn {
+			z-index:10;
+			position: fixed;
+			bottom: 210rpx;
+			right: 0rpx;
+			width: 130rpx;
+			height: 130rpx;
+		}
 	}
 </style>

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

@@ -25,6 +25,7 @@
 			}
 		},
 		onLoad(option) {
+			console.log('option',option)
 			let self = this;
 			if (option.q) {
 				let text = decodeURIComponent(option.q)
@@ -100,7 +101,7 @@
 						this.$set(this, 'webViewType', true);
 					} else if (codeData.type == 5) {
 						//实验室详情
-						this.laboratoryAppletGetSubDetailInfo(codeData.infoId);
+						this.laboratoryAppletGetSubDetailInfo(codeData.code);
 					} else if (codeData.type == 10) {
 						uni.showToast({
 							mask: true,