// 点击导航
handleLocationDh() {
uni.showActionSheet({
itemList: ['高德地图'],
success: (res) => {
this.guideFun(res.tapIndex)
},
fail: function(res) {
console.log(res.errMsg);
}
});
},
// 高德导航
guideFun(signMap) {
//this.longitude ,latitude是目标点的坐标
if (this.longitude && this.latitude) {
// 高德地图
let lng = this.longitude;
let lat = this.latitude;
uni.getSystemInfo({
success: (res) => {
if (res.platform === "android") {
window.location.href =
"androidamap://viewMap?sourceApplication=appname&poiname=线索位置" + "&lat=" +
lat + "&lon=" + lng + "&dev=0";
} else if (res.platform === "ios") {
window.location.href =
`iosamap://viewMap?sourceApplication=applicationName&poiname=线索位置&lat=${lat}&lon=${lng}&dev=0`;
}else{
uni.showToast({
title: '暂只支持安卓导航',
icon: 'none',
duration: 2000,
});
}
}
})
} else {
uni.showToast({
title: '暂不知道该地点位置',
icon: 'none',
duration: 2000,
});
}
},
网友评论