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

Loading…
Cancel
Save