fix:修复bug
This commit is contained in:
@@ -38,11 +38,9 @@
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { getCurrentInstance } from 'vue'
|
||||
import { useI18n } from '@/utils/i18n.js'
|
||||
|
||||
const instance = getCurrentInstance()
|
||||
const $t = instance?.proxy?.$t || ((key) => key)
|
||||
const { t: $t } = useI18n()
|
||||
|
||||
const props = defineProps({
|
||||
show: { type: Boolean, default: false },
|
||||
|
||||
+28
-23
@@ -7,16 +7,16 @@
|
||||
:markers="mapMarkers" :scale="mapZoom" :show-location="false" @regionchange="onMapRegionChange"
|
||||
@markertap="onMapMarkerTap" @callouttap="onCalloutTap" @updated="onMapUpdated" @error="onMapError">
|
||||
<!-- 覆盖在地图上的可点击控件(使用 cover-view 以兼容小程序原生组件层级) -->
|
||||
<cover-view class="index-swiper" v-if="!props.hideControls" @tap="handleJoinTap">
|
||||
<cover-view class="index-swiper" v-if="!props.hideControls && !props.hideMapOverlays" @tap="handleJoinTap">
|
||||
<cover-image src="/static/index_swiper.png" class="index-swiper-img" mode="aspectFit"></cover-image>
|
||||
</cover-view>
|
||||
|
||||
<!-- 地图中心固定定位图标 -->
|
||||
<cover-view class="center-location-marker">
|
||||
<cover-view class="center-location-marker" v-if="!props.hideMapOverlays">
|
||||
<cover-image src="/static/location-icon.png" class="center-marker-icon"></cover-image>
|
||||
</cover-view>
|
||||
|
||||
<cover-view class="map-side-controls" v-if="!props.hideControls">
|
||||
<cover-view class="map-side-controls" v-if="!props.hideControls && !props.hideMapOverlays">
|
||||
<cover-view class="side-btn service" @tap="handleService">
|
||||
<cover-image class="side-icon" src="/static/customer-service.png"></cover-image>
|
||||
<!-- <cover-view class="side-text">客服</cover-view> -->
|
||||
@@ -57,10 +57,11 @@
|
||||
import {
|
||||
calculateDistanceSync
|
||||
} from '../utils/mapUtils.js'
|
||||
// 导入国际化
|
||||
import { useI18n } from '../utils/i18n.js'
|
||||
|
||||
// 获取 i18n 实例
|
||||
const instance = getCurrentInstance()
|
||||
const $t = instance?.proxy?.$t || ((key) => key)
|
||||
const { t: $t } = useI18n()
|
||||
|
||||
// 引用折叠面板组件的ref
|
||||
const collapseRef = ref(null)
|
||||
@@ -99,11 +100,15 @@
|
||||
type: Boolean,
|
||||
default: false // 是否隐藏侧边控制按钮
|
||||
},
|
||||
fullWidth: {
|
||||
type: Boolean,
|
||||
default: false // 是否全宽显示(去掉 margin 和固定宽度)
|
||||
}
|
||||
})
|
||||
fullWidth: {
|
||||
type: Boolean,
|
||||
default: false // 是否全宽显示(去掉 margin 和固定宽度)
|
||||
},
|
||||
hideMapOverlays: {
|
||||
type: Boolean,
|
||||
default: false // 是否隐藏地图上的覆盖层元素(如中心定位图标、轮播图等)
|
||||
}
|
||||
})
|
||||
|
||||
// Emits
|
||||
const emit = defineEmits([
|
||||
@@ -484,18 +489,18 @@ const handleSearch = () => {
|
||||
}
|
||||
}
|
||||
|
||||
/* 地图中心定位图标(固定在屏幕中心) */
|
||||
.center-location-marker {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
z-index: 100;
|
||||
width: 60rpx;
|
||||
height: 80rpx;
|
||||
margin-left: -30rpx;
|
||||
margin-top: -80rpx;
|
||||
pointer-events: none;
|
||||
}
|
||||
/* 地图中心定位图标(固定在屏幕中心) */
|
||||
.center-location-marker {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
z-index: 1;
|
||||
width: 60rpx;
|
||||
height: 80rpx;
|
||||
margin-left: -30rpx;
|
||||
margin-top: -80rpx;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.center-marker-icon {
|
||||
width: 60rpx;
|
||||
@@ -567,7 +572,7 @@ const handleSearch = () => {
|
||||
width: 90vw;
|
||||
height: 120rpx;
|
||||
border-radius: 20rpx;
|
||||
z-index: 1000;
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
// top: 10rpx;
|
||||
left: 50%;
|
||||
|
||||
@@ -80,10 +80,10 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, getCurrentInstance } from 'vue';
|
||||
|
||||
const instance = getCurrentInstance()
|
||||
const $t = instance?.proxy?.$t || ((key) => key)
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from '@/utils/i18n.js'
|
||||
|
||||
const { t: $t } = useI18n()
|
||||
|
||||
const props = defineProps({
|
||||
order: { type: Object, required: true },
|
||||
|
||||
Reference in New Issue
Block a user