fix map callout

This commit is contained in:
Timi
2025-12-10 16:59:22 +08:00
parent 1e54782600
commit 920b3c87e8
3 changed files with 23 additions and 8 deletions

View File

@ -12,7 +12,8 @@
.custom-callout { .custom-callout {
width: fit-content; width: fit-content;
max-width: 400rpx; min-width: 350rpx;
max-width: 450rpx;
background: #fff; background: #fff;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15); box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, .15);
border-radius: 6rpx; border-radius: 6rpx;
@ -55,18 +56,27 @@
flex-direction: column; flex-direction: column;
.location { .location {
color: #999;
overflow: hidden; overflow: hidden;
font-size: 24rpx; font-size: 30rpx;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
margin-bottom: 4rpx; margin-bottom: 4rpx;
} }
.count-text { .date-count {
color: var(--theme-wx); display: flex;
font-size: 24rpx;
font-weight: 600; .date {
color: #999;
font-size: 24rpx;
margin-right: 16rpx;
}
.count {
color: var(--theme-wx);
font-size: 24rpx;
font-weight: 600;
}
} }
} }
} }

View File

@ -39,6 +39,7 @@ interface LocationMarker {
location?: string; location?: string;
journalIds: number[]; // 该位置的所有日记 ID journalIds: number[]; // 该位置的所有日记 ID
count: number; // 日记数量 count: number; // 日记数量
date: string;
previewThumb?: string; // 预览缩略图 previewThumb?: string; // 预览缩略图
} }
@ -124,6 +125,7 @@ Page({
location: journal.location, location: journal.location,
journalIds: [], journalIds: [],
count: 0, count: 0,
date: Time.toPassedDate(journal.createdAt),
previewThumb: thumbItem ? `${config.url}/attachment/read/${thumbItem.mongoId}` : undefined previewThumb: thumbItem ? `${config.url}/attachment/read/${thumbItem.mongoId}` : undefined
}); });
} }

View File

@ -22,7 +22,10 @@
</cover-view> </cover-view>
<cover-view class="text-container"> <cover-view class="text-container">
<cover-view wx:if="{{item.location}}" class="location">{{item.location}}</cover-view> <cover-view wx:if="{{item.location}}" class="location">{{item.location}}</cover-view>
<cover-view wx:if="{{item.count > 1}}" class="count-text">{{item.count}} 条日记</cover-view> <cover-view class="date-count">
<cover-view class="date">{{item.date}}</cover-view>
<cover-view wx:if="{{item.count > 1}}" class="count">{{item.count}} 条日记</cover-view>
</cover-view>
</cover-view> </cover-view>
</cover-view> </cover-view>
</cover-view> </cover-view>