fix location icon
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 638 B |
@ -35,8 +35,8 @@
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
color: var(--theme-wx);
|
||||
font-size: 48rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
@ -81,9 +81,21 @@
|
||||
align-items: baseline;
|
||||
|
||||
.location {
|
||||
gap: 8rpx;
|
||||
color: #666;
|
||||
flex-basis: 100%;
|
||||
display: flex;
|
||||
font-size: 24rpx;
|
||||
flex-basis: 100%;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
color: var(--theme-wx);
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.date {
|
||||
|
||||
@ -4,6 +4,8 @@ interface JournalInfo {
|
||||
id: number;
|
||||
date: string;
|
||||
time: string;
|
||||
lat?: number;
|
||||
lng?: number;
|
||||
location?: string;
|
||||
idea?: string;
|
||||
items: Array<{
|
||||
@ -79,6 +81,18 @@ Component({
|
||||
currentJournalIndex: e.detail.current
|
||||
});
|
||||
},
|
||||
|
||||
openLocation(e: WechatMiniprogram.BaseEvent) {
|
||||
const { journalIndex } = e.currentTarget.dataset;
|
||||
const journals = this.properties.journals as JournalInfo[];
|
||||
const journal = journals[journalIndex];
|
||||
if (journal.lat && journal.lng) {
|
||||
wx.openLocation({
|
||||
latitude: journal.lat,
|
||||
longitude: journal.lng,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/** 预览媒体 */
|
||||
previewMedia(e: WechatMiniprogram.BaseEvent) {
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
<view class="header">
|
||||
<view class="info">
|
||||
<view wx:if="{{title}}" class="title">
|
||||
<image wx:if="{{showLocationIcon}}" class="icon" src="../../assets/image/location.png" />
|
||||
<t-icon wx:if="{{showLocationIcon}}" class="icon" name="location-filled" />
|
||||
<text>{{title}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -26,7 +26,15 @@
|
||||
<swiper-item class="swiper-item-wrapper">
|
||||
<view class="journal-item">
|
||||
<view class="journal-header">
|
||||
<view wx:if="{{item.location && showJournalLocation}}" class="location">📍 {{item.location}}</view>
|
||||
<view
|
||||
wx:if="{{item.location && showJournalLocation}}"
|
||||
class="location"
|
||||
catchtap="openLocation"
|
||||
data-journal-index="{{currentJournalIndex}}"
|
||||
>
|
||||
<t-icon class="icon" name="location-filled" />
|
||||
<text class="text">{{item.location}}</text>
|
||||
</view>
|
||||
<view wx:if="{{showJournalDate}}" class="date">{{item.date}}</view>
|
||||
</view>
|
||||
<view wx:if="{{item.idea}}" class="idea">{{item.idea}}</view>
|
||||
|
||||
@ -8,6 +8,8 @@ interface JournalInfo {
|
||||
id: number;
|
||||
date: string;
|
||||
time: string;
|
||||
lat?: number;
|
||||
lng?: number;
|
||||
location?: string;
|
||||
idea?: string;
|
||||
items: Array<{
|
||||
@ -145,6 +147,8 @@ Page({
|
||||
id: journal.id,
|
||||
date: Time.toPassedDateTime(journal.createdAt),
|
||||
time: `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`,
|
||||
lat: journal.lat,
|
||||
lng: journal.lng,
|
||||
location: journal.location,
|
||||
idea: journal.idea,
|
||||
items: journal.items
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.text {
|
||||
> .text {
|
||||
color: var(--theme-text-primary);
|
||||
width: calc(100% - 32px - 2rem);
|
||||
padding: 8px 16px;
|
||||
@ -64,8 +64,18 @@
|
||||
}
|
||||
|
||||
.location {
|
||||
color: var(--theme-text-secondary);
|
||||
text-align: right;
|
||||
gap: 6rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
|
||||
.icon {
|
||||
color: var(--theme-wx);
|
||||
}
|
||||
|
||||
.text {
|
||||
color: var(--theme-text-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -27,7 +27,10 @@
|
||||
class="location"
|
||||
bind:tap="openLocation"
|
||||
data-journal-index="{{journalIndex}}"
|
||||
>📍 {{journal.location}}</view>
|
||||
>
|
||||
<t-icon class="icon" name="location-filled" />
|
||||
<text class="text">{{journal.location}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{journal.items}}" class="items">
|
||||
<block wx:for="{{journal.items}}" wx:for-item="item" wx:for-index="itemIndex" wx:key="date">
|
||||
|
||||
Reference in New Issue
Block a user