feat(地图导航): 添加网点地图导航功能

在多个页面中添加了地图导航功能,用户可以通过点击地址或导航图标打开地图并查看具体位置。如果位置信息缺失,会提示用户“暂无位置信息”。此功能提升了用户体验,方便用户快速找到网点位置。
This commit is contained in:
2025-04-10 22:36:01 +08:00
parent 1af84dc1ee
commit 47d847e138
4 changed files with 37 additions and 5 deletions

View File

@@ -98,6 +98,20 @@ Page({
},
load: function (e) {
console.log(e);
},
openLocation: function(e) {
var latitude = Number(e.currentTarget.dataset.latitude);
var longitude = Number(e.currentTarget.dataset.longitude);
var name = e.currentTarget.dataset.name;
var address = e.currentTarget.dataset.address;
wx.openLocation({
latitude: latitude,
longitude: longitude,
name: name,
address: address,
scale: 18
});
var t = e.currentTarget.dataset.index, a = this.data.swiperWidth * e.detail.height / e.detail.width;
this.data.banner[t].height = a, this.setData({
swiperHeight: a