fix location icon

This commit is contained in:
Timi
2025-12-10 17:17:57 +08:00
parent 920b3c87e8
commit 18c6a41549
7 changed files with 60 additions and 9 deletions

View File

@ -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) {