3 files modified
1 files added
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/droneConsole/index", |
| | | "style": { |
| | | "navigationBarTitleText": "控制台", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/login/index", |
| | | "style": { |
| | | "navigationBarTitleText": "登录页" |
| New file |
| | |
| | | <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> |
| | |
| | | <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" |
| | | /> |
| | |
| | | </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 |
| | | } |
| | | }); |
| | |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | |
| | | .page-wrap { |
| | | font-size: 20px; |
| | | } |
| | | </style> |
| | |
| | | ).then(res => { |
| | | userStore.setUserInfo(res.data) |
| | | uni.switchTab({ |
| | | url: '/' |
| | | url: '/pages/user/index' |
| | | }) |
| | | }) |
| | | } |