Browse Source

避免温度9999 的情况

xiaohaizhao 1 year ago
parent
commit
4c422b073b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pages/index/modules/home.vue

+ 1 - 1
pages/index/modules/home.vue

@@ -87,7 +87,7 @@ export default {
 					} else {
 						this.setCustomBar(66);
 						let detail = res.data.predict.detail[0];
-						this.weather = `${getWeek()} ${getYMD().split("年")[1]} | ${detail.night.weather.temperature}~${detail.day.weather.temperature}℃ ${res.data.real.weather.info}`
+						this.weather = `${getWeek()} ${getYMD().split("年")[1]} | ${detail.day.weather.temperature == '9999' ? detail.night.weather.temperature : detail.night.weather.temperature + '~' + detail.day.weather.temperature}℃ ${res.data.real.weather.info}`
 					}
 				})
 			} else {