<section class="map" @click="getLocation()">
</section>
getLocation() {
wx.getLocation({
type: 'gcj02',
success: function (res) {
wx.openLocation({
latitude: res.latitude,
longitude: res.longitude,
name: '',
address: '',
scale: 14,
infoUrl: 'http://www.baidu.com'
})
},
cancel: function (res) {
alert('用户拒绝授权获取地理位置');
}
})
}
怎么解决的?