From 25f7540f867c8bc4890d2aaf09ad8efb7f7d109b Mon Sep 17 00:00:00 2001 From: ElapsingDreams <159739277+ElapsingDreams@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:40:34 +0800 Subject: [PATCH] Add Dev judgment --- .../liteyuki_weather/templates/js/weather_now.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/resources/liteyuki_weather/templates/js/weather_now.js b/src/resources/liteyuki_weather/templates/js/weather_now.js index 1d92da3b..907c9db5 100644 --- a/src/resources/liteyuki_weather/templates/js/weather_now.js +++ b/src/resources/liteyuki_weather/templates/js/weather_now.js @@ -34,7 +34,13 @@ if ("aqi" in aqi) { if (item["defaultLocalAqi"]) { document.getElementById("aqi-data").innerText = "AQI " + item["valueDisplay"] + " " + item["category"] // 将(255,255,255)这种格式的颜色设置给css - document.getElementById("aqi-dot").style.backgroundColor = "rgb(" + item["color"] + ")" + if(is_dev == 1){ + //开发版 + document.getElementById("aqi-dot").style.backgroundColor = "rgb(" + item["color"]['red'] + "," + item["color"]['green'] + "," + item["color"]['blue'] + "," + item["color"]['alpha'] + ")" + }else{ + //正式版 + document.getElementById("aqi-dot").style.backgroundColor = "rgb(" + item["color"] + ")" + } } } )