@ -504,23 +504,23 @@ export default {
let obj = response . data ;
let data = [ ] ;
for ( let key in obj ) {
if ( key === "weatherFacts1" ) {
obj [ key ] . name = "长清区" ;
} else if ( key === "weatherFacts2" ) {
obj [ key ] . name = "平阴县" ;
} else if ( key === "weatherFacts3" ) {
obj [ key ] . name = "东平县" ;
} else if ( key === "weatherFacts4" ) {
obj [ key ] . name = "汶上县" ;
} else if ( key === "weatherFacts5" ) {
obj [ key ] . name = "梁山县" ;
} else if ( key === "weatherFacts6" ) {
obj [ key ] . name = "嘉祥县" ;
} else if ( key === "weatherFacts7" ) {
obj [ key ] . name = "巨野县" ;
} else if ( key === "weatherFacts8" ) {
obj [ key ] . name = "郓城县" ;
}
/ / i f ( k e y = = = " w e a t h e r F a c t s 1 " ) {
/ / o b j [ k e y ] . n a m e = " 长 清 区 " ;
/ / } e l s e i f ( k e y = = = " w e a t h e r F a c t s 2 " ) {
/ / o b j [ k e y ] . n a m e = " 平 阴 县 " ;
/ / } e l s e i f ( k e y = = = " w e a t h e r F a c t s 3 " ) {
/ / o b j [ k e y ] . n a m e = " 东 平 县 " ;
/ / } e l s e i f ( k e y = = = " w e a t h e r F a c t s 4 " ) {
/ / o b j [ k e y ] . n a m e = " 汶 上 县 " ;
/ / } e l s e i f ( k e y = = = " w e a t h e r F a c t s 5 " ) {
/ / o b j [ k e y ] . n a m e = " 梁 山 县 " ;
/ / } e l s e i f ( k e y = = = " w e a t h e r F a c t s 6 " ) {
/ / o b j [ k e y ] . n a m e = " 嘉 祥 县 " ;
/ / } e l s e i f ( k e y = = = " w e a t h e r F a c t s 7 " ) {
/ / o b j [ k e y ] . n a m e = " 巨 野 县 " ;
/ / } e l s e i f ( k e y = = = " w e a t h e r F a c t s 8 " ) {
/ / o b j [ k e y ] . n a m e = " 郓 城 县 " ;
/ / }
data . push ( obj [ key ] ) ;
}
this . weatherList = data ;
@ -534,26 +534,27 @@ export default {
console . log ( "this.selectIndex" , this . selectIndex ) ;
let obj = response . data ;
console . log ( "obj" , obj ) ;
let data = [ ] ;
for ( let key in obj ) {
if ( key === "hourlyWeather1" ) {
console . log ( "obj[key]" , obj [ key ] [ id - 1 ] ) ;
obj [ key ] [ id - 1 ] . name = "长清区" ;
} else if ( key === "hourlyWeather2" ) {
obj [ key ] [ id - 1 ] . name = "平阴县" ;
} else if ( key === "hourlyWeather3" ) {
obj [ key ] [ id - 1 ] . name = "东平县" ;
} else if ( key === "hourlyWeather4" ) {
obj [ key ] [ id - 1 ] . name = "汶上县" ;
} else if ( key === "hourlyWeather5" ) {
obj [ key ] [ id - 1 ] . name = "梁山县" ;
} else if ( key === "hourlyWeather6" ) {
obj [ key ] [ id - 1 ] . name = "嘉祥县" ;
} else if ( key === "hourlyWeather7" ) {
obj [ key ] [ id - 1 ] . name = "巨野县" ;
} else if ( key === "hourlyWeather8" ) {
obj [ key ] [ id - 1 ] . name = "郓城县" ;
}
/ / i f ( k e y = = = " h o u r l y W e a t h e r 1 " ) {
/ / c o n s o l e . l o g ( " o b j [ k e y ] " , o b j [ k e y ] [ i d - 1 ] ) ;
/ / o b j [ k e y ] [ i d - 1 ] . n a m e = " 长 清 区 " ;
/ / } e l s e i f ( k e y = = = " h o u r l y W e a t h e r 2 " ) {
/ / o b j [ k e y ] [ i d - 1 ] . n a m e = " 平 阴 县 " ;
/ / } e l s e i f ( k e y = = = " h o u r l y W e a t h e r 3 " ) {
/ / o b j [ k e y ] [ i d - 1 ] . n a m e = " 东 平 县 " ;
/ / } e l s e i f ( k e y = = = " h o u r l y W e a t h e r 4 " ) {
/ / o b j [ k e y ] [ i d - 1 ] . n a m e = " 汶 上 县 " ;
/ / } e l s e i f ( k e y = = = " h o u r l y W e a t h e r 5 " ) {
/ / o b j [ k e y ] [ i d - 1 ] . n a m e = " 梁 山 县 " ;
/ / } e l s e i f ( k e y = = = " h o u r l y W e a t h e r 6 " ) {
/ / o b j [ k e y ] [ i d - 1 ] . n a m e = " 嘉 祥 县 " ;
/ / } e l s e i f ( k e y = = = " h o u r l y W e a t h e r 7 " ) {
/ / o b j [ k e y ] [ i d - 1 ] . n a m e = " 巨 野 县 " ;
/ / } e l s e i f ( k e y = = = " h o u r l y W e a t h e r 8 " ) {
/ / o b j [ k e y ] [ i d - 1 ] . n a m e = " 郓 城 县 " ;
/ / }
data . push ( obj [ key ] ) ;
}
let newData = [ ] ;