| | |
| | | /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", |
| | | }); |
| | | ``` |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <!-- |
| | | * @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" /> |
| | |
| | | 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 |
| | |
| | | <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"); |
| | |
| | | <!-- |
| | | * @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 |
| | |
| | | <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 |
| | |
| | | } |
| | | // #endif |
| | | } |
| | | const isApp = ref(false); |
| | | onShow(() => { |
| | | const joinParams = uni.getStorageSync("joinParams"); |
| | | if (joinParams) { |
| | |
| | | }); |
| | | // #endif |
| | | |
| | | // isApp.value = true |
| | | }); |
| | | |
| | | onHide(() => { |
| | | // isApp.value = false |
| | | }); |
| | | </script> |
| | | |
| | |
| | | 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({}) |
| | |
| | | |
| | | function onPostMessage(data) { |
| | | if (data.type === 'back'){ |
| | | // uni.navigateTo({ |
| | | // url: `/subPackages/inProgress/index?wayLineJobInfoId=${data.taskDetails.id}` |
| | | // }); |
| | | // #ifdef H5 |
| | | window.history.back() |
| | | // #endif |
| | |
| | | |
| | | <script setup> |
| | | |
| | | import {onHide, onShow} from "@dcloudio/uni-app"; |
| | | import {useUserStore} from "@/store/index.js"; |
| | | const active = defineModel('active') |
| | | const sWebViewRef = ref(null) |
| | |
| | | |
| | | 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 |
| | |
| | | <!-- |
| | | * @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" /> |
| | |
| | | |
| | | const onPostMessage = (data) => { |
| | | if (data.type === "browser") { |
| | | // #ifdef MP-WEIXIN |
| | | |
| | | // #endif |
| | | |
| | | // #ifndef MP-WEIXIN |
| | | uni.navigateTo({ |
| | | url: |
| | |
| | | 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) { |
| | |
| | | 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 |
| | |
| | | |
| | | 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({ |
| | |
| | | }); |
| | | |
| | | onHide(() => { |
| | | // 如果工单详情返回任务详情,那么tab栏对应的是关联事件一项 |
| | | // isApp.value = false |
| | | |
| | | }); |
| | | </script> |
| | | |
| | |
| | | const viewUrl = ref(""); |
| | | const showComponent = ref(false); |
| | | function onPostMessage(data) { |
| | | // #ifdef MP-WEIXIN |
| | | // #endif |
| | | |
| | | // #ifndef MP-WEIXIN |
| | | if (data.type === "back") { |
| | |
| | | }); |
| | | 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 = () => { |
| | |
| | | <!-- |
| | | * @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 |
| | |
| | | uni.setStorageSync("joinParams", { |
| | | type: "add", |
| | | }); |
| | | // uni.switchTab({ |
| | | // url: '/pages/work/index' |
| | | // }); |
| | | uni.switchTab({ |
| | | url: `/pages/work/index?addLog=111`, |
| | | }); |
| | |
| | | <!-- |
| | | * @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 |
| | |
| | | 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, |
| | | }); |