fix:修复bug
This commit is contained in:
@@ -40,7 +40,7 @@
|
||||
import { computed } from 'vue'
|
||||
import { useI18n } from '@/utils/i18n.js'
|
||||
|
||||
const { t: $t } = useI18n()
|
||||
const { t } = useI18n()
|
||||
|
||||
const props = defineProps({
|
||||
show: { type: Boolean, default: false },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="map-container" :class="{ 'full-width': props.fullWidth }" :style="{ '--map-height': props.customHeight || '78vh' }">
|
||||
<view class="map-container" :class="{ 'full-width': props.fullWidth }" :style="{ '--map-height': props.customHeight || '72vh' }">
|
||||
<!-- 地图容器 -->
|
||||
<view class="map-wrapper">
|
||||
<!-- 使用小程序原生地图组件 -->
|
||||
@@ -68,7 +68,7 @@
|
||||
import { useI18n } from '../utils/i18n.js'
|
||||
|
||||
// 获取 i18n 实例
|
||||
const { t: $t } = useI18n()
|
||||
const { t } = useI18n()
|
||||
|
||||
// 引用折叠面板组件的ref
|
||||
const collapseRef = ref(null)
|
||||
@@ -272,13 +272,19 @@
|
||||
const onMapRegionChange = (e) => {
|
||||
|
||||
// 只处理结束事件
|
||||
if (!e || e.type !== 'end') {
|
||||
if (!e || (e.type !== 'end' && e.type !== 'regionchange')) {
|
||||
return
|
||||
}
|
||||
|
||||
const causedBy = e.causedBy || e.detail?.causedBy
|
||||
|
||||
if (causedBy === 'gesture' || causedBy === 'scale' || causedBy === 'drag'||causedBy==='update') {
|
||||
// H5 环境下可能没有 causedBy,只要是 end 事件就处理
|
||||
const isH5 = false;
|
||||
// #ifdef H5
|
||||
const h5Status = true;
|
||||
// #endif
|
||||
|
||||
if (causedBy === 'gesture' || causedBy === 'scale' || causedBy === 'drag' || causedBy === 'update' || (typeof h5Status !== 'undefined' && e.type === 'end')) {
|
||||
// 清除之前的定时器
|
||||
if (regionChangeTimer) {
|
||||
clearTimeout(regionChangeTimer)
|
||||
@@ -481,22 +487,26 @@ const handleSearch = () => {
|
||||
/* 地图容器 */
|
||||
.map-container {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
// position: fixed;
|
||||
// top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
width: 94vw;
|
||||
height: calc(100% - 20rpx); /* 减少高度,避免覆盖底部按钮 */
|
||||
height: var(--map-height, calc(100% - 20rpx)); /* 使用变量或默认高度 */
|
||||
margin: 20rpx;
|
||||
margin-bottom: 0; /* 底部不需要边距 */
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
&.full-width {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.map-wrapper {
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
import { computed } from 'vue';
|
||||
import { useI18n } from '@/utils/i18n.js'
|
||||
|
||||
const { t: $t } = useI18n()
|
||||
const { t } = useI18n()
|
||||
|
||||
const props = defineProps({
|
||||
order: { type: Object, required: true },
|
||||
@@ -144,7 +144,7 @@
|
||||
const isFinished = computed(() => normalizedStatus.value === 'used_done');
|
||||
const isCancelled = computed(() => normalizedStatus.value === 'order_cancelled');
|
||||
|
||||
const titleText = computed(() => $t('order.rentFan'));
|
||||
const titleText = computed(() => t('order.rentFan'));
|
||||
|
||||
// 显示金额(优先后端给定字段)
|
||||
const displayAmount = computed(() => props.order.amount || props.order.payAmount || props.order.actualDeviceAmount || props.order.currentFee || '0.00');
|
||||
@@ -158,8 +158,8 @@
|
||||
const minutes = Math.floor(diffMs / 60000);
|
||||
const hours = Math.floor(minutes / 60);
|
||||
const mins = minutes % 60;
|
||||
if (hours > 0) return `${hours}${$t('time.hour')}${mins}${$t('time.minute')}`;
|
||||
return `${mins}${$t('time.minute')}`;
|
||||
if (hours > 0) return `${hours}${t('time.hour')}${mins}${t('time.minute')}`;
|
||||
return `${mins}${t('time.minute')}`;
|
||||
});
|
||||
|
||||
function parseDate(str) {
|
||||
|
||||
Reference in New Issue
Block a user