小程序-获取用户位置信息
时间:2020-05-11 13:19:20
收藏:0
阅读:100
wxml
<button open-type="getUserInfo" bindgetuserinfo="fetchInfo">获取位置</button> <view bindtap="getLocalPath">{{localPath}}</view>
js
data: {
"localPath":"请选择位置"
},
getLocalPath:function(){
var that = this;
//调用微信位置接口
wx.chooseLocation({
success:function(res){
that.setData({localPath:res.address});
},
})
},
评论(0)