Commit b9477951 authored by 崔佳豪's avatar 崔佳豪

perf: 仅有一个站点时,不展示站点选择器

parent 69f3c61e
Pipeline #48433 passed with stages
in 2 minutes 27 seconds
......@@ -172,7 +172,7 @@ const renderSite = ({ data, config, loading, setLoading, action }) => {
onVisibleChange={visible => setVisible(visible)}
>
{
Array.isArray(data.stations) ? (
Array.isArray(data.allStation) && Array.isArray(data.allStation).length > 1 ? (
<div className={layoutStyles.toggleSite}>
<img src={require('../assets/basic/site.png')} className={layoutStyles.site} />
<span className={layoutStyles.name}>{data.currentStationName}</span>
......
......@@ -204,6 +204,7 @@ class Site {
);
resolve({
stations,
allStation,
weathers: {
icon: `https://panda-water.cn/web4/assets/images/weather2/${imgPath}`,
text: `${text} ${firtValue.temperatureFirst}`,
......@@ -216,6 +217,7 @@ class Site {
} else {
resolve({
stations,
allStation,
siteCityList: self.siteCityList,
citySelector: self.citySelector,
currentStationName: self.currentStationName,
......@@ -226,6 +228,7 @@ class Site {
.catch(error => {
resolve({
stations,
allStation,
currentStationName: self.currentStationName,
weathers: {},
siteCityList: self.siteCityList,
......@@ -235,6 +238,7 @@ class Site {
} else {
resolve({
stations,
allStation,
currentStationName: self.currentStationName,
weathers: {},
siteCityList: self.siteCityList,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment