getCityInfo 根据百度地图得到的城市名称获取城市的信息

getCityInfo ^6.8

根据百度地图得到的城市名称获取城市的信息,比如该城市对应的气象局对应的ID

#请求参数

Prop Type Default Comment
cityName String N/A 城市名称

#接口调用示例

const params = {
  cityName: '武汉市'
}
this.$bridge
  .getCityInfo(params)
  .then(res => {
    this.$alert(res)
  })
  .catch(err => {
    this.$toast(err)
  })

#返回参数

  • 成功时返回
Prop Type Default Description
chName String N/A 城市中文名
provinceName String N/A
countryName String N/A 城市对应气象局的ID
cityNo String N/A 城市对应气象局的ID
enName String N/A 城市英文名
status Number N/A 0 成功
  • 失败时返回
Prop Type Default Description
errorCode Number N/A
errorMessage String N/A
posted on 2024-12-21 14:42  AtlasLapetos  阅读(29)  评论(0)    收藏  举报