1. 地图选择地址
// 选择地址
// res可获取到的属性:address,errMsg,latitude,longitude,name,poiid
chooseAddress(){
uni.chooseLocation({
success:(res)=>{
this.addr = res.address
this.lat = res.latitude
this.lng = res.longitude
}
})
},
2. 地图导航
toAddress(){
uni.openLocation({
latitude:Number(this.companyInfo.lat), // 要去的目的地的纬度
longitude:Number(this.companyInfo.lng), // 要去的目的地的经度
address:this.companyInfo.addr, // 要去的目的地的地址
success: () => {
console.log('success')
}
})
},
3.打电话
openPhone() {
uni.makePhoneCall({
phoneNumber: this.mobile // 要拨打的电话号
})
},