Explorar o código

避免温度9999 的情况

xiaohaizhao hai 1 ano
pai
achega
4c422b073b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 {