| | |
| | | <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 viewUrl = ref('') |
| | | |
| | | const showComponent = ref(false) |
| | | function onPostMessage(data) { |
| | | if (data.type === 'back') { |
| | | uni.switchTab({ |
| | |
| | | wayLineJodInfoId.value = options.wayLineJodInfoId |
| | | viewUrl.value = getWebViewUrl('/TaskInProgress', {wayLineJodInfoId: wayLineJodInfoId.value}) |
| | | }) |
| | | |
| | | onShow(function () { |
| | | showComponent.value = true |
| | | }) |
| | | |
| | | onHide(() =>{ |
| | | showComponent.value = false |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |