李程龙 3 лет назад
Родитель
Сommit
552bbe47dc
3 измененных файлов с 50 добавлено и 7 удалено
  1. 9 0
      pages.json
  2. 14 7
      pages/pest/discern.vue
  3. 27 0
      pages/pest/expert.vue

+ 9 - 0
pages.json

@@ -151,6 +151,15 @@
             }
             }
             
             
         }
         }
+        ,{
+            "path" : "pages/pest/expert",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "专家指导",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
     ],
 	"globalStyle": {
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTextStyle": "black",

+ 14 - 7
pages/pest/discern.vue

@@ -29,8 +29,8 @@
 			</view>
 			</view>
 		</view>
 		</view>
 
 
-		<view class="btn-box">
-			<button class="btn">专家指导</button>
+		<view class="btn-box" v-if="token">
+			<button class="btn" @click="openExpert">专家指导</button>
 		</view>
 		</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -43,12 +43,19 @@
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
-
+				token: ''
 			};
 			};
 		},
 		},
+		onLoad(options) {
+			this.token = options.token;
+			console.log(this.token);
+		},
 		methods: {
 		methods: {
-
-
+			openExpert(e) {
+				uni.navigateTo({
+					url: `expert?token=${this.token}`
+				})
+			},
 			/**
 			/**
 			 * 开始识别
 			 * 开始识别
 			 * @param {String} type 识别类型  insect:虫害,plant:病害
 			 * @param {String} type 识别类型  insect:虫害,plant:病害
@@ -75,9 +82,9 @@
 				this.openDiscernResult(result);
 				this.openDiscernResult(result);
 			},
 			},
 			// 打开识别结果
 			// 打开识别结果
-			openDiscernResult(item){
+			openDiscernResult(item) {
 				uni.navigateTo({
 				uni.navigateTo({
-					url:`discern-result?params=${JSON.stringify(item)}`
+					url: `discern-result?params=${JSON.stringify(item)}`
 				})
 				})
 			},
 			},
 			uploadImageSync() {
 			uploadImageSync() {

+ 27 - 0
pages/pest/expert.vue

@@ -0,0 +1,27 @@
+<template>
+	<view style="width: 100%;height: 100vh;">
+		<iframe :src="url" width="100%" height="100%" frameborder="0"></iframe>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				baseUrl:'http://103.89.185.161:3010/',
+				url:''
+			}
+		},
+		onLoad(options) {
+			let token=options.token;
+			this.url= `${this.baseUrl}#/start?token=${token}&code=zhwd`;
+		},
+		methods: {
+
+		}
+	}
+</script>
+
+<style>
+
+</style>