chenyao
2025-11-19 28179be2881f3a6af9975136c013b0f0ca2298df
src/pages/work/index.vue
@@ -1,6 +1,6 @@
<template>
   <view class="eventTickets">
      <WebViewPlus  ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage" />
      <WebViewPlus ref="sWebViewRef" :src="`${viewUrl}`" @webMessage="onPostMessage" />
   </view>
@@ -16,12 +16,14 @@
   } from "@/hooks/index.js";
   const sWebViewRef = ref(null);
   // const viewUrl = getWebViewUrl('/work', {})
const updateKey = ref(0)
const viewUrl = computed(() => {
  return getWebViewUrl(  '/work', { updateKey: updateKey.value })
})
   function onPostMessage(data) {
   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}`
@@ -29,7 +31,7 @@
      } else if (data.type === 'workid') {
         uni.navigateTo({
            url: `/subPackages/workDetail/index?eventNum=${data.eventNum}`
            url: `/subPackages/workDetail/index?eventNum=${data.eventNum}&totalNum=${data.totalNum}&keyword=${data.keyword}&aiType=${data.aiType}`
         });
      } else if (data.type === 'bigImage') {
         uni.navigateTo({
@@ -41,13 +43,11 @@
   }
   const isApp = ref(false)
   onShow(() => {
        const joinParams = uni.getStorageSync('joinParams');
        if (joinParams) {
          // 使用后清除
          console.log('是否打印', updateKey.value)
          updateKey.value = updateKey.value + 1
          uni.removeStorageSync('joinParams');
        }
      const joinParams = uni.getStorageSync('joinParams');
      if (joinParams) {
         updateKey.value = updateKey.value + 1
         uni.removeStorageSync('joinParams');
      }
      uni.setTabBarItem({
         index: 2, // Tab 的索引(从0开始)
         // text: '新建工单',
@@ -73,4 +73,4 @@
      height: 100%;
   }
</style>
</style>