From 04dc60723434d7e7b1ea5052e971c900b77d1cfc Mon Sep 17 00:00:00 2001
From: ZhuDongming <773644075@qq.com>
Date: Mon, 02 Sep 2019 11:07:12 +0800
Subject: [PATCH] 解决弹窗undefined
---
src/main/webapp/view/pollutionsource.jsp | 72 +++++++++++++++++-------------------
1 files changed, 34 insertions(+), 38 deletions(-)
diff --git a/src/main/webapp/view/pollutionsource.jsp b/src/main/webapp/view/pollutionsource.jsp
index 41a309c..0991f1b 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,45 @@
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 = "������������������������������������������������������������������������";
+ }else{
+ 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 = "������������������������������������������������������������������������";
+ }else{
+ 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 = "���������������������������������������������������������������������������";
+ }else{
+ 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 = "������������������������������������������������������������������������";
+ }else{
+ supplement ="";
+ }
+ winfowTextSource = "<p style='height: 22px;line-height: 22px'>������������������������������������������������������������������������������������������������������" + supplement + "</p>";
}
var winfowText = '<div style="height:150px;" >';
--
Gitblit v1.8.0