|
|
@ -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 = "郓城县"; |
|
|
|
} |
|
|
|
// 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 = "郓城县"; |
|
|
|
// } |
|
|
|
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 = "郓城县"; |
|
|
|
} |
|
|
|
// 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 = "郓城县"; |
|
|
|
// } |
|
|
|
data.push(obj[key]); |
|
|
|
} |
|
|
|
let newData = []; |
|
|
|