From 5d2a0677a6d25e6934faec08aff8339af93e3387 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 15 Oct 2025 09:39:33 +0800
Subject: [PATCH] feat:提交代码
---
src/subPackages/taskDetail/execution/index.vue | 37 ++++++------------
src/pages/inspectionTask/index.vue | 37 ++++++------------
2 files changed, 26 insertions(+), 48 deletions(-)
diff --git a/src/pages/inspectionTask/index.vue b/src/pages/inspectionTask/index.vue
index 50efff3..205d449 100644
--- a/src/pages/inspectionTask/index.vue
+++ b/src/pages/inspectionTask/index.vue
@@ -1,34 +1,23 @@
<!-- 巡检任务 -->
<template>
- <web-view ref="sWebViewRef" :src="`${viewUrl}`" />
+ <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage"/>
</template>
<script setup>
-import { useUserStore } from "@/store/index.js";
+import { getWebViewUrl } from "@/utils/index.js";
+import WebViewPlus from "@/components/WebViewPlus.vue";
-const sWebViewRef = ref(null);
-const userStore = useUserStore();
-const viewUrl = `http://192.168.1.15:5174/drone-app-web-view/#/webViewWrapper/inspectionTask?params=${JSON.stringify(userStore?.userInfo)}`;
+const viewUrl = getWebViewUrl('/inspectionTask')
+
+function onPostMessage(data) {
+ if (data.type === 'taskDetails'){
+ uni.navigateTo({
+ url: '/subPackages/taskDetail/execution/index'
+ });
+ }
+}
+
</script>
<style scoped lang="scss">
</style>
-
-
-<!--<template>-->
-<!-- <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage"/>-->
-<!--</template>-->
-
-<!--<script setup>-->
-<!--import {useUserStore} from "@/store/index.js";-->
-<!--import WebViewPlus from "@/components/WebViewPlus.vue";-->
-
-<!--const userStore = useUserStore();-->
-<!--const viewUrl = `http://192.168.1.15:5174/drone-app-web-view/#/appTaskDetails?params=${JSON.stringify(userStore?.userInfo)}`;-->
-<!--function onPostMessage(data) {-->
-<!-- console.log(data)-->
-<!--}-->
-<!--</script>-->
-<!--<style scoped lang="scss">-->
-
-<!--</style>-->
diff --git a/src/subPackages/taskDetail/execution/index.vue b/src/subPackages/taskDetail/execution/index.vue
index 034aa96..957529d 100644
--- a/src/subPackages/taskDetail/execution/index.vue
+++ b/src/subPackages/taskDetail/execution/index.vue
@@ -1,35 +1,24 @@
<!-- 已执行 -->
<template>
- <web-view ref="sWebViewRef" :src="`${viewUrl}`" @message="onPostMessage" @onPostMessage="onPostMessage" />
+ <WebViewPlus :src="`${viewUrl}`"/>
</template>
<script setup>
import {onLoad} from "@dcloudio/uni-app";
-import {useUserStore} from "@/store/index.js";
+import WebViewPlus from "@/components/WebViewPlus.vue";
+import {getWebViewUrl} from "@/utils/index.js";
-const sWebViewRef = ref(null);
-const userStore = useUserStore();
-let viewUrl = ''
+const viewUrl = ref(getWebViewUrl('/execution'))
-function onPostMessage(event) {
- if (event.detail.data[0].type === 'back') {
- // active.value = null
- }
-}
-
-// onLoad(() => {
-// window.addEventListener('message', function (e) {
-// if (e.data.data.type === 'back') {
-// // active.value = null
-// }
-// });
-// })
-
-onLoad((options) => {
- // console.log('options1111111', JSON.parse(decodeURIComponent(options)));
- const id=3333
- viewUrl = `http://192.168.1.178:5173/drone-app-web-view/#/webViewWrapper/execution?rowItem=${id}`;
-});
+// function onPostMessage(data) {
+// console.log(data, '9999')
+// if (data.type === 'taskDetails'){
+// console.log('4444')
+// uni.switchTab({
+// url: '/subPackages/taskDetail/execution/index'
+// });
+// }
+// }
</script>
<style lang="scss" scoped></style>
--
Gitblit v1.9.3