书签 分享 收藏 举报 版权申诉 / 19

类型PHP天气API接口.docx

  • 文档编号:6265143
  • 上传时间:2023-01-04
  • 格式:DOCX
  • 页数:19
  • 大小:20.89KB

  • varweatherInfo;

    varlunar;

    vardate=newDate();

    varg={"晴":

    "00px","多云":

    "0-40px","暴雪":

    "0-480px","大雪-暴雪":

    "0-480px","暴雨":

    "0-360px","大雨-暴雨":

    "0-360px","暴雨-大暴雨":

    "0-360px","大暴雨-特大暴雨":

    "0-360px","大暴雪":

    "0-480px","飑":

    "0-880px","大雪":

    "0-440px","中雪-大雪":

    "0-440px","大雨":

    "0-320px","中雨-大雨":

    "0-320px","浮层":

    "0-920px","雷阵雨":

    "0-160px","雷阵雨并伴有冰雹":

    "0-200px","霾":

    "0-920px","轻雾":

    "0-840px","雾":

    "0-840px","冰雹":

    "0-680px","沙尘暴":

    "0-760px","强沙尘暴":

    "0-760px","特大暴雪":

    "0-520px","小雪":

    "0-600px","小雨":

    "0-240px","扬沙":

    "0-720px","浮尘":

    "0-920px","龙卷风":

    "0-800px","弱高吹雪":

    "0-600px","阴":

    "0-80px","雨夹雪":

    "0-400px","冻雨":

    "0-960px","阵雪":

    "0-560px","阵雨":

    "0-120px","中雪":

    "0-640px","小雪-中雪":

    "0-640px","小雨-中雨":

    "0-280px","中雨":

    "0-280px"};

    $(document).ready(function(){

    $("#weekday").html(date.getDate());

    $.getScript("getWeather.php");

    $.getScript("lunar.php");

    });

    varweather=function(data){

    weatherInfo=data;

    $(".cityWrap.name").html(data.weatherinfo.city);

    $(".cityInfo.name").html(data.weatherinfo.weather1);

    $(".cityWrap.info").html(data.weatherinfo.city_en);

    $(".cityInfo.info").html(data.weatherinfo.st1+"℃");

    $(".weapic").css("background-position",g[data.weatherinfo.weather1]).show();

    }

    varlunar=function(data){

    lunar=data;

    varmonth=data.month;

    varday=data.day;

    $("#lunarday").html("农历"+month+day);

    $("#dateday").html(date.getFullYear()+"."+(date.getMonth()+1)+"."+date.getDate()+" "+getWeek(date.getDay()));

    }

    vargetWeek=function(day){

    switch(day){

    case0:

    return"周一";

    case1:

    return"周二";

    case2:

    return"周三";

    case3:

    return"周四";

    case4:

    return"周五";

    case5:

    return"周六";

    case6:

    return"周日";

    }

    }

    @charset"utf-8";

    *{

    padding:

    0;

    margin:

    0;

    border:

    none;

    text-decoration:

    none;

    list-style:

    none;

    overflow:

    hidden;

    }

    input,button,select,textarea{

    outline:

    none;

    }

    textarea{

    font-size:

    13px;

    resize:

    none;

    }

    body{

    background:

    #F2F2F2url(topcenterno-repeat;

    }

    .top{

    width:

    100%;

    height:

    65px;

    }

    .top_content{

    width:

    960px;

    height:

    65px;

    margin:

    0auto;

    }

    #calendarArea{

    width:

    155px;

    height:

    65px;

    float:

    left;

    cursor:

    pointer;

    padding-left:

    15px;

    }

    #calendarArea:

    hover,#topWeatherArea:

    hover{

    background:

    url(topright;

    }

    .datepic{

    background-image:

    url(

    background-repeat:

    no-repeat;

    width:

    31px;

    height:

    32px;

    float:

    left;

    text-align:

    center;

    font-size:

    16px;

    font-weight:

    bold;

    line-height:

    32px;

    display:

    block;

    margin:

    15px10px00;

    float:

    left;

    }

    #weekday{

    position:

    relative;

    top:

    4px;

    color:

    #fff;

    }

    #calendarAreaul{

    float:

    left;

    color:

    #fff;

    height:

    40px;

    padding-top:

    13px;

    padding-left:

    3px;

    }

    #calendarArea#lunarday{

    font-size:

    16px;

    font-weight:

    bold;

    }

    #calendarArea#dateday{

    font-size:

    14px;

    }

    #topWeatherArea{

    width:

    165px;

    height:

    65px;

    float:

    left;

    cursor:

    pointer;

    color:

    #fff;

    padding-left:

    10px;

    }

    .cityWrap{

    float:

    left;

    margin-top:

    15px;

    padding-left:

    5px;

    }

    .weapic{

    width:

    40px;

    height:

    40px;

    background-image:

    url(

    float:

    left;

    display:

    block;

    margin:

    15px5px05px;

    background-repeat:

    no-repeat;

    display:

    none;

    }

    .cityInfo{

    float:

    left;

    margin-top:

    15px;

    }

    .name{

    font-weight:

    bold;

    font-size:

    17px;

    }

    .info{

    font-size:

    14px;

    }

     

    php

    classLunar{

    public$MIN_YEAR=1891;

    public$MAX_YEAR=2100;

    public$lunarInfo=array(array(0,2,9,21936),array(6,1,30,9656),array(0,2,17,9584),array(0,2,6,21168),array(5,1,26,43344),array(0,2,13,59728),array(0,2,2,27296),array(3,1,22,44368),array(0,2,10,43856),array(8,1,30,19304),array(0,2,19,19168),array(0,2,8,42352),array(5,1,29,21096),array(0,2,16,53856),array(0,2,4,55632),array(4,1,25,27304),array(0,2,13,22176),array(0,2,2,39632),array(2,1,22,19176),array(0,2,10,19168),array(6,1,30,42200),array(0,2,18,42192),array(0,2,6,53840),array(5,1,26,54568),array(0,2,14,46400),array(0,2,3,54944),array(2,1,23,38608),array(0,2,11,38320),array(7,2,1,18872),array(0,2,20,18800),array(0,2,8,42160),array(5,1,28,45656),array(0,2,16,27216),array(0,2,5,27968),array(4,1,24,44456),array(0,2,13,11104),array(0,2,2,38256),array(2,1,23,18808),array(0,2,10,18800),array(6,1,30,25776),array(0,2,17,54432),array(0,2,6,59984),array(5,1,26,27976),array(0,2,14,23248),array(0,2,4,11104),array(3,1,24,37744),array(0,2,11,37600),array(7,1,31,51560),array(0,2,19,51536),array(0,2,8,54432),array(6,1,27,55888),array(0,2,15,46416),array(0,2,5,22176),array(4,1,25,43736),array(0,2,13,9680),array(0,2,2,37584),array(2,1,22,51544),array(0,2,10,43344),array(7,1,29,46248),array(0,2,17,27808),array(0,2,6,46416),array(5,1,27,21928),array(0,2,14,19872),array(0,2,3,42416),array(3,1,24,21176),array(0,2,12,21168),array(8,1,31,43344),array(0,2,18,59728),array(0,2,8,27296),array(6,1,28,44368),array(0,2,15,43856),array(0,2,5,19296),array(4,1,25,42352),array(0,2,13,42352),array(0,2,2,21088),array(3,1,21,59696),array(0,2,9,55632),array(7,1,30,23208),array(0,2,17,22176),array(0,2,6,38608),array(5,1,27,19176),array(0,2,15,19152),array(0,2,3,42192),array(4,1,23,53864),array(0,2,11,53840),array(8,1,31,54568),array(0,2,18,46400),array(0,2,7,46752),array(6,1,28,38608),array(0,2,16,38320),array(0,2,5,18864),array(4,1,25,42168),array(0,2,13,42160),array(10,2,2,45656),array(0,2,20,27216),array(0,2,9,27968),array(6,1,29,44448),array(0,2,17,43872),array(0,2,6,38256),array(5,1,27,18808),array(0,2,15,18800),array(0,2,4,25776),array(3,1,23,27216),array(0,2,10,59984),array(8,1,31,27432),array(0,2,19,23232),array(0,2,7,43872),array(5,1,28,37736),array(0,2,16,37600),array(0,2,5,51552),array(4,1,24,54440),array(0,2,12,54432),array(0,2,1,55888),array(2,1,22,23208),array(0,2,9,22176),array(7,1,29,43736),array(0,2,18,9680),array(0,2,7,37584),array(5,1,26,51544),array(0,2,14,43344),array(0,2,3,46240),array(4,1,23,46416),array(0,2,10,44368),array(9,1,31,21928),array(0,2,19,19360),array(0,2,8,42416),array(6,1,28,21176),array(0,2,16,21168),array(0,2,5,43312),array(4,1,25,29864),array(0,2,12,27296),array(0,2,1,44368),array(2,1,22,19880),array(0,2,10,19296),array(6,1,29,42352),array(0,2,17,42208),array(0,2,6,53856),array(5,1,26,59696),array(0,2,13,54576),array(0,2,3,23200),array(3,1,23,27472),array(0,2,11,38608),array(11,1,31,19176),array(0,2,19,19152),array(0,2,8,42192),array(6,1,28,53848),array(0,2,15,53840),array(0,2,4,54560),array(5,1,24,55968),array(0,2,12,46496),array(0,2,1,22224),array(2,1,22,19160),array(0,2,10,18864),array(7,1,30,42168),array(0,2,17,42160),array(0,2,6,43600),array(5,1,26,46376),array(0,2,14,27936),array(0,2,2,44448),array(3,1,23,21936),array(0,2,11,37744),array(8,2,1,18808),array(0,2,19,18800),array(0,2,8,25776),array(6,1,28,27216),array(0,2,15,59984),array(0,2,4,27424),array(4,1,24,43872),array(0,2,12,43744),array(0,2,2,37600),array(3,1,21,51568),array(0,2,9,51552),array(7,1,29,54440),array(0,2,17,54432),array(0,2,5,55888)

    配套讲稿:

    如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

    特殊限制:

    部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

    关 键  词:
    PHP 天气 API 接口
    提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
    关于本文
    本文标题:PHP天气API接口.docx
    链接地址:https://www.bdocx.com/doc/6265143.html
    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2022 冰点文档网站版权所有

    经营许可证编号:鄂ICP备2022015515号-1

    收起
    展开