this.$http
.get(url, { params: searchUserParam })
.then((res) => {
let result = res.body;
if (result.status === "SUCCEED") {
this.tableData = [];
let resData = result.datas;
var myGeo = new BMap.Geocoder();
for (let i = 0; i < resData.length; i++) {
_this.tableData.push({});//初始化数组内容防止this.$set修改数组空指针报错
let item = resData[i];
let lon = item.longitude / 1000000;
let lat = item.latitude / 1000000;
let point = new BMap.Point(lon, lat)
myGeo.getLocation(point, function (rs) {
// console.log(i)
if (rs) {
//根据当前位置经纬度解析成地址
let addComp = rs.addressComponents;
let address =
addComp.province +
addComp.city +
addComp.district +
addComp.street +
addComp.streetNumber;
item.address = address;
//按位置修改数组内容
_this.$set(_this.tableData,i,item);
}
});
}
this.totalCount = result.totalCount;
}
});
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。