Merge branch 'main' of https://gitlab.guxuan.icu/Leo_Ding/JinShan_uniapp
This commit is contained in:
commit
76660dd3f4
@ -39,7 +39,7 @@
|
||||
<view class="weather-content">
|
||||
<view class="weather-main">
|
||||
<view class="current-weather">
|
||||
<image class="weather-icon" :src="getWeatherIcon(weather.weather)" mode="aspectFit">
|
||||
<image class="weather-icon" :src="weather.weather ? getWeatherIcon(weather.weather) : '/static/imgs/weather/default.png'" mode="aspectFit"></image>
|
||||
</image>
|
||||
<text class="current-temp">{{weather.real}}°</text>
|
||||
</view>
|
||||
@ -197,6 +197,10 @@
|
||||
},
|
||||
|
||||
getWeatherIcon(weather) {
|
||||
if (!weather || typeof weather !== 'string') {
|
||||
return '/static/imgs/weather/default.png';
|
||||
}
|
||||
|
||||
const weatherMap = {
|
||||
'晴': '/static/imgs/index/sunny.png',
|
||||
'多云': '/static/imgs/index/cloudy.png',
|
||||
|
||||
BIN
static/imgs/index/heavy-rain.png
Normal file
BIN
static/imgs/index/heavy-rain.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
BIN
static/imgs/index/light-rain.png
Normal file
BIN
static/imgs/index/light-rain.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
BIN
static/imgs/index/moderate-rain.png
Normal file
BIN
static/imgs/index/moderate-rain.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
BIN
static/imgs/index/storm-rain.png
Normal file
BIN
static/imgs/index/storm-rain.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
Loading…
x
Reference in New Issue
Block a user