<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=99eb6fc8c05a421c5bf5000f523bf78d"></script>
created(){
var that = this
AMap.plugin('AMap.CitySearch', function () {
var citySearch = new AMap.CitySearch()
citySearch.getLocalCity(function (status, result) {
if (status === 'complete' && result.info === 'OK') {
that.getCityId(result.city)
// 查询成功,result即为当前所在城市信息
}
})
})
},