From e6468d526664ce263b9972bb9c773961b93fd6ce Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 13 Oct 2025 11:16:49 +0800
Subject: [PATCH] feat: 控制台
---
src/pages.json | 7 +++
src/pages/login/index.vue | 2
src/pages/inspectionTask/TaskDetails/TaskDetails.vue | 21 +++++++---
src/pages/droneConsole/index.vue | 45 ++++++++++++++++++++++
4 files changed, 67 insertions(+), 8 deletions(-)
diff --git a/src/pages.json b/src/pages.json
index d826fa4..88dc6f0 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -31,6 +31,13 @@
}
},
{
+ "path": "pages/droneConsole/index",
+ "style": {
+ "navigationBarTitleText": "控制台",
+ "navigationStyle": "custom"
+ }
+ },
+ {
"path": "pages/login/index",
"style": {
"navigationBarTitleText": "登录页"
diff --git a/src/pages/droneConsole/index.vue b/src/pages/droneConsole/index.vue
new file mode 100644
index 0000000..8ac8146
--- /dev/null
+++ b/src/pages/droneConsole/index.vue
@@ -0,0 +1,45 @@
+<template>
+ <view class="page-wrap">
+ <web-view
+ ref="sWebViewRef"
+ :src='`${viewUrl}?token=${token}&wayLineJodInfoId=${active.id}`'
+ @message="onPostMessage"
+ @onPostMessage="onPostMessage"
+ />
+ </view>
+</template>
+<script setup>
+import {onHide, onShow} from "@dcloudio/uni-app";
+import {useUserStore} from "@/store/index.js";
+const active = defineModel('active')
+const sWebViewRef = ref(null)
+const viewUrl = 'http://192.168.1.15:5173/drone-app-web-view/#/appTaskDetails'
+const userStore = useUserStore()
+const token = computed(() => userStore?.userInfo?.access_token)
+
+function onPostMessage(event) {
+ if (event.detail.data[0].type === 'back') {
+ active.value = null
+ }
+}
+
+
+
+
+
+
+onShow(() => {
+ // #ifdef APP-PLUS
+ plus.screen.lockOrientation("landscape-primary");
+ // #endif
+});
+
+onHide(() => {
+ // #ifdef APP-PLUS
+ plus.screen.lockOrientation("portrait-primary");
+ // #endif
+});
+</script>
+<style scoped lang="scss">
+
+</style>
diff --git a/src/pages/inspectionTask/TaskDetails/TaskDetails.vue b/src/pages/inspectionTask/TaskDetails/TaskDetails.vue
index 584c8d4..ac3df84 100644
--- a/src/pages/inspectionTask/TaskDetails/TaskDetails.vue
+++ b/src/pages/inspectionTask/TaskDetails/TaskDetails.vue
@@ -2,7 +2,7 @@
<view class="page-wrap">
<web-view
ref="sWebViewRef"
- src='http://localhost:5173/drone-app-web-view/#/appTaskDetails'
+ :src='`${viewUrl}?token=${token}&wayLineJodInfoId=${active.id}`'
@message="onPostMessage"
@onPostMessage="onPostMessage"
/>
@@ -10,19 +10,24 @@
</template>
<script setup>
-
import {onLoad} from "@dcloudio/uni-app";
+import {useUserStore} from "@/store/index.js";
const active = defineModel('active')
+const sWebViewRef = ref(null)
+const viewUrl = 'http://192.168.1.15:5173/drone-app-web-view/#/appTaskDetails'
+const userStore = useUserStore()
+const token = computed(() => userStore?.userInfo?.access_token)
+
function onPostMessage(event) {
- if (event.detail.data[0].type === 'back'){
+ if (event.detail.data[0].type === 'back') {
active.value = null
}
}
-onLoad(()=>{
- window.addEventListener('message', function(e) {
- if (e.data.data.type === 'back'){
+onLoad(() => {
+ window.addEventListener('message', function (e) {
+ if (e.data.data.type === 'back') {
active.value = null
}
});
@@ -31,5 +36,7 @@
</script>
<style scoped lang="scss">
-
+.page-wrap {
+ font-size: 20px;
+}
</style>
diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue
index 43b650e..caad501 100644
--- a/src/pages/login/index.vue
+++ b/src/pages/login/index.vue
@@ -58,7 +58,7 @@
).then(res => {
userStore.setUserInfo(res.data)
uni.switchTab({
- url: '/'
+ url: '/pages/user/index'
})
})
}
--
Gitblit v1.9.3