张含笑
2025-11-13 b2af84cbd77c9e5b5cf26d74acc04179cedcea0f
src/pages/work/index.vue
@@ -1,6 +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>
@@ -15,8 +15,11 @@
      useTabAddButton
   } from "@/hooks/index.js";
   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') {
@@ -38,6 +41,13 @@
   }
   const isApp = ref(false)
   onShow(() => {
        const joinParams = uni.getStorageSync('joinParams');
        if (joinParams) {
          // 使用后清除
          console.log('是否打印', updateKey.value)
          updateKey.value = updateKey.value + 1
          uni.removeStorageSync('joinParams');
        }
      uni.setTabBarItem({
         index: 2, // Tab 的索引(从0开始)
         // text: '新建工单',
@@ -48,18 +58,19 @@
         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>
</style>