| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <%@ page contentType="text/html;charset=GBK"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <script type="text/javascript" src="http://pv.sohu.com/cityjson" charset="gb2312"></script>
- <link type="text/css" rel="stylesheet" href="http://i.tq121.com.cn/c/weather2014/common.css" />
- <link type="text/css" rel="stylesheet" href="http://i.tq121.com.cn/c/core.css" />
- <link type="text/css" rel="stylesheet" href="http://i.tq121.com.cn/c/weather2014/city7d.css" />
- <script type="text/javascript">
- var ip;
- var city;
- window.onload=function(){
- loadweather();
- };
- function loadweather() {
- try {
- ip = returnCitySN["cip"];
- //alert(returnCitySN["cip"]+ ',' + returnCitySN["cname"])
- $.ajax({
- type : "POST",
- url : "weatherForecastAction.do?task=weatherData",
- data : {
- "ip" : ip
- },
- timeout : 1000000,
- cache : false,
- dataType : "json",
- success : function(data) {
- var showapi_res_body = data.showapi_res_body;
- var cityInfo = showapi_res_body.cityInfo;
- city = cityInfo.c3;
- var f1 = showapi_res_body.f1;
- var f2 = showapi_res_body.f2;
- var f3 = showapi_res_body.f3;
- var f4 = showapi_res_body.f4;
- var f5 = showapi_res_body.f5;
- var f6 = showapi_res_body.f6;
- var f7 = showapi_res_body.f7;
- weatherData(f1, 1);
- weatherData(f2, 2);
- weatherData(f3, 3);
- weatherData(f4, 4);
- weatherData(f5, 5);
- weatherData(f6, 6);
- weatherData(f7, 7);
- },
- error : function(data) {
- //alert(data);
- }
- });
- } catch (e) {
- }
- }
-
- function viewAllWeather() {
- var title = city + "七天天气预报"
- $.ligerDialog.open({
- target : $("#target_weather"),
- title : title,
- width : 720,
- height : 350
- });
- };
- function colse() {
- $.ligerDialog.hide();
- $.ligerDialog.colse();
- }
- function weatherData(f, n) {
- var day = f.day;
- var day_air_temperature = f.day_air_temperature;
- var day_weather = f.day_weather;
- var day_weather_pic = f.day_weather_pic;
- var night_air_temperature = f.night_air_temperature;
- var night_weather = f.night_weather;
- var night_weather_pic = f.night_weather_pic;
- var weekday = f.weekday;
- var show_weather = "";
- if (day_weather == night_weather) {
- show_weather = day_weather
- } else {
- show_weather = day_weather + "转" + night_weather
- }
- if (n == 1) {
- var weather = city + " " + show_weather + " " + day_air_temperature
- + "°C~" + night_air_temperature + "°C";
- $("#showWeather").html(weather);
- }
- day = day.substring(6, 8);
- $("#day_7d" + n).html(day + "日");
- $("#d_img_7d" + n).attr("src", day_weather_pic);
- $("#n_img_7d" + n).attr("src", night_weather_pic);
- $("#weather_7d" + n).html(show_weather);
- $("#d_temp_7d" + n).html(day_air_temperature);
- $("#n_temp_7d" + n).html(night_air_temperature);
- if (n > 3) {
- if (weekday == 1) {
- weekday = "周一";
- } else if (weekday == 2) {
- weekday = "周二";
- } else if (weekday == 3) {
- weekday = "周三";
- } else if (weekday == 4) {
- weekday = "周四";
- } else if (weekday == 5) {
- weekday = "周五";
- } else if (weekday == 6) {
- weekday = "周六";
- } else if (weekday == 7) {
- weekday = "周日";
- }
- $("#h1_7d" + n).html(weekday);
- }
- }
- </script>
- <div style="padding-top: 10px;">
- <a> <span id="showWeather"
- style="text-align: right; padding-right: 20px; padding-top: 10px; color: white;"
- onclick="viewAllWeather();"> </span>
- </a>
- </div>
- <div id="target_weather"
- style="width: 200px; height: 200px; margin: 3px; display: none;">
- <div>
- <div class="con d7 clearfix">
- <div class="left fl">
- <!--今明后7d大包 begin-->
- <div id="tabDays">
- <div class="m m1" id="today">
- <ul class="t clearfix">
- <!-- 实况 begin-->
- <!-- 实况 end-->
- <!-- 今天明天预报 begin-->
- <!-- 今天明天预报 end-->
- </ul>
- <i class="line1"></i> <i class="line2"></i> <i class="line3"></i>
- </div>
- <div class="m m2" id="2_3d">
- <!-- 明天后天预报 begin-->
- <i class="line1"></i> <i class="line2"></i>
- <!-- 明天后天预报 end-->
- </div>
- <div class="m m3" id="7d">
- <ul class="t clearfix">
- <li class='dn' data-dn='7d1'>
- <h1>今天</h1>
- <h2 id="day_7d1">19日</h2> <img id="d_img_7d1" width="50px;"
- src="" /> <img id="n_img_7d1" width="50px;" src="" />
- <p id="weather_7d1" class="wea">阵雨转多云</p>
- <p class="tem tem1">
- <span id="d_temp_7d1">32</span><i>°C</i>
- </p>
- <p class="tem tem2">
- <span id="n_temp_7d1">25</span><i>°C</i>
- </p>
- </li>
- <i class="line1"></i>
- <li class='dn' data-dn='7d2'>
- <h1>明天</h1>
- <h2 id="day_7d2">20日</h2> <img id="d_img_7d2" width="50px;"
- src="" /> <img id="n_img_7d2" width="50px;" src="" />
- <p id="weather_7d2" class="wea">阴转多云</p>
- <p class="tem tem1">
- <span id="d_temp_7d2">34</span><i>°C</i>
- </p>
- <p class="tem tem2">
- <span id="n_temp_7d2">25</span><i>°C</i>
- </p>
- </li>
- <li class='dn' data-dn='7d3'>
- <h1>后天</h1>
- <h2 id="day_7d3">21日</h2> <img id="d_img_7d3" width="50px;"
- src="" /> <img id="n_img_7d3" width="50px;" src="" />
- <p id="weather_7d3" class="wea">多云</p>
- <p class="tem tem1">
- <span id="d_temp_7d3">35</span><i>°C</i>
- </p>
- <p class="tem tem2">
- <span id="n_temp_7d3">26</span><i>°C</i>
- </p>
- </li>
- <li class='dn' data-dn='7d4'>
- <h1 id="h1_7d4">周六</h1>
- <h2 id="day_7d4">22日</h2> <img id="d_img_7d4" width="50px;"
- src="" /> <img id="n_img_7d4" width="50px;" src="" />
- <p id="weather_7d4" class="wea">阵雨</p>
- <p class="tem tem1">
- <span id="d_temp_7d4">31</span><i>°C</i>
- </p>
- <p class="tem tem2">
- <span id="n_temp_7d4">25</span><i>°C</i>
- </p>
- </li>
- <li class='dn' data-dn='7d5'>
- <h1 id="h1_7d5">周日</h1>
- <h2 id="day_7d5">23日</h2> <img id="d_img_7d5" width="50px;"
- src="" /> <img id="n_img_7d5" width="50px;" src="" />
- <p id="weather_7d5" class="wea">阵雨转阴</p>
- <p class="tem tem1">
- <span id="d_temp_7d5">32</span><i>°C</i>
- </p>
- <p class="tem tem2">
- <span id="n_temp_7d5">24</span><i>°C</i>
- </p>
- </li>
- <li class='dn' data-dn='7d6'>
- <h1 id="h1_7d6">周一</h1>
- <h2 id="day_7d6">24日</h2> <img id="d_img_7d6" width="50px;"
- src="" /> <img id="n_img_7d6" width="50px;" src="" />
- <p id="weather_7d6" class="wea">多云</p>
- <p class="tem tem6">
- <span id="d_temp_7d6">31</span><i>°C</i>
- </p>
- <p class="tem tem2">
- <span id="n_temp_7d6">24</span><i>°C</i>
- </p>
- </li>
- <li class='dn' data-dn='7d7'>
- <h1 id="h1_7d7">周二</h1>
- <h2 id="day_7d7">25日</h2> <img id="d_img_7d7" width="50px;"
- src="" /> <img id="n_img_7d7" width="50px;" src="" />
- <p id="weather_7d7" class="wea">多云</p>
- <p class="tem tem1">
- <span id="d_temp_7d7">32</span><i>°C</i>
- </p>
- <p class="tem tem2">
- <span id="n_temp_7d7">24</span><i>°C</i>
- </p>
- </li>
- </ul>
- <i class="line1"></i>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
|