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 1/3] 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"] + ")" + } } } ) From cb84a7d0d9a5dcf293793704216826cf032f95b0 Mon Sep 17 00:00:00 2001 From: ElapsingDreams <159739277+ElapsingDreams@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:41:23 +0800 Subject: [PATCH 2/3] Add Dev judgment --- src/plugins/liteyuki_weather/qweather.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/liteyuki_weather/qweather.py b/src/plugins/liteyuki_weather/qweather.py index 709e52ee..0be60f10 100644 --- a/src/plugins/liteyuki_weather/qweather.py +++ b/src/plugins/liteyuki_weather/qweather.py @@ -94,7 +94,8 @@ async def get_weather_now_card(matcher: Matcher, event: T_MessageEvent, keyword: "weatherHourly": weather_hourly, "aqi" : aqi, "location" : location_data.dump(), - "localization" : get_local_data(ulang.lang_code) + "localization" : get_local_data(ulang.lang_code), + "is_dev": 1 if is_dev else 0 } }, ) From e9df67a661d01f0c193b178a0e961ba3d4f7587e Mon Sep 17 00:00:00 2001 From: ElapsingDreams <159739277+ElapsingDreams@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:55:58 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9DHot=20Fixed=20Dev=20judgment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/resources/liteyuki_weather/templates/js/weather_now.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/resources/liteyuki_weather/templates/js/weather_now.js b/src/resources/liteyuki_weather/templates/js/weather_now.js index 907c9db5..78c1c039 100644 --- a/src/resources/liteyuki_weather/templates/js/weather_now.js +++ b/src/resources/liteyuki_weather/templates/js/weather_now.js @@ -23,6 +23,7 @@ let weatherNow = data["weatherNow"] let weatherDaily = data["weatherDaily"] let weatherHourly = data["weatherHourly"] let aqi = data["aqi"] +let is_dev = data["is_dev"] let locationData = data["location"]