| | |
| | | <!-- 已执行 --> |
| | | <template> |
| | | <WebViewPlus v-if="isApp" :src="`${viewUrl}`"/> |
| | | <WebViewPlus v-if="isApp" :src="`${viewUrl}`" @webMessage="onPostMessage"/> |
| | | </template> |
| | | |
| | | <script setup> |
| | |
| | | import WebViewPlus from "@/components/WebViewPlus.vue"; |
| | | import {getWebViewUrl} from "@/utils/index.js"; |
| | | |
| | | const viewUrl = ref(getWebViewUrl('/execution')) |
| | | const wayLineJodInfoId = ref(null) |
| | | const viewUrl = ref('') |
| | | // const viewUrl = ref(getWebViewUrl('/execution')) |
| | | |
| | | // function onPostMessage(data) { |
| | | // console.log(data, '9999') |
| | |
| | | // }); |
| | | // } |
| | | // } |
| | | function onPostMessage(data) { |
| | | if (data.type === 'back') { |
| | | uni.switchTab({ |
| | | url: '/pages/inspectionTask/index' |
| | | }); |
| | | } else if (data.type === 'control') { |
| | | uni.redirectTo({ |
| | | url: `/pages/inspectionTask/execution/index?wayLineJodInfoId=${wayLineJodInfoId.value}` |
| | | }); |
| | | } |
| | | } |
| | | |
| | | onLoad((options) => { |
| | | wayLineJodInfoId.value = options.wayLineJodInfoId |
| | | viewUrl.value = getWebViewUrl('/execution', {wayLineJodInfoId: wayLineJodInfoId.value}) |
| | | }) |
| | | const isApp = ref(false) |
| | | onShow(() => { |
| | | isApp.value = true |