| | |
| | | <template> |
| | | <view class="flex flex-col eventTickets"> |
| | | <WebViewPlus v-if="isApp" ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage"/> |
| | | |
| | | <view class="eventTickets"> |
| | | <WebViewPlus ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage" /> |
| | | </view> |
| | | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {getWebViewUrl} from "@/utils/index.js"; |
| | | import WebViewPlus from "@/components/WebViewPlus.vue"; |
| | | const sWebViewRef = ref(null); |
| | | const viewUrl = getWebViewUrl('/work', {}) |
| | | function onPostMessage(data) { |
| | | if(data.type==='workid'){ |
| | | uni.navigateTo({ |
| | | url: `/subPackages/workDetail/index?eventNum=${data.eventNum}` |
| | | }); |
| | | }else if(data.type === 'bigImage'){ |
| | | uni.navigateTo({ |
| | | url: `/subPackages/workDetail/photoMagnify/index?eventNum=${data.eventNum}` |
| | | }); |
| | | } |
| | | import { |
| | | getWebViewUrl |
| | | } from "@/utils/index.js"; |
| | | import WebViewPlus from "@/components/WebViewPlus.vue"; |
| | | import { |
| | | useTabAddButton |
| | | } from "@/hooks/index.js"; |
| | | import { onShow, onHide } from "@dcloudio/uni-app"; |
| | | |
| | | const sWebViewRef = ref(null); |
| | | // const viewUrl = getWebViewUrl('/work', {}) |
| | | const updateKey = ref(0) |
| | | const viewUrl = computed(() => { |
| | | return getWebViewUrl('/work', { |
| | | updateKey: updateKey.value |
| | | }) |
| | | }) |
| | | |
| | | } |
| | | function onPostMessage(data) { |
| | | if (data.type === 'jumpMapNav') { |
| | | uni.navigateTo({ |
| | | url: `/subPackages/workDetail/mapWork/index?currentItem=${data.eventNum}` |
| | | }); |
| | | |
| | | } else if (data.type === 'workid') { |
| | | uni.navigateTo({ |
| | | url: `/subPackages/workDetail/index?eventNum=${data.eventNum}&totalNum=${data.totalNum}&keyword=${data.keyword}&aiType=${data.aiType}&status=${data.status}` |
| | | }); |
| | | } else if (data.type === 'bigImage') { |
| | | uni.navigateTo({ |
| | | url: `/subPackages/workDetail/photoMagnify/index?eventNum=${data.eventNum}` |
| | | }); |
| | | |
| | | } |
| | | |
| | | } |
| | | const isApp = ref(false) |
| | | onShow(() => { |
| | | isApp.value = true |
| | | const joinParams = uni.getStorageSync('joinParams'); |
| | | if (joinParams) { |
| | | updateKey.value = updateKey.value + 1 |
| | | uni.removeStorageSync('joinParams'); |
| | | } |
| | | |
| | | uni.setStorageSync('lastTab', 'work'); |
| | | uni.setTabBarItem({ |
| | | index: 2, |
| | | text: '', |
| | | iconPath: 'static/images/tabbar/add.png', |
| | | selectedIconPath: 'static/images/tabbar/add.png' |
| | | }); |
| | | // isApp.value = true |
| | | }); |
| | | |
| | | onHide(() => { |
| | | isApp.value = false |
| | | // isApp.value = false |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .eventTickets { |
| | | |
| | | </style> |
| | | width: 100%; |
| | | height: 100%; |
| | | |
| | | } |
| | | </style> |