getAddress() {
let _this = this
uni.getLocation({
type: 'wgs84',
geocode: true,
success: function (res) {
// console.log('当前位置:' + JSON.stringify(res));
var point = new plus.maps.Point(res.longitude, res.latitude);
plus.maps.Map.reverseGeocode(point,{},function(event) {
var reg = /.+?(省|市|自治区|自治州|县|区)/g;
// console.log(event.address.match(reg));
let newCity = event.address.match(reg)
_this.citys = newCity[0] + '-' + newCity[1]
})
},
fail: function (fail) {
// console.log('当前位置:' + JSON.stringify(fail));
_this.citys = '北京市-市辖区'
},
});
}