|
|
@@ -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;
|
|
|
}
|
|
|
}
|