From 4de4baa6eea8f80160f6cdc8a4ebd17c0c48f0ee Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Fri, 17 Oct 2025 16:43:12 +0800
Subject: [PATCH] feat:提交代碼

---
 src/pages/login/index.vue                      |    4 ++--
 src/subPackages/taskDetail/execution/index.vue |   12 ++++++++++--
 src/static/images/tabbar/add-task.svg          |   10 ++++++++++
 src/subPackages/taskDetail/addTask/index.vue   |   18 +++++++++++++++++-
 src/pages/inspectionTask/index.vue             |   11 ++++++++++-
 5 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/src/pages/inspectionTask/index.vue b/src/pages/inspectionTask/index.vue
index fd5bad2..30211dc 100644
--- a/src/pages/inspectionTask/index.vue
+++ b/src/pages/inspectionTask/index.vue
@@ -1,11 +1,12 @@
 <!-- 巡检任务 -->
 <template>
-  <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage"/>
+  <WebViewPlus v-if="isApp" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
 </template>
 
 <script setup>
 import { getWebViewUrl } from "@/utils/index.js";
 import WebViewPlus from "@/components/WebViewPlus.vue";
+import {onHide, onShow} from "@dcloudio/uni-app";
 
 const viewUrl = getWebViewUrl('/inspectionTask')
 
@@ -22,6 +23,14 @@
     }
   }
 }
+const isApp = ref(false)
+onShow(() => {
+  isApp.value = true
+});
+
+onHide(() => {
+  isApp.value = false
+});
 
 </script>
 <style scoped lang="scss">
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index 0d2e5e2..9f75363 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -29,8 +29,8 @@
 import { HOME_PATH, LOGIN_PATH, removeQueryString } from "@/router";
 const userStore = useUserStore();
 const loginForm = ref({
-  username: "shuishen",
-  password: "Dashabi....",
+  username: "cpz3",
+  password: "cpz3@2025",
 });
 const inputStyle = computed(() => {
   const style = {};
diff --git a/src/static/images/tabbar/add-task.svg b/src/static/images/tabbar/add-task.svg
new file mode 100644
index 0000000..94465b9
--- /dev/null
+++ b/src/static/images/tabbar/add-task.svg
@@ -0,0 +1,10 @@
+<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="Group 1321316217">
+<g id="&#229;&#155;&#190;&#230;&#160;&#135;">
+<circle id="bg" cx="28" cy="28" r="25.5" fill="#1D6FE9" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
+</g>
+<g id="Frame">
+<path id="Vector" d="M29.051 17.3062C29.1972 17.3062 29.3373 17.3642 29.4407 17.4675C29.544 17.5709 29.6021 17.711 29.6021 17.8572V26.6735H38.4184C38.5645 26.6735 38.7047 26.7316 38.808 26.8349C38.9114 26.9382 38.9694 27.0784 38.9694 27.2245V28.3266C38.9694 28.4727 38.9114 28.6129 38.808 28.7162C38.7047 28.8195 38.5645 28.8776 38.4184 28.8776H29.6021V37.6939C29.6021 37.84 29.544 37.9802 29.4407 38.0835C29.3373 38.1869 29.1972 38.2449 29.051 38.2449H27.949C27.8029 38.2449 27.6627 38.1869 27.5594 38.0835C27.456 37.9802 27.398 37.84 27.398 37.6939V28.8776H18.5817C18.4355 28.8776 18.2954 28.8195 18.192 28.7162C18.0887 28.6129 18.0306 28.4727 18.0306 28.3266V27.2245C18.0306 27.0784 18.0887 26.9382 18.192 26.8349C18.2954 26.7316 18.4355 26.6735 18.5817 26.6735H27.398V17.8572C27.398 17.711 27.456 17.5709 27.5594 17.4675C27.6627 17.3642 27.8029 17.3062 27.949 17.3062H29.051Z" fill="white" stroke="white" stroke-width="0.4"/>
+</g>
+</g>
+</svg>
diff --git a/src/subPackages/taskDetail/addTask/index.vue b/src/subPackages/taskDetail/addTask/index.vue
index 1adc183..5dfea79 100644
--- a/src/subPackages/taskDetail/addTask/index.vue
+++ b/src/subPackages/taskDetail/addTask/index.vue
@@ -1,14 +1,30 @@
 <!-- 新建任务 -->
 <template>
-  <WebViewPlus :src="`${viewUrl}`"/>
+  <WebViewPlus v-if="isApp" :src="`${viewUrl}`" @webMessage="onPostMessage"/>
 </template>
 
 <script setup>
 import WebViewPlus from "@/components/WebViewPlus.vue";
 
 import {getWebViewUrl} from "@/utils/index.js";
+import {onHide, onShow} from "@dcloudio/uni-app";
 
 const viewUrl = ref(getWebViewUrl('/addTask'))
+function onPostMessage(data) {
+  if (data.type === 'submitSuccess'){
+    uni.switchTab({
+      url: '/pages/inspectionTask/index'
+    });
+  }
+}
+const isApp = ref(false)
+onShow(() => {
+  isApp.value = true
+});
+
+onHide(() => {
+  isApp.value = false
+});
 </script>
 
 <style lang="scss" scoped></style>
diff --git a/src/subPackages/taskDetail/execution/index.vue b/src/subPackages/taskDetail/execution/index.vue
index 957529d..09234ef 100644
--- a/src/subPackages/taskDetail/execution/index.vue
+++ b/src/subPackages/taskDetail/execution/index.vue
@@ -1,10 +1,10 @@
 <!-- 已执行 -->
 <template>
-  <WebViewPlus :src="`${viewUrl}`"/>
+  <WebViewPlus v-if="isApp" :src="`${viewUrl}`"/>
 </template>
 
 <script setup>
-import {onLoad} from "@dcloudio/uni-app";
+import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
 import WebViewPlus from "@/components/WebViewPlus.vue";
 import {getWebViewUrl} from "@/utils/index.js";
 
@@ -19,6 +19,14 @@
 //     });
 //   }
 // }
+const isApp = ref(false)
+onShow(() => {
+  isApp.value = true
+});
+
+onHide(() => {
+  isApp.value = false
+});
 </script>
 
 <style lang="scss" scoped></style>

--
Gitblit v1.9.3