|
@@ -939,23 +939,24 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
getWeather(day) {
|
|
|
- let that = this
|
|
|
//右侧获取天气信息
|
|
|
- getWeather({ day: day }).then(res => {
|
|
|
+ getWeather({
|
|
|
+ day: day
|
|
|
+ }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- if (res.msg == '天气未添加') {
|
|
|
+ if (res.data.length == 0) {
|
|
|
this.todatWeather = false
|
|
|
} else {
|
|
|
this.todatWeather = true
|
|
|
- this.weatherinformationDirection = res.data.weatherinformationDirection
|
|
|
- this.weatherinformationHigh = res.data.weatherinformationHigh
|
|
|
- this.weatherinformationLevel = res.data.weatherinformationLevel
|
|
|
- this.weatherinformationLevelValue = res.data.weatherinformationLevelValue
|
|
|
- this.weatherinformationLow = res.data.weatherinformationLow
|
|
|
- this.weatherinformationPower = res.data.weatherinformationPower
|
|
|
- this.weatherinformationTemperature = res.data.weatherinformationTemperature
|
|
|
- this.weatherinformationTime = res.data.weatherinformationTime
|
|
|
- this.weatherinformationWeather = res.data.weatherinformationWeather
|
|
|
+ this.weatherinformationDirection = res.data[0].weatherinformationDirection
|
|
|
+ this.weatherinformationHigh = res.data[0].weatherinformationHigh
|
|
|
+ this.weatherinformationLevel = res.data[0].weatherinformationLevel
|
|
|
+ this.weatherinformationLevelValue = res.data[0].weatherinformationLevelValue
|
|
|
+ this.weatherinformationLow = res.data[0].weatherinformationLow
|
|
|
+ this.weatherinformationPower = res.data[0].weatherinformationPower
|
|
|
+ this.weatherinformationTemperature = res.data[0].weatherinformationTemperature
|
|
|
+ this.weatherinformationTime = res.data[0].weatherinformationTime
|
|
|
+ this.weatherinformationWeather = res.data[0].weatherinformationWeather
|
|
|
}
|
|
|
} else {
|
|
|
this.todatWeather = false
|