fix location icon
This commit is contained in:
@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user