feat(地图导航): 添加网点地图导航功能
在多个页面中添加了地图导航功能,用户可以通过点击地址或导航图标打开地图并查看具体位置。如果位置信息缺失,会提示用户“暂无位置信息”。此功能提升了用户体验,方便用户快速找到网点位置。
This commit is contained in:
@@ -141,4 +141,22 @@ Page({
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 打开地图导航
|
||||
openLocation() {
|
||||
if (this.data.info.latitude && this.data.info.longitude) {
|
||||
wx.openLocation({
|
||||
latitude: Number(this.data.info.latitude),
|
||||
longitude: Number(this.data.info.longitude),
|
||||
name: this.data.info.name,
|
||||
address: this.data.info.address,
|
||||
scale: 18
|
||||
})
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '暂无位置信息',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user