php finereport,FineReport报表系统实例方案之集成天气预报的服装门店销售管理报表...

var weather=function(){

var tmp=0;

var SWther={w:[{}],add:{}};

var SWther={};

this.getWeather=function(city,type){

//city=utf8ToGBK(city);

/*

$.getScript(“http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&day=2&city=”+city+”&dfc=3″,function(){if(type==’js’){echo(city);}});

**/

$.ajax({

dataType:’script’,

scriptCharset:’gb2312′,

url:”http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&day=2&city=”+city+”&dfc=3″,

success:function(){

if(type==’js’){echo(city);}

}

})

}

function dis_img(weather){

var style_img=”image/s_13.png”;

if(weather.indexOf(“多云”)!==-1||weather.indexOf(“晴”)!==-1){style_img=”image/s_1.png”;}

else if(weather.indexOf(“多云”)!==-1&&weather.indexOf(“阴”)!==-1){style_img=”image/s_2.png”;}

else if(weather.indexOf(“阴”)!==-1&&weather.indexOf(“雨”)!==-1){style_img=”image/s_3.png”;}

else if(weather.indexOf(“晴”)!==-1&&weather.indexOf(“雨”)!==-1){style_img=”image/s_12.png”;}

else if(weather.indexOf(“晴”)!==-1&&weather.indexOf(“雾”)!==-1){style_img=”image/s_12.png”;}

else if(weather.indexOf(“晴”)!==-1){style_img=”image/s_13.png”;}

else if(weather.indexOf(“多云”)!==-1){style_img=”image/s_2.png”;}

else if(weather.indexOf(“阵雨”)!==-1){style_img=”image/s_3.png”;}

else if(weather.indexOf(“小雨”)!==-1){style_img=”image/s_3.png”;}

else if(weather.indexOf(“中雨”)!==-1){style_img=”image/s_4.png”;}

else if(weather.indexOf(“大雨”)!==-1){style_img=”image/s_5.png”;}

else if(weather.indexOf(“暴雨”)!==-1){style_img=”image/s_5.png”;}

else if(weather.indexOf(“冰雹”)!==-1){style_img=”image/s_6.png”;}

else if(weather.indexOf(“雷阵雨”)!==-1){style_img=”image/s_7.png”;}

else if(weather.indexOf(“小雪”)!==-1){style_img=”image/s_8.png”;}

else if(weather.indexOf(“中雪”)!==-1){style_img=”image/s_9.png”;}

else if(weather.indexOf(“大雪”)!==-1){style_img=”image/s_10.png”;}

else if(weather.indexOf(“暴雪”)!==-1){style_img=”image/s_10.png”;}

else if(weather.indexOf(“扬沙”)!==-1){style_img=”image/s_11.png”;}

else if(weather.indexOf(“沙尘”)!==-1){style_img=”image/s_11.png”;}

else if(weather.indexOf(“雾”)!==-1){style_img=”image/s_12.png”;}

else{style_img=”image/s_2.png”;}

return style_img;};

function echo(city){

$(‘#city’).html(city);

$(‘#weather’).html(window.SWther.w[city][0].s1);

$(‘#temperature’).html(window.SWther.w[city][0].t1+’°’);

$(‘#wind’).html(window.SWther.w[city][0].p1);

$(‘#direction’).html(window.SWther.w[city][0].d1);

var T_weather_img=dis_img(window.SWther.w[city][0].s1);

$(‘#T_weather_img’).html(“

%22+T_weather_img+%22

“);

//$(‘#T_temperature’).html(window.SWther.w[city][0].t1+’~’+window.SWther.w[city][0].t2+’°’);

$(‘#T_temperature’).html(window.SWther.w[city][0].t1);

$(‘#T_weather’).html(window.SWther.w[city][0].s1);

$(‘#T_wind’).html(window.SWther.w[city][0].p1);

$(‘#T_direction’).html(window.SWther.w[city][0].d1);

$(‘#M_weather’).html(window.SWther.w[city][1].s1);

var M_weather_img=dis_img(window.SWther.w[city][1].s1);

$(‘#M_weather_img’).html(“

%22+M_weather_img+%22“);

$(‘#M_temperature’).html(window.SWther.w[city][1].t1+’~’+window.SWther.w[city][1].t2+’°’);

$(‘#M_wind’).html(window.SWther.w[city][1].p1);

$(‘#M_direction’).html(window.SWther.w[city][1].d1);

$(‘#L_weather’).html(window.SWther.w[city][2].s1);

var L_weather_img=dis_img(window.SWther.w[city][2].s1);

$(‘#L_weather_img’).html(“

%22+L_weather_img+%22“);

$(‘#L_temperature’).html(window.SWther.w[city][2].t1+’~’+window.SWther.w[city][2].t2+’°’);

$(‘#L_wind’).html(window.SWther.w[city][2].p1);$(‘#L_direction’).html(window.SWther.w[city][2].d1);

}

}

//weather结束了

function jintian(){

weather_.getWeather(city,’js’);

};

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值