|
@@ -32,7 +32,15 @@
|
|
|
<div class="main-right" v-show="isHome">
|
|
|
<i class="maxTem" v-if="alarm.maxTem" @click="openShow(0)"></i>
|
|
|
<i class="minTem" v-if="alarm.minTem" @click="openShow(1)"></i>
|
|
|
- <i class="shan" v-if="Object.keys(weatherInfo).length > 0" @click="openShow(2)"></i>
|
|
|
+ <template v-if="Object.keys(weatherInfo).length > 0">
|
|
|
+ <i class="shan" v-if="weatherInfo[0].type_name.indexOf('电') != -1" @click="openShow(2)"></i>
|
|
|
+ <i class="wu" v-if="weatherInfo[0].type_name.indexOf('雾') != -1" @click="openShow(2)"></i>
|
|
|
+ <i class="hanchao" v-if="weatherInfo[0].type_name.indexOf('寒潮') != -1" @click="openShow(2)"></i>
|
|
|
+ <i class="taifeng" v-if="weatherInfo[0].type_name.indexOf('台风') != -1" @click="openShow(2)"></i>
|
|
|
+ <i class="dafeng" style="width: 24px; height: 24px" v-if="weatherInfo[0].type_name.indexOf('大风') != -1" @click="openShow(2)"></i>
|
|
|
+ <i class="byu" style="width: 24px; height: 24px" v-if="weatherInfo[0].type_name.indexOf('暴雨') != -1" @click="openShow(2)"></i>
|
|
|
+ <i class="bxue" style="width: 24px; height: 24px" v-if="weatherInfo[0].type_name.indexOf('暴雪') != -1" @click="openShow(2)"></i>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
<div class="time" v-show="isHome">{{currentTime}}</div>
|
|
|
<div class="main-bottom">
|
|
@@ -45,7 +53,7 @@
|
|
|
<transition :name=" isHome ? 'moveL' : 'moveR' ">
|
|
|
<div id="weather" :class="[isHome ? 'weather1' : 'weather2']" v-if="showWeather">
|
|
|
<div class="dayWeather">
|
|
|
- <p class="weatherTitle"><strong>{{getFarmName()}}</strong> 今日:{{weather.day_weather}} {{weather.min_degree}}℃~{{weather.max_degree}}℃ {{weather.day_wind_direction}}{{weather.day_wind_power}}级</p>
|
|
|
+ <p class="weatherTitle"><strong>{{getFarmName()}}</strong> {{weather.location.replace(/,/g, '-')}} 今日:{{weather.day_weather}} {{weather.min_degree}}℃~{{weather.max_degree}}℃ {{weather.day_wind_direction}}{{weather.day_wind_power}}级</p>
|
|
|
<div class="dayFlex">
|
|
|
<div class="FlexIcon">
|
|
|
<i class="qing maxSize" v-if="weather.day_weather === '晴'"></i>
|
|
@@ -62,39 +70,22 @@
|
|
|
<i class="wu maxSize" v-else-if="weather.day_weather === '雾'"></i>
|
|
|
<span>{{weather.degree}}℃</span>
|
|
|
</div>
|
|
|
+ <div class="FlexInfo">
|
|
|
+ <p>空气质量:<span>{{weather.airQuility}}</span></p>
|
|
|
+ <p>空气湿度:<span>{{weather.humidity}}</span></p>
|
|
|
+ </div>
|
|
|
<div class="FlexInfo" v-if="Object.keys(weatherInfo).length > 0">
|
|
|
<p @click.stop="openShow(2)">{{weatherInfo[0].type_name}}{{weatherInfo[0].level_name}}预警</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-<!-- <div class="weatherList">-->
|
|
|
-<!-- <div class="grid">-->
|
|
|
-<!-- <div class="grid-title">今天</div>-->
|
|
|
-<!-- <div class="grid-content">当前天气:{{weather.day_weather}}</div>-->
|
|
|
-<!-- <div class="grid-content">当前气温:{{weather.degree}}℃</div>-->
|
|
|
-<!-- <div class="grid-content">最低温度:{{weather.min_degree}}℃</div>-->
|
|
|
-<!-- <div class="grid-content">最高温度:{{weather.max_degree}}℃</div>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <div class="grid">-->
|
|
|
-<!-- <div class="grid-title">明天</div>-->
|
|
|
-<!-- <div class="grid-content">当天天气:{{weather.tomorrow.day_weather}}</div>-->
|
|
|
-<!-- <div class="grid-content">最低温度:{{weather.tomorrow.min_degree}}℃</div>-->
|
|
|
-<!-- <div class="grid-content">最高温度:{{weather.tomorrow.max_degree}}℃</div>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <div class="grid">-->
|
|
|
-<!-- <div class="grid-title">后天</div>-->
|
|
|
-<!-- <div class="grid-content">当天天气:{{weather.towTomorrow.day_weather}}</div>-->
|
|
|
-<!-- <div class="grid-content">最低温度:{{weather.towTomorrow.min_degree}}℃</div>-->
|
|
|
-<!-- <div class="grid-content">最高温度:{{weather.towTomorrow.max_degree}}℃</div>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </div>-->
|
|
|
+ </div>0
|
|
|
<div class="chart">
|
|
|
<chart-weather :data="weatherList"></chart-weather>
|
|
|
</div>
|
|
|
<div class="weatherGrid">
|
|
|
<div>
|
|
|
<p>今日</p>
|
|
|
- <p style="display: inline-block; width: 24px; height: 24px;">
|
|
|
+ <p style="display: inline-block; width: 28px; height: 28px;">
|
|
|
<i class="qing" v-if="weather.day_weather === '晴'"></i>
|
|
|
<i class="duoyun" v-else-if="weather.day_weather === '多云'"></i>
|
|
|
<i class="yin" v-else-if="weather.day_weather === '阴'"></i>
|
|
@@ -114,7 +105,7 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<p>{{weather.tomorrow.weather_time}}</p>
|
|
|
- <p style="display: inline-block; width: 24px; height: 24px;">
|
|
|
+ <p style="display: inline-block; width: 28px; height: 28px;">
|
|
|
<i class="qing" v-if="weather.tomorrow.day_weather === '晴'"></i>
|
|
|
<i class="duoyun" v-else-if="weather.tomorrow.day_weather === '多云'"></i>
|
|
|
<i class="yin" v-else-if="weather.tomorrow.day_weather === '阴'"></i>
|
|
@@ -134,7 +125,7 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<p>{{weather.towTomorrow.weather_time}}</p>
|
|
|
- <p style="display: inline-block; width: 24px; height: 24px;">
|
|
|
+ <p style="display: inline-block; width: 28px; height: 28px;">
|
|
|
<i class="qing" v-if="weather.towTomorrow.day_weather === '晴'"></i>
|
|
|
<i class="duoyun" v-else-if="weather.towTomorrow.day_weather === '多云'"></i>
|
|
|
<i class="yin" v-else-if="weather.towTomorrow.day_weather === '阴'"></i>
|
|
@@ -154,7 +145,7 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<p>{{weather.threeTomorrow.weather_time}}</p>
|
|
|
- <p style="display: inline-block; width: 24px; height: 24px;">
|
|
|
+ <p style="display: inline-block; width: 28px; height: 28px;">
|
|
|
<i class="qing" v-if="weather.threeTomorrow.day_weather === '晴'"></i>
|
|
|
<i class="duoyun" v-else-if="weather.threeTomorrow.day_weather === '多云'"></i>
|
|
|
<i class="yin" v-else-if="weather.threeTomorrow.day_weather === '阴'"></i>
|
|
@@ -474,7 +465,7 @@ export default {
|
|
|
background-color: rgba(0, 0, 0, .8);
|
|
|
position: absolute;
|
|
|
width: 700px;
|
|
|
- height: 800px;
|
|
|
+ height: 700px;
|
|
|
top: 0;
|
|
|
}
|
|
|
.weather1 {
|
|
@@ -701,6 +692,33 @@ export default {
|
|
|
margin-top: 10px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+ .hanchao {
|
|
|
+ display: inline-block;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ background: url('../assets/weather/hanchao.png');
|
|
|
+ background-size: contain;
|
|
|
+ margin-top: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .taifeng {
|
|
|
+ display: inline-block;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ background: url('../assets/weather/taifeng.png');
|
|
|
+ background-size: contain;
|
|
|
+ margin-top: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .dafeng {
|
|
|
+ display: inline-block;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ background: url('../assets/weather/dafeng.png');
|
|
|
+ background-size: contain;
|
|
|
+ margin-top: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
.alarmlist {
|
|
|
width: 200px;
|
|
|
height: 100px;
|
|
@@ -793,12 +811,12 @@ export default {
|
|
|
}
|
|
|
.chart {
|
|
|
width: 100%;
|
|
|
- height: calc(100% - 350px);
|
|
|
+ height: calc(100% - 400px);
|
|
|
}
|
|
|
.weatherGrid {
|
|
|
width: 100%;
|
|
|
box-sizing: border-box;
|
|
|
- height: 150px;
|
|
|
+ height: 200px;
|
|
|
display: grid;
|
|
|
grid-template-columns: repeat(4, 1fr);
|
|
|
grid-template-rows: 1fr;
|
|
@@ -813,6 +831,7 @@ export default {
|
|
|
color: #fff;
|
|
|
box-sizing: border-box;
|
|
|
padding-top: 10px;
|
|
|
+ font-size: 18px;
|
|
|
}
|
|
|
.weatherGrid > div:nth-child(2) {
|
|
|
border-left: none;
|