Pārlūkot izejas kodu

🎨 优化村落页地图

快乐的梦鱼 1 mēnesi atpakaļ
vecāks
revīzija
4ca4bc8e6c
1 mainītis faili ar 11 papildinājumiem un 1 dzēšanām
  1. 11 1
      src/pages/home/components/VillageMiniMap.vue

+ 11 - 1
src/pages/home/components/VillageMiniMap.vue

@@ -4,6 +4,7 @@
     :style="{
       borderColor: themeContext.resolveThemeColor('primary'),
     }"
+    @click="handleGoLocation"
   >
     <map 
       id="prevMap"
@@ -14,7 +15,6 @@
       :longitude="lonlat.longitude"
       :latitude="lonlat.latitude"
     />
-
     
     <FlexCol v-if="!isValidLonlat" 
       gap="gap.xl" 
@@ -94,6 +94,15 @@ const markers = computed(() => {
     } 
   ] : []);
 });
+
+function handleGoLocation() {
+  if (!isValidLonlat.value) 
+    return;
+  uni.openLocation({
+    latitude: Number(props.lonlat.latitude),
+    longitude: Number(props.lonlat.longitude),  
+  });
+}
 </script>
 
 <style lang="scss">
@@ -109,6 +118,7 @@ const markers = computed(() => {
   .mini-village-map-map {
     width: 100%;
     height: 340rpx;
+    pointer-events: none;
   }
 }
 </style>