# 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)
})
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# 返回参数
- 成功时返回
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 |
← geoCode getGPSInfo →