Explorar o código

fix: 点击关闭

lxf hai 1 semana
pai
achega
461018ce27
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      src/views/old_mini/monitor/index.vue

+ 8 - 1
src/views/old_mini/monitor/index.vue

@@ -2,7 +2,7 @@
     <custom-header v-if="isHeaderShow" name="农场详情"></custom-header>
     <div class="monitor-index" :style="{ height: `calc(100vh - ${tabBarHeight}px)` }">
         <!-- 天气遮罩 -->
-        <div class="weather-mask" v-show="isExpanded"></div>
+        <div class="weather-mask" v-show="isExpanded" @click="handleMaskClick"></div>
         <!-- 天气 -->
         <weather-info
             ref="weatherInfoRef"
@@ -378,6 +378,13 @@ const weatherExpanded = (isExpandedValue) => {
     isExpanded.value = isExpandedValue;
 };
 
+// 点击遮罩时收起天气
+const handleMaskClick = () => {
+    if (weatherInfoRef.value && weatherInfoRef.value.toggleExpand) {
+        weatherInfoRef.value.toggleExpand();
+    }
+};
+
 const gardenId = ref(store.state.home.gardenId);
 const changeGarden = ({ id }) => {
     localStorage.setItem('isGarden', true);