Browse Source

地图修改

master
@AliceXiaoZhan 4 years ago
parent
commit
710327ac0f
  1. 66
      pages/contactUs/contactUs.js

66
pages/contactUs/contactUs.js

@ -22,37 +22,47 @@ Page({
userPhone:'',
}]
},
biaoji(e) {
console.log("标记目的地点击", e)
wx.getLocation({//获取当前地址信息
type: 'wgs84',
success(res) {
const latitude = res.latitude
const longitude = res.longitude
const speed = res.speed
const accuracy = res.accuracy
// click: function (e) {
// wx.openLocation({
// latitude: 23.362490,
// longitude: 116.715790,
// scale: 18,
// name: '华乾大厦',
// address:'金平区长平路93号'
// })
// },
biaoji: function (e) {
// wx.getLocation({//获取当前地址信息
// type: 'wgs84',
// success(res) {
// console.log(res)
// const latitude = res.latitude
// const longitude = res.longitude
// const speed = res.speed
// const accuracy = res.accuracy
wx.openLocation({//跳转腾讯地图查看并可以进行导航
latitude: parseFloat(that.data.latitude),
longitude: parseFloat(that.data.longitude)
})
},fail(res){//未授权地理位置处理
wx.showModal({
title: '请授权',
content: '若未授权地理位置,您将不能正常使用导航功能',
confirmText:"授权",
success (res) {
if (res.confirm) {
console.log('用户点击确定')
wx.openSetting({//跳转设置授权界面
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
}
})
// },fail(res){//未授权地理位置处理
// wx.showModal({
// title: '请授权',
// content: '若未授权地理位置,您将不能正常使用导航功能',
// confirmText:"授权",
// success (res) {
// if (res.confirm) {
// console.log('用户点击确定')
// wx.openSetting({//跳转设置授权界面
// })
// } else if (res.cancel) {
// console.log('用户点击取消')
// }
// }
// })
// }
// })
},
callPhone (e) {
@ -97,7 +107,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**

Loading…
Cancel
Save