From 297a9312da294d8069e4e79ae97346786164b523 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Fri, 24 Apr 2026 18:14:52 +0800
Subject: [PATCH] feat: 更新文档,删除无用注释

---
 src/pages/map/index.vue                         |   12 --
 src/subPackages/taskDetail/execution/index.vue  |   13 ---
 src/subPackages/inspectionTask/taskDetails.vue  |    3 
 src/subPackages/droneConsole/index.vue          |    5 -
 src/subPackages/taskDetail/addTask/index.vue    |   11 --
 src/subPackages/userDetail/password/index.vue   |    6 -
 README.md                                       |  102 +++++++++++++++++++++++++
 src/pages/user/index.vue                        |    2 
 src/subPackages/taskDetail/inProgress/index.vue |    2 
 src/subPackages/workDetail/mapWork/index.vue    |   16 ---
 src/subPackages/workDetail/addWork/index.vue    |   14 ---
 src/subPackages/qrCode/index.vue                |   14 ---
 src/pages/work/index.vue                        |   15 ---
 13 files changed, 106 insertions(+), 109 deletions(-)

diff --git a/README.md b/README.md
index 5adcafd..0a1af3b 100644
--- a/README.md
+++ b/README.md
@@ -19,10 +19,112 @@
 /software/service/drone/web/drone-app
 正式
 /app/service/drone/web/drone-app
+
 # app更新步骤
 
 修改 /src/config 里面的development的参数,改为对应环境的对应变量
 
+# 小程序app更新步骤
+
+1. 修改 /src/config 里面的development的参数,改为对应环境的对应变量
+2. hbuild里面点击运行 =》到小程序 =》自动打开了小程序 =》 
+3. 调试好=》上传 =》[微信公众号](https://mp.weixin.qq.com/) =》 提交审核
+
+# 开发者文档
+
+
+
+- 本项目大量采用webview方式开发,只有登录页是原生的uniapp,其他的都是webview
+- 登录了之后在userStore里面存了用户信息(包括token)
+- 每个页面都会走WebViewPlus组件
+- WebViewPlus里面有个属性src都会走getWebViewUrl方法
+- WebViewPlus会监听webview发送给app的消息,统一处理
+- getWebViewUrl方法里面 会把 路径自动拼接上userInfo(包括token)和一些其他参数
+
+- 然后到webview这里的 permission.js会去自动接收这些参数并存储到stroe里面
+
+webview跟app通信
+
+h5或app的webview
+
+```
+webview
+const transmitData = { data: { type: 'submitSuccess', fun: 'add' } }
+uni.postMessage(transmitData)
+
+app 接收到了
+ uni.setStorageSync("joinParams", {
+      type: "add",
+    });
+uni.switchTab({
+      url: `/pages/work/index?addLog=111`,
+});
+```
+
+微信小程序的webview
+
+
+
+```
+webview
+const transmitData = { data: { type: 'submitSuccess', fun: 'add' } }
+wx.miniProgram.switchTab({ url: `/pages/work/index?addLog=111` })
+wx.miniProgram.postMessage(transmitData)
+
+app 接收到了
+uni.setStorageSync("joinParams", {
+        type: "add",
+      });
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 
 
diff --git a/src/pages/map/index.vue b/src/pages/map/index.vue
index 09ceb5a..7c44236 100644
--- a/src/pages/map/index.vue
+++ b/src/pages/map/index.vue
@@ -1,13 +1,4 @@
-<!--
- * @Author       : yuan
- * @Date         : 2025-12-03 14:20:57
- * @LastEditors  : yuan
- * @LastEditTime : 2025-12-20 16:49:02
- * @FilePath     : \src\pages\map\index.vue
- * @Description  :
- * Copyright 2025 OBKoro1, All Rights Reserved.
- * 2025-12-03 14:20:57
--->
+
 <template>
   <view class="page-wrap">
     <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage" />
@@ -19,7 +10,6 @@
 import WebViewPlus from "@/components/WebViewPlus.vue";
 import { onHide, onShow } from "@dcloudio/uni-app";
 import {getUserInfo} from "@/api/user/index.js";
-// const viewUrl = getWebViewUrl("/defaultMap");
 
 let envParam = "";
 // #ifdef WEB
diff --git a/src/pages/user/index.vue b/src/pages/user/index.vue
index f06fd48..5a80afb 100644
--- a/src/pages/user/index.vue
+++ b/src/pages/user/index.vue
@@ -53,12 +53,10 @@
 <script setup>
 import { getAssetsImage } from "@/utils/index.js";
 import { getUserInfo } from "@/api/user/index.js";
-import { useClipboard } from "@/hooks";
 import { useUserStore } from "@/store/index.js";
 import { onShow } from "@dcloudio/uni-app";
 import { getDeviceRegionApi } from "@/api/map.js";
 
-const { setClipboardData, getClipboardData } = useClipboard();
 
 const rightImage = getAssetsImage("/images/user/rightBtn.png");
 const logoImage = getAssetsImage("/images/user/logo1.png");
diff --git a/src/pages/work/index.vue b/src/pages/work/index.vue
index ac51a5f..7d982e1 100644
--- a/src/pages/work/index.vue
+++ b/src/pages/work/index.vue
@@ -1,13 +1,3 @@
-<!--
- * @Author       : yuan
- * @Date         : 2025-12-18 10:06:30
- * @LastEditors  : yuan
- * @LastEditTime : 2025-12-20 14:18:42
- * @FilePath     : \src\pages\work\index.vue
- * @Description  :
- * Copyright 2025 OBKoro1, All Rights Reserved.
- * 2025-12-18 10:06:30
--->
 <template>
   <view class="eventTickets">
     <WebViewPlus
@@ -21,11 +11,9 @@
 <script setup>
 import { getWebViewUrl } from "@/utils/index.js";
 import WebViewPlus from "@/components/WebViewPlus.vue";
-import { useTabAddButton } from "@/hooks/index.js";
 import { onShow, onHide } from "@dcloudio/uni-app";
 
 const sWebViewRef = ref(null);
-// const viewUrl = getWebViewUrl('/work', {})
 const updateKey = ref(0);
 const viewUrl = computed(() => {
   // #ifdef MP-WEIXIN
@@ -65,7 +53,6 @@
   }
   // #endif
 }
-const isApp = ref(false);
 onShow(() => {
   const joinParams = uni.getStorageSync("joinParams");
   if (joinParams) {
@@ -86,11 +73,9 @@
   });
   // #endif
 
-  // isApp.value = true
 });
 
 onHide(() => {
-  // isApp.value = false
 });
 </script>
 
diff --git a/src/subPackages/droneConsole/index.vue b/src/subPackages/droneConsole/index.vue
index a947943..033ecf1 100644
--- a/src/subPackages/droneConsole/index.vue
+++ b/src/subPackages/droneConsole/index.vue
@@ -6,8 +6,6 @@
 import {onHide, onLoad, onShow} from "@dcloudio/uni-app";
 import WebViewPlus from "@/components/WebViewPlus.vue";
 import {getEnvObj, getWebViewUrl} from "@/utils/index.js";
-import Recorder from "js-audio-recorder";
-import dayjs from "dayjs";
 import {useUserStore} from "@/store/index.js";
 
 const queryParams = ref({})
@@ -18,9 +16,6 @@
 
 function onPostMessage(data) {
   if (data.type === 'back'){
-    // uni.navigateTo({
-    //   url: `/subPackages/inProgress/index?wayLineJobInfoId=${data.taskDetails.id}`
-    // });
     // #ifdef H5
     window.history.back()
     // #endif
diff --git a/src/subPackages/inspectionTask/taskDetails.vue b/src/subPackages/inspectionTask/taskDetails.vue
index f623b08..a18e604 100644
--- a/src/subPackages/inspectionTask/taskDetails.vue
+++ b/src/subPackages/inspectionTask/taskDetails.vue
@@ -26,7 +26,6 @@
 
 <script setup>
 
-import {onHide, onShow} from "@dcloudio/uni-app";
 import {useUserStore} from "@/store/index.js";
 const active = defineModel('active')
 const sWebViewRef = ref(null)
@@ -36,8 +35,6 @@
 
 import {onLoad} from "@dcloudio/uni-app";
 
-// const active = defineModel('active')
-// console.log(active.value, '555')
 function onPostMessage(event) {
   if (event.detail.data[0].type === 'back'){
     active.value = null
diff --git a/src/subPackages/qrCode/index.vue b/src/subPackages/qrCode/index.vue
index b8a10a7..feeb5f5 100644
--- a/src/subPackages/qrCode/index.vue
+++ b/src/subPackages/qrCode/index.vue
@@ -1,13 +1,3 @@
-<!--
- * @Author       : yuan
- * @Date         : 2025-10-14 17:43:52
- * @LastEditors  : yuan
- * @LastEditTime : 2025-12-19 15:33:48
- * @FilePath     : \src\subPackages\qrCode\index.vue
- * @Description  : 
- * Copyright 2025 OBKoro1, All Rights Reserved. 
- * 2025-10-14 17:43:52
--->
 <template>
   <view class="page-wrap">
     <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage" />
@@ -22,10 +12,6 @@
 
 const onPostMessage = (data) => {
   if (data.type === "browser") {
-    // #ifdef MP-WEIXIN
-
-    // #endif
-
     // #ifndef MP-WEIXIN
     uni.navigateTo({
       url:
diff --git a/src/subPackages/taskDetail/addTask/index.vue b/src/subPackages/taskDetail/addTask/index.vue
index f175785..c2a8f72 100644
--- a/src/subPackages/taskDetail/addTask/index.vue
+++ b/src/subPackages/taskDetail/addTask/index.vue
@@ -9,8 +9,6 @@
 import { getWebViewUrl } from "@/utils/index.js";
 import { onHide, onLoad, onShow } from "@dcloudio/uni-app";
 
-// const viewUrl = ref(getWebViewUrl('/addTask'))
-const sWebViewRef = ref(null);
 const viewUrl = ref("");
 
 function onPostMessage(data) {
@@ -27,23 +25,14 @@
     uni.setStorageSync("joinParams", {
       type: "add",
     });
-    // console.log('打印新增成功')
     uni.switchTab({
       url: "/pages/inspectionTask/index",
     });
     // #endif
 
-    // uni.redirectTo({
-    //   url: `/pages/inspectionTask/index?addLog=1111`
-    // });
   }
 }
 
-// onLoad( (options) => {
-//   console.log(options, '8888')
-//   const sns = options.device_sn
-//
-// });
 const isApp = ref(false);
 
 // #ifdef MP-WEIXIN
diff --git a/src/subPackages/taskDetail/execution/index.vue b/src/subPackages/taskDetail/execution/index.vue
index 8a11578..201e281 100644
--- a/src/subPackages/taskDetail/execution/index.vue
+++ b/src/subPackages/taskDetail/execution/index.vue
@@ -10,17 +10,7 @@
 
 const wayLineJobInfoId = ref(null)
 const viewUrl = ref('')
-// const viewUrl = ref(getWebViewUrl('/execution'))
 
-// function onPostMessage(data) {
-//   console.log(data, '9999')
-//   if (data.type === 'taskDetails'){
-//     console.log('4444')
-//     uni.switchTab({
-//       url: '/subPackages/taskDetail/execution/index'
-//     });
-//   }
-// }
 function onPostMessage(data) {
   if (data.type === 'back') {
     uni.switchTab({
@@ -47,8 +37,7 @@
 });
 
 onHide(() => {
-  // 如果工单详情返回任务详情,那么tab栏对应的是关联事件一项
-  // isApp.value = false
+
 });
 </script>
 
diff --git a/src/subPackages/taskDetail/inProgress/index.vue b/src/subPackages/taskDetail/inProgress/index.vue
index 5e1dd5c..e6ce928 100644
--- a/src/subPackages/taskDetail/inProgress/index.vue
+++ b/src/subPackages/taskDetail/inProgress/index.vue
@@ -16,8 +16,6 @@
 const viewUrl = ref("");
 const showComponent = ref(false);
 function onPostMessage(data) {
-  // #ifdef MP-WEIXIN
-  // #endif
 
   // #ifndef MP-WEIXIN
   if (data.type === "back") {
diff --git a/src/subPackages/userDetail/password/index.vue b/src/subPackages/userDetail/password/index.vue
index 387d854..dd51f58 100644
--- a/src/subPackages/userDetail/password/index.vue
+++ b/src/subPackages/userDetail/password/index.vue
@@ -71,12 +71,6 @@
 			});
 			return false;
 		}
-		// const hasLetter = /[a-zA-Z]/.test(password);
-		// const hasNumber = /\d/.test(password);
-		// if (!hasLetter || !hasNumber) {
-		//   ElMessage.error('密码需同时包含字母和数字');
-		//   return false;
-		// }
 		return true;
 	};
 	const clearForm = () => {
diff --git a/src/subPackages/workDetail/addWork/index.vue b/src/subPackages/workDetail/addWork/index.vue
index 6d9b4a0..ce9e0c7 100644
--- a/src/subPackages/workDetail/addWork/index.vue
+++ b/src/subPackages/workDetail/addWork/index.vue
@@ -1,13 +1,4 @@
-<!--
- * @Author       : yuan
- * @Date         : 2025-11-13 18:14:52
- * @LastEditors  : yuan
- * @LastEditTime : 2025-12-20 16:56:27
- * @FilePath     : \src\subPackages\workDetail\addWork\index.vue
- * @Description  : 
- * Copyright 2025 OBKoro1, All Rights Reserved. 
- * 2025-11-13 18:14:52
--->
+
 <template>
   <view>
     <WebViewPlus
@@ -38,9 +29,6 @@
     uni.setStorageSync("joinParams", {
       type: "add",
     });
-    // uni.switchTab({
-    //   url: '/pages/work/index'
-    // });
     uni.switchTab({
       url: `/pages/work/index?addLog=111`,
     });
diff --git a/src/subPackages/workDetail/mapWork/index.vue b/src/subPackages/workDetail/mapWork/index.vue
index f00d642..6f2f4a9 100644
--- a/src/subPackages/workDetail/mapWork/index.vue
+++ b/src/subPackages/workDetail/mapWork/index.vue
@@ -1,13 +1,4 @@
-<!--
- * @Author       : yuan
- * @Date         : 2025-10-22 14:59:10
- * @LastEditors  : yuan
- * @LastEditTime : 2025-12-19 14:52:54
- * @FilePath     : \src\subPackages\workDetail\mapWork\index.vue
- * @Description  : 
- * Copyright 2025 OBKoro1, All Rights Reserved. 
- * 2025-10-22 14:59:10
--->
+
 <!-- 地图展示 -->
 <template>
   <WebViewPlus
@@ -29,14 +20,9 @@
   viewUrl.value = getWebViewUrl("/mapWork", { currentItem: currentItem });
 });
 function onPostMessage(data) {
-  // #ifdef MP-WEIXIN
-  // #endif
 
   // #ifndef MP-WEIXIN
   if (data.type === "workDetailback") {
-    // uni.navigateTo({
-    //   url: '/subPackages/workDetail/index'
-    // });
     uni.navigateBack({
       delta: 1,
     });

--
Gitblit v1.9.3