From 1a5dddf9f8ca09da14f6abdeb0f125baffd9fc87 Mon Sep 17 00:00:00 2001
From: ZhuDongming <773644075@qq.com>
Date: Thu, 29 Aug 2019 10:33:08 +0800
Subject: [PATCH] 修改弹窗信息内容

---
 src/main/webapp/view/pollutionsource.jsp |   64 +++++++++++++-------------------
 1 files changed, 26 insertions(+), 38 deletions(-)

diff --git a/src/main/webapp/view/pollutionsource.jsp b/src/main/webapp/view/pollutionsource.jsp
index 41a309c..d353b31 100644
--- a/src/main/webapp/view/pollutionsource.jsp
+++ b/src/main/webapp/view/pollutionsource.jsp
@@ -133,24 +133,24 @@
     var w = new BMap.Point(sw.lng, latitude);
     var e = new BMap.Point(ne.lng, latitude);
     var dirPoint;
-    var humidity;
     var windLevel;
+    var condition;
     if (Object.keys(weatherInfoForecast).length === 0) {
         var windDir = weatherInfoToday["windDir"];
         dirPoint = getWindDir(windDir, dirPoint);
-        humidity = weatherInfoToday["humidity"];
         windLevel = weatherInfoToday["windLevel"];
+        condition = weatherInfoToday["condition"];
     } else {
         if (isToday) {
             var windDir = weatherInfoToday["windDir"];
             dirPoint = getWindDir(windDir, dirPoint);
-            humidity = weatherInfoToday["humidity"];
             windLevel = weatherInfoToday["windLevel"];
+            condition = weatherInfoToday["condition"];
         } else {
             var windDir = weatherInfoForecast["windDirDay"];
             dirPoint = getWindDir(windDir, dirPoint);
-            humidity = weatherInfoForecast["humidity"];
             windLevel = weatherInfoForecast["windLevelDay"];
+            condition = weatherInfoForecast["conditionDay"];
         }
     }
     var polyline = new BMap.Polyline([
@@ -165,49 +165,37 @@
     var winfowTextSource;
     var supplement;
     if (month == 12 || month == 1 || month == 2) {
-        if (humidity > 60 && windLevel < 2) {
-            supplement = "���������������������������60%���������������������2m/s������������������������������������������������������";
-        } else if (humidity > 80 && windLevel < 2) {
-            supplement = "���������������������������80%���������������������������������������������������������������������������������������������������������������������";
-        } else if (windLevel > 2) {
+        if (windLevel >= 3) {
             supplement = "���������������������������������������������������������������������������";
-        } else {
-            supplement = "������������������������������������������������";
         }
-        winfowTextSource = "<p style='height: 22px;line-height: 22px'>������������������������������������������������������������������������������������" + supplement + "</p>";
+        if (condition.indexOf("���") != -1) {
+            supplement = "������������������������������������������������������������������������";
+        }
+        winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������������������������������������������������" + supplement + "</p>";
     } else if (month == 3 || month == 4 || month == 5) {
-        if (humidity > 60 && windLevel < 2) {
-            supplement = "���������������������������60%���������������������2m/s������������������������������������������������������";
-        } else if (humidity > 80 && windLevel < 2) {
-            supplement = "���������������������������80%���������������������������������������������������������������������������������������������������������������������";
-        } else if (windLevel >= 2) {
-            supplement = "������������������������������������������������������������������������������";
-        } else {
-            supplement = "���������������������������������������������������";
+        if (windLevel >= 3) {
+            supplement = "���������������������������������������������������������������������������";
+        }
+        if (condition.indexOf("���") != -1) {
+            supplement = "������������������������������������������������������������������������";
         }
         winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������������������������������" + supplement + "</p>";
     } else if (month == 6 || month == 7) {
-        if (humidity > 60 && windLevel < 2) {
-            supplement = "���������������������������60%���������������������2m/s������������������������������������������������������";
-        } else if (humidity > 80 && windLevel < 2) {
-            supplement = "���������������������������80%���������������������������������������������������������������������������������������������������������������������";
-        } else if (windLevel > 2) {
-            supplement = "������������������������������������������������������������������������������";
-        } else {
-            supplement = "���������������������������������������������������";
+        if (windLevel >= 3) {
+            supplement = "������������������������������������";
         }
-        winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������" + supplement + "</p>";
+        if (condition.indexOf("���") != -1) {
+            supplement = "���������������������������������������������������������������������������";
+        }
+        winfowTextSource = "<p style='height: 22px;line-height: 22px'>���������������������������������������,���������������������" + supplement + "</p>";
     } else if (month == 8 || month == 9 || month == 10 || month == 11) {
-        if (humidity > 60 && windLevel < 2) {
-            supplement = "���������������������������60%���������������������2m/s������������������������������������������������������";
-        } else if (humidity > 80 && windLevel < 2) {
-            supplement = "���������������������������80%���������������������������������������������������������������������������������������������������������������������";
-        } else if (windLevel > 2) {
-            supplement = "������������������������������������������������������������������������������";
-        } else {
-            supplement = "���������������������������������������������������";
+        if (windLevel >= 3) {
+            supplement = "������������������������������������������";
         }
-        winfowTextSource = "<p style='height: 22px;line-height: 22px'>������������������������������������������������������������������" + supplement + "</p>";
+        if (condition.indexOf("���") != -1) {
+            supplement = "������������������������������������������������������������������������";
+        }
+        winfowTextSource = "<p style='height: 22px;line-height: 22px'>������������������������������������������������������������������������������������������������������" + supplement + "</p>";
     }
 
     var winfowText = '<div style="height:150px;" >';

--
Gitblit v1.8.0