From 32febb140d320b35d580c8d4e78a80ef846e75fc Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 19 Dec 2025 15:59:34 +0800
Subject: [PATCH] feat:webview通信处理

---
 src/subPackages/workDetail/index.vue |  143 ++++++++---------------------------------------
 1 files changed, 26 insertions(+), 117 deletions(-)

diff --git a/src/subPackages/workDetail/index.vue b/src/subPackages/workDetail/index.vue
index cb02317..6fc8a4c 100644
--- a/src/subPackages/workDetail/index.vue
+++ b/src/subPackages/workDetail/index.vue
@@ -1,139 +1,48 @@
 <!-- 工单详情 - 包含待审核、待处理、处理中、已完成 -->
 <template>
 	<div class="workDetailContainer">
-		 <web-view ref="sWebViewRef" :src="`${viewUrl}`" />
+		 <WebViewPlus 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;
-		
-		viewUrl.value =`http://192.168.1.157:5173/drone-app-web-view/#/webViewWrapper/workDetail?params=${JSON.stringify(userStore?.userInfo)}&eventNum=${eventNum}`
+		viewUrl.value = getWebViewUrl('/workDetail', {eventNum:eventNum,totalNum:options.totalNum,keyword:options.keyword,aiType:options.aiType,wLJobInfoId:options.wLJobInfoId,status:options.status})
 	});
+
+	function onPostMessage(data) {
+
+	  if (data.type === 'workback'){
+      uni.setStorageSync('joinParams', {
+				type: 'add'
+			});
+	    uni.switchTab({
+			url: `/pages/work/index?addLog=111`
+	      // url: '/pages/work/index'
+	    });
+	  }else if(data.type === 'jumpMapNav'){
+		   uni.navigateTo({
+		    url:`/subPackages/workDetail/mapWork/index?currentItem=${data.eventNum}`
+		  });
+	  }
+	}
+
 </script>
 
 <style lang="scss" scoped>
 	.workDetailContainer {
-		padding: 0 10px;
+  width: 100%;
+	height: 100%;
+	background-size: cover;
 
-		.detailTop {
-			.image-container {
-				position: relative;
-				width: 100%;
-				height: 200px;
-
-				.detailImage {
-					width: 100%;
-					height: 100%;
-					display: block;
-					object-fit: cover
-				}
-
-				.detailTitle {
-					position: absolute;
-					left: 0;
-					bottom: 0;
-					width: 100%;
-				}
-
-				.titleText {
-					display: flex;
-					width: 100%;
-					justify-content: space-between;
-					align-items: center;
-				}
-			}
-		}
-
-		.stepContainer {
-			margin-top: 10px;
-			display: flex;
-			background-color: antiquewhite;
-			border-radius: 5px;
-			padding: 10px;
-
-			.horizontal-step {
-				display: flex;
-				align-items: center;
-				gap: 12px;
-
-				.step-title {
-					min-width: 60px;
-				}
-
-				.step-desc {
-					display: flex;
-					justify-content: space-between;
-					gap: 8px;
-					// color: #666;
-					font-size: 14px;
-				}
-			}
-
-		}
-
-
-		.actionButton {
-			display: flex;
-			justify-content: space-between;
-			margin-bottom: 10px;
-
-			.btngroups {
-				display: flex;
-				justify-content: space-between;
-
-				.u-button {
-					padding: 9px 20px;
-					height: 32px;
-
-					&:last-child {
-						margin-left: 12px;
-						margin-right: 12px;
-					}
-				}
-			}
-
-			.leftBtn {
-				width: 70px;
-				height: 32px;
-				background-color: #999;
-				border-radius: 5px;
-				text-align: center;
-				line-height: 32px;
-				color: #fff;
-				cursor: pointer;
-				opacity: 0.8;
-			}
-
-			.disableds {
-				background: #999 !important;
-				cursor: not-allowed !important;
-				pointer-events: none;
-				opacity: 0.3 !important;
-			}
-		}
-
-		.workOrderContent {
-			margin-top: 15px;
-
-			.workOrderContainer {
-				div {
-					margin-bottom: 10px;
-				}
-
-				.titketName {
-					display: flex;
-					align-items: center;
-				}
-			}
-		}
 
 	}
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3