shuishen
2025-12-19 32febb140d320b35d580c8d4e78a80ef846e75fc
src/pages/work/index.vue
@@ -1,7 +1,6 @@
<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>
@@ -14,11 +13,18 @@
   import {
      useTabAddButton
   } from "@/hooks/index.js";
   import { onShow, onHide } from "@dcloudio/uni-app";
   const sWebViewRef = ref(null);
   const viewUrl = getWebViewUrl('/work', {})
   // 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}`
@@ -26,7 +32,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}&status=${data.status}`
         });
      } else if (data.type === 'bigImage') {
         uni.navigateTo({
@@ -38,28 +44,32 @@
   }
   const isApp = ref(false)
   onShow(() => {
      const joinParams = uni.getStorageSync('joinParams');
      if (joinParams) {
         updateKey.value = updateKey.value + 1
         uni.removeStorageSync('joinParams');
      }
      uni.setStorageSync('lastTab', 'work');
      uni.setTabBarItem({
         index: 2, // Tab 的索引(从0开始)
         // text: '新建工单',
         visible: true,
         "pagePath": "subPackages/workDetail/addWork/index"
         index: 2,
         text: '',
         iconPath: 'static/images/tabbar/add.png',
         selectedIconPath: 'static/images/tabbar/add.png'
      });
      uni.setTabBarItem({
         index: 3, // Tab
         visible: false,
      });
      isApp.value = true
      // isApp.value = true
   });
   onHide(() => {
      isApp.value = false
      // isApp.value = false
   });
</script>
<style scoped lang="scss">
   .eventTickets {
      width: 100%;
      height: 100%;
   }
</style>