From e43f55f7b264e5ecdf8e2c63c5b3a443ea9958dd Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Mon, 20 Oct 2025 09:41:23 +0800
Subject: [PATCH] feat:添加图片

---
 src/subPackages/workDetail/index.vue |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/src/subPackages/workDetail/index.vue b/src/subPackages/workDetail/index.vue
index cb02317..d9d4852 100644
--- a/src/subPackages/workDetail/index.vue
+++ b/src/subPackages/workDetail/index.vue
@@ -1,21 +1,38 @@
 <!-- 工单详情 - 包含待审核、待处理、处理中、已完成 -->
 <template>
 	<div class="workDetailContainer">
-		 <web-view ref="sWebViewRef" :src="`${viewUrl}`" />
+		 <WebViewPlus v-if="isApp" ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
 	</div>
 </template>
 
 <script setup>
+		import {getWebViewUrl} from "@/utils/index.js";
 	import { onLoad } from '@dcloudio/uni-app';
 	import { useUserStore } from '@/store/index.js'
 	const userStore = useUserStore()
 	const userInfo = userStore.userInfo
 	const sWebViewRef = ref(null);
-	const viewUrl = ref(`http://192.168.1.157:5173/drone-app-web-view/#/webViewWrapper/workDetail?params=${JSON.stringify(userStore?.userInfo)}`);
+	const viewUrl = ref('')
 	onLoad( (options) => {
-		const eventNum= options.eventNum;
+		const eventNum= options.eventNum;	
+		viewUrl.value = getWebViewUrl('/workDetail', {eventNum:eventNum})	
+	});
+	
+	function onPostMessage(data) {
+	  if (data.type === 'workback'){
 		
-		viewUrl.value =`http://192.168.1.157:5173/drone-app-web-view/#/webViewWrapper/workDetail?params=${JSON.stringify(userStore?.userInfo)}&eventNum=${eventNum}`
+	    uni.switchTab({
+	      url: '/pages/work/index'
+	    });
+	  }
+	}
+	const isApp = ref(false)
+	onShow(() => {
+	  isApp.value = true
+	});
+	
+	onHide(() => {
+	  isApp.value = false
 	});
 </script>
 

--
Gitblit v1.9.3