# getWeatherInfo ^5.0.0
根据城市对应的气象局ID获取城市天气信息,比如温度,风向等信息
# 请求参数
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
param | Object | Y | {}属性: cityNo:{Type: String, Default: N/A, Description: 城市对应气象局ID } | 请求参数 |
# 接口调用示例
this.$bridge
.getWeatherInfo(param)
.then(res => {
this.$alert(res)
})
.catch(err => {
this.$toast(err)
})
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
# 返回参数
- 成功时返回
| Prop | Type | Default | Description |
|---|---|---|---|
status | Number | 0/1 | 0 成功 |
grade | String | N/A | 温度 |
weatherStatus | String | N/A | 气象 |
windDirection | String | N/A | 风向 |
windForce | String | N/A | 风速 |
wetness | String | N/A | 湿度 |
aqi | String | N/A | 空气质量(0-50 优/51-100 良好/100+ 差) |
publicDate | String | N/A | 发布时间(15:30) |
- 失败时返回
| Prop | Type | Default | Description |
|---|---|---|---|
errorCode | Number | N/A | -1 请求失败 |
errorMessage | String | N/A | 错误消息(如有) |