|
@@ -3,9 +3,18 @@
|
|
|
<span class="title">闵行区消防安全与综合救援管理平台</span>
|
|
|
<div class="day">{{ dateDay }}</div>
|
|
|
<div class="time">{{ dataTime }}</div>
|
|
|
+ <div class="homeIcon" v-if="$route.fullPath !== '/'">
|
|
|
+ <i class="el-icon-s-home" @click="$router.push({path: '/',})"></i>
|
|
|
+ </div>
|
|
|
<div class="weather">
|
|
|
- <img v-if="weatherObj.weather_pic" :src="weatherObj.weather_pic || ''" alt="">
|
|
|
- <span v-if="weatherObj.weather">{{weatherObj.weather}} {{weatherObj.temperature}}℃</span>
|
|
|
+ <img
|
|
|
+ v-if="weatherObj.weather_pic"
|
|
|
+ :src="weatherObj.weather_pic || ''"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <span v-if="weatherObj.weather"
|
|
|
+ >{{ weatherObj.weather }} {{ weatherObj.temperature }}℃</span
|
|
|
+ >
|
|
|
</div>
|
|
|
<el-row class="timeSelect">
|
|
|
<img src="~@a/img/home/circle_box.png" alt="" class="timeImage" />
|
|
@@ -39,7 +48,7 @@ export default {
|
|
|
return {
|
|
|
dateDay: "",
|
|
|
dataTime: "",
|
|
|
- weatherObj:{},
|
|
|
+ weatherObj: {},
|
|
|
dataWeekList: ["一", "二", "三", "四", "五", "六", "七"],
|
|
|
value1: [],
|
|
|
defaultTime: [
|
|
@@ -49,13 +58,14 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ console.log(this.$route)
|
|
|
this.value1 = this.$store.state.timeList.map((val) => {
|
|
|
return val;
|
|
|
});
|
|
|
this.getWeather();
|
|
|
setInterval(() => {
|
|
|
this.getWeather();
|
|
|
- },1000*60*30)
|
|
|
+ }, 1000 * 60 * 30);
|
|
|
},
|
|
|
mounted() {
|
|
|
setInterval(() => {
|
|
@@ -82,11 +92,12 @@ export default {
|
|
|
methods: {
|
|
|
async getWeather() {
|
|
|
let res = await this.$axios.get(
|
|
|
- "https://weather01.market.alicloudapi.com/area-to-weather"
|
|
|
+ '/aliWeather'
|
|
|
);
|
|
|
- if(res.showapi_res_code === 0){
|
|
|
- this.weatherObj = res.showapi_res_body.now
|
|
|
- console.log(this.weatherObj)
|
|
|
+ console.log(res)
|
|
|
+ if (res.showapi_res_code === 0) {
|
|
|
+ this.weatherObj = res.showapi_res_body.now;
|
|
|
+ console.log(this.weatherObj);
|
|
|
}
|
|
|
},
|
|
|
timeTypeClick(val) {
|
|
@@ -119,6 +130,16 @@ export default {
|
|
|
text-shadow: #275372 1px 0 0, #28bcfa 0 1px 0, #28bcfa -1px 0 0,
|
|
|
#28bcfa 0 -1px 0;
|
|
|
}
|
|
|
+ .homeIcon {
|
|
|
+ position: absolute;
|
|
|
+ right: .6875rem;
|
|
|
+ top: .0625rem;
|
|
|
+ font-size: .625rem;
|
|
|
+ color: #28bcfa;
|
|
|
+ i{
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
.day {
|
|
|
position: absolute;
|
|
|
left: 1.7rem;
|
|
@@ -138,20 +159,20 @@ export default {
|
|
|
color: #fbb03b;
|
|
|
font-family: "DS", "DS-B", "DS-BB", "DS-BS";
|
|
|
}
|
|
|
- .weather{
|
|
|
+ .weather {
|
|
|
position: absolute;
|
|
|
left: 5.375rem;
|
|
|
- top: 0.125rem;
|
|
|
+ top: .0625rem;
|
|
|
display: flex;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
- img{
|
|
|
+ img {
|
|
|
display: block;
|
|
|
- width: .375rem;
|
|
|
+ width: 0.375rem;
|
|
|
}
|
|
|
- span{
|
|
|
- font-size: .2rem;
|
|
|
- margin-left: .125rem;
|
|
|
+ span {
|
|
|
+ font-size: 0.2rem;
|
|
|
+ margin-left: 0.125rem;
|
|
|
}
|
|
|
}
|
|
|
.timeSelect {
|