shawenguan 1 an în urmă
părinte
comite
b2d3b5ec52
1 a modificat fișierele cu 6 adăugiri și 0 ștergeri
  1. 6 0
      Scripts/qweather/qweatherHelper.js

+ 6 - 0
Scripts/qweather/qweatherHelper.js

@@ -108,6 +108,8 @@ async function tryCheckWeather() {
     text += `所在城市:${cityStr}\n\n`;
 
     let wDataRet = await getWeatherNow(location);
+
+    let hasRain = false;
     let isWxNotify = false;
     if (wDataRet && wDataRet.code == 200) {
         let now = wDataRet.now;
@@ -127,8 +129,10 @@ async function tryCheckWeather() {
         } else if (now.text.indexOf('晴') > -1) {
 
         } else if (now.text.indexOf('雨') > -1) {
+            hasRain = true;
             isWxNotify = true;
         } else if (now.text.indexOf('雪') > -1) {
+            hasRain = true;
             isWxNotify = true;
         }
         text += '\n';
@@ -146,6 +150,7 @@ async function tryCheckWeather() {
             let timeLine = rainList[i];
             let date = new Date(timeLine.fxTime);
             if (timeLine.precip > 0) {
+                hasRain = true;
                 isWxNotify = true;
                 text += `${magicJS.formatDate(date, 'yyyy/MM/dd HH:mm:ss')}-${timeLine.precip}毫米\n`;
             } else {
@@ -166,6 +171,7 @@ async function tryCheckWeather() {
                 text += `${getSeverityText(warning.severity, warning.severityColor)}预警-${warning.typeName}:\n`;
                 text += `${warning.text}\n`;
             }
+            hasRain = true;
             isWxNotify = true;
         }
     }