| | |
| | | <template> |
| | | <WebViewPlus :src="`${viewUrl}`" @webMessage="onPostMessage"/> |
| | | <WebViewPlus v-if="showComponent" :src="`${viewUrl}`" @webMessage="onPostMessage"/> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import WebViewPlus from "@/components/WebViewPlus.vue"; |
| | | import {getWebViewUrl} from "@/utils/index.js"; |
| | | import {onLoad} from "@dcloudio/uni-app"; |
| | | import {onHide, onLoad, onShow} from "@dcloudio/uni-app"; |
| | | |
| | | const wayLineJodInfoId = ref(null) |
| | | const wayLineJobInfoId = ref(null) |
| | | const batchNo = ref(null) |
| | | const viewUrl = ref('') |
| | | |
| | | const showComponent = ref(false) |
| | | function onPostMessage(data) { |
| | | if (data.type === 'back') { |
| | | uni.switchTab({ |
| | |
| | | }); |
| | | } else if (data.type === 'control') { |
| | | uni.navigateTo({ |
| | | url: `/subPackages/droneConsole/index?wayLineJodInfoId=${wayLineJodInfoId.value}` |
| | | url: `/subPackages/droneConsole/index?wayLineJobInfoId=${wayLineJobInfoId.value}&dockSn=${data.dockSn}&batchNo=${batchNo.value}`, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | onLoad((options) => { |
| | | wayLineJodInfoId.value = options.wayLineJodInfoId |
| | | viewUrl.value = getWebViewUrl('/TaskInProgress', {wayLineJodInfoId: wayLineJodInfoId.value}) |
| | | onLoad((queryParams) => { |
| | | wayLineJobInfoId.value = queryParams.wayLineJobInfoId |
| | | batchNo.value = queryParams.batchNo |
| | | viewUrl.value = getWebViewUrl('/TaskInProgress', { |
| | | wayLineJobInfoId: wayLineJobInfoId.value, |
| | | batchNo: batchNo.value |
| | | }) |
| | | }) |
| | | |
| | | onShow(function () { |
| | | showComponent.value = true |
| | | // #ifdef APP-PLUS |
| | | plus.navigator.setFullscreen(false); |
| | | plus.screen.lockOrientation("portrait-primary"); |
| | | // #endif |
| | | }) |
| | | |
| | | onHide(() =>{ |
| | | showComponent.value = false |
| | | }) |
| | | </script> |
| | | |