麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

帶有天氣預報的高大上web報表制作分享

2019-11-14 23:29:00
字體:
來源:轉載
供稿:網友
帶有天氣預報的高大上web報表制作分享

我用FineReport開發了挺多報表,但集成天氣預報這樣提高交互和人性化的還是第一次,所以跟大家分享下。

這個報表是綜合的門店銷售管理分析面板,可以查詢業績分析、店員銷售分析,店鋪排行分析(可以看出是個連鎖店),Vip生日提醒。怎么具體制作模板,業內人士一看即明,無需多講,就重點說下怎么集成天氣吧。

先上圖:

方法是加一段JS代碼,具體如下:

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+'&deg;');    $('#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("<img src='"+T_weather_img+"' title='"+window.SWther.w[city][0].s1+"' alt='"+window.SWther.w[city][0].s1+"' /><br><span id=/"T_weather/"></span>");    //$('#T_temperature').html(window.SWther.w[city][0].t1+'~'+window.SWther.w[city][0].t2+'&deg;');    $('#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("<img src='"+M_weather_img+"' title='"+window.SWther.w[city][1].s1+"' alt='"+window.SWther.w[city][1].s1+"' />");    $('#M_temperature').html(window.SWther.w[city][1].t1+'~'+window.SWther.w[city][1].t2+'&deg;');    $('#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("<img src='"+L_weather_img+"' title='"+window.SWther.w[city][2].s1+"' alt='"+window.SWther.w[city][2].s1+"' />");    $('#L_temperature').html(window.SWther.w[city][2].t1+'~'+window.SWther.w[city][2].t2+'&deg;');    $('#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');        };

如此,大功告成!


上一篇:MVC初識

下一篇:設計模式---策略模式

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 日本成人一区 | 在线观看免费av网 | 欧美片一区二区 | 亚洲视频黄 | 亚洲欧美日韩免费 | 日本成人午夜视频 | 成人综合一区二区 | 天天草夜夜爽 | 国产免费观看一区二区三区 | 精国品产一区二区三区有限公司 | 日韩视频观看 | 精品国产91久久久久久浪潮蜜月 | 国产精品成人av片免费看最爱 | 国产亚洲高清视频 | 斗破苍穹在线观看免费完整观看 | 亚洲精品久久久久久下一站 | 免费一级片网站 | av在线看网站 | 九九热精品在线视频 | 国产一区二区三区色淫影院 | 免费视频xxxx | 国产在线精品一区二区 | 成人三级电影网 | 欧美日韩国产一区二区三区在线观看 | 欧美在线观看视频一区 | h视频在线免费观看 | 日日综合| 久久草草亚洲蜜桃臀 | 精品亚洲一区二区 | 毛片毛片免费看 | 欧美日韩国产成人在线观看 | 国产免费永久在线观看 | 久久千人斩 | 久久一区三区 | 亚洲成人播放 | 亚洲自拍第一 | 国产乱淫av片免费 | 久草在线高清视频 | 免费看黄色三级毛片 | 特色一级黄色片 | 成人精品一区二区三区中文字幕 |