diff --git a/src/project/wuxi/AppHome/AppHome.vue b/src/project/wuxi/AppHome/AppHome.vue index fa43334..c7479e6 100644 --- a/src/project/wuxi/AppHome/AppHome.vue +++ b/src/project/wuxi/AppHome/AppHome.vue @@ -3,10 +3,10 @@
-

- - 今天:多云 26℃ ~ 34℃ 无持续风向<4级 -

+
+ +

今天:{{weatherInfo.wea}}{{weatherInfo.tem2}}~{{weatherInfo.tem1}},{{weatherInfo.air_tips}}

+
@@ -26,7 +26,6 @@
-
@@ -94,6 +93,7 @@ export default { backgroundSize: 'cover', }, appList: [], //应用列表 + weatherInfo: {} } }, computed: { @@ -120,6 +120,7 @@ export default { this.getActive(); this.getNotice(); this.getAppList() + this.getWeather() }) }, methods: { @@ -262,7 +263,15 @@ export default { }else { //type0 内置应用 uni.navigateTo({url: row.modulePath}) } - } + }, + getWeather() { + this.$instance.post("/app/weather/queryWeather", {cityId: 101041800}, { withoutToken: true }).then(res => { + if (res.data) { + this.weatherInfo = res.data + this.weatherInfo.icon = 'https://cdn.cunwuyun.cn/wuxi/home/weather-'+this.weatherInfo.wea_img+'.png' + } + }) + }, }, onShareAppMessage() { @@ -294,12 +303,16 @@ export default { font-size: 28px; color: #222; padding: 12px 34px; + display: flex; img { width: 56px; height: 52px; margin-right: 12px; vertical-align: middle; } + p { + width: calc(100% - 68px); + } } .swiper-content { width: 686px;