需要获取发帖人位置信息
现通过wx.getLocation 获取经纬度
然后用 微信小程序JavaScript SDK 通过经纬度获取位置
但是同一手机 同一位置获取的位置都不一样 (有办法解决吗 还是正常现象)
demo.reverseGeocoder({
location: {
latitude: latitude,
longitude: longitude
},
success: function (res) {
var province = res.result.address_component.province;
var city = res.result.address_component.city;
var district = res.result.address_component.district;
var street = res.result.address_component.street;
var address = province + city + district + street;
that.setData({ latitude: latitude, longitude: longitude, province: province, city: city, area: district, street:street, address: address});
},