﻿function DarenXXL() {
    /// <summary>新势力家园达人展示</summary>
    
    var PhotoHtml = "";
    //var url = "http://photo.xsl.shangdu.com/Photo/GroupJsonData/GetPhotoTopJson.aspx?uid=" + userID + "&callback=?";
    var url = "http://dr.up.online.cn/GetJsonData/GetDaRenAndNewsList.aspx";
    $.ajax({
        type: "get",
        dataType: "jsonp",
        url: url,
        success: function(data) {
            if (data == "") {
                $("#DefXXL").html("");
            }
            else {  
            $.each(data, function(i,n) {   
                PhotoHtml += "<div class=\"qymp-big-class-content\">";
                PhotoHtml += "    <div class=\"daren-title-bg\">";
                PhotoHtml += "           <div class=\"daren-title-news\" >新势力家园达人展示</div>";
                PhotoHtml += "           <div class=\"qymp-more-big\"><a target=\"_blank\"  href=\"http://up.online.cn/HomeStar.aspx?navIndex=3\">更多&gt;&gt;</a></div>";
                PhotoHtml += "    </div>";
                PhotoHtml += "    <div class=\"qymp-big-class-list\">";
                PhotoHtml += "    <div class=\"qymp-big-class-list-left_daren\">";             
                    $.each(n.ImgDaRen, function(j, m) {
                        //达人图片信息
                        PhotoHtml += "    <div class=\"HomeDaRen\">";  
                        PhotoHtml += "    <span class=\"darenPic\">";
                        PhotoHtml += "      <a href=\"javascript:void(0)\" onclick=\"return DarenXXL_Img_ToUrl('"+m.URL+"');\" title=\""+m.Name+"\"><img src='"+m.ImgSrc+"'/></a>";
                        PhotoHtml += "    </span>";
                        PhotoHtml += "    <span class=\"darenName\">";
                        PhotoHtml += "      <a href=\"javascript:void(0)\" onclick=\"return DarenXXL_Img_ToUrl('" + m.URL + "');\" title=\"" + m.Name + "\">[达人]" + m.Name + "</a>";
                        PhotoHtml += "    </span> ";                        
                        PhotoHtml += "    </div>";                        
//                        if(j==0)
//                        {
//                            PhotoHtml += "<div class=\"jianGe\"></div>";                        
//                       }
                    });                                         
               PhotoHtml += "    </div>";                   
               PhotoHtml += "    <div class=\"qymp-big-class-list-right_daren\">"
               PhotoHtml += "       <ul>"      
                    $.each(n.DaRenList, function(k, q) {
                    //达人文字列表
                        PhotoHtml += "    <li><a title=\"["+q.Cate+"]"+q.NewsTitle+"\"  href=\"javascript:void(0)\" onclick=\"return DarenXXL_Txt_ToUrl('" + q.URL + "');\" ><b class=\"title-big-left2\">[" + q.Cate + "]" + q.NewsTitle + "</b></a></li>";
                    });             
               PhotoHtml += "       </ul>";
               PhotoHtml += "    </div>";
               PhotoHtml += "    </div>";
               PhotoHtml += "</div>";
                              
               $("#DefXXL").html(PhotoHtml);
            });  
            
            }
        }
    });
}                               
                                
                                


function DarenGRMP() {
    /// <summary>宽带商务信息展示</summary>
    var PhotoHtml = "";
    var url = "http://business.online.cn/GetJsonData/GetIndivideualAndNewsList.aspx";
    $.ajax({
        type: "get",
        dataType: "jsonp",
        url: url,
        success: function(data) {
            if (data == "") {
                $("#DefGRMP").html("");
            }
            else {
            $.each(data, function(l,o) {
            
                PhotoHtml += " <div class=\"qymp-big-class-content\">";
                PhotoHtml += "  <div class=\"daren-title-bg\">";
                PhotoHtml += "      <div class=\"daren-title-news\" >宽带商务信息展示</div>";
                PhotoHtml += "      <div class=\"qymp-more-big\"><a target=\"_blank\" href=\"http://wo.online.cn/IssueInformation.aspx?navIndex=4\">更多&gt;&gt;</a></div>";
                PhotoHtml += "  </div>";               
                
                PhotoHtml += "    <div class=\"qymp-big-class-list\">";
                //左边开始               
                PhotoHtml += "    <div class=\"qymp-big-class-list-left\">";                                      
                     $.each(o.Imgqiye, function(j, w) {
                        //推荐企业图片信息                        
                        //alert(w.Url.replace(/\s/g,""));
                        
                        PhotoHtml += "    <div class=\"list-pic-info\">";  
                        PhotoHtml += "    <span>";
                        PhotoHtml += "      <a href=\"javascript:void(0)\" onclick=\"return XXZS_MPImg_ToUrl('" + w.Url + "');\" title='" + w.Title + "'><img src='" + w.ImgSrc.replace(/\s/g, "") + "' /></a>";                       
                        PhotoHtml += "    </span>";
                        PhotoHtml += "    <span>";
                        PhotoHtml += "      <a href=\"javascript:void(0)\" onclick=\"return XXZS_MPImg_ToUrl('" + w.Url + "');\" title='" + w.Title + "'>" + w.Title + "</a>";
                        PhotoHtml += "    </span> ";                        
                        PhotoHtml += "    </div>";  
                    });                                    
                        PhotoHtml += "<div class=\"jianGe\">&nbsp;</div>";                
                    $.each(o.NewsImg, function(x, q) {
                    //推荐信息图片信息
                        PhotoHtml += "    <div class=\"list-pic-info\">";  
                        PhotoHtml += "    <span>";
                        PhotoHtml += "      <a href=\"javascript:void(0)\" onclick=\"return XXZS_Txt_ToUrl('" + q.Url + "');\" title=\"" + q.Title + "\"><img src='" + q.ImgSrc + "'/></a>";
                        PhotoHtml += "    </span>";
                        PhotoHtml += "    <span>";
                        PhotoHtml += "      <a href=\"javascript:void(0)\" onclick=\"return XXZS_Txt_ToUrl('" + q.Url + "');\" title=\"" + q.Title + "\">" + q.Title + "</a>";
                        PhotoHtml += "    </span> ";                        
                        PhotoHtml += "    </div>";   
                    });
                  
                PhotoHtml += "    </div>";    
                 
                //右边开始
                PhotoHtml += "    <div class=\"qymp-big-class-list-right\">" 
                PhotoHtml += "    <ul>";                
                    $.each(o.qiyeList, function(k, p) {                        
                         //推荐企业文字信息
                    PhotoHtml += "<li><a title=\"[名片]" + p.Title + "\"  href=\"javascript:void(0)\" onclick=\"return XXZS_MPImg_ToUrl('" + p.Url + "');\" ><b class=\"title-big-left2\">[名片]" + p.Title + "</b></a></li>";
                    }); 
                        PhotoHtml += "<li class=\"jianGe\" ></li>";                 
                     $.each(o.NewsList, function(y, r) {
                     //推荐信息文字信息
                     PhotoHtml += "<li><a title=\"[" + r.Cate + "]" + r.Title + "\" href=\"javascript:void(0)\" onclick=\"return XXZS_Txt_ToUrl('" + r.Url + "');\"><b class=\"title-big-left2\">[" + r.Cate + "]" + r.Title + "</b></a></li>";
                    });                    
                PhotoHtml += "    </ul>";   
                PhotoHtml += "    </div>";      
                PhotoHtml += "    </div>";                  
                PhotoHtml += "<div class=\"clr\"></div>";
                PhotoHtml += "</div>"; 

                $("#DefGRMP").html(PhotoHtml);                
              });   
                
            }
        }
    });
}

function DarenXXL_Img_ToUrl(strPara) {
    //window.parent.location = "Photo/Index.aspx?ToUrl=" + strPara + "&_=" + Math.random();
    window.open("http://up.online.cn/HomeStar.aspx?navIndex=3&ToUrl=" + strPara + "&_" + Math.random());
    return false;
}
function DarenXXL_Txt_ToUrl(strPara) {
    //window.parent.location = "Photo/Index.aspx?ToUrl=" + strPara + "&_=" + Math.random();
    window.open("http://up.online.cn/IssueInformation.aspx?navIndex=4&ToUrl=" + strPara + "&_" + Math.random());
    return false;
}
function XXZS_MPImg_ToUrl(strPara) {//名片
    //window.parent.location = "Photo/Index.aspx?ToUrl=" + strPara + "&_=" + Math.random();
    window.open("http://wo.online.cn/SingleCard.aspx?navIndex=3&ToUrl=" + strPara + "&_" + Math.random());
    return false;
}
function XXZS_Txt_ToUrl(strPara) {//信息
    //window.parent.location = "Photo/Index.aspx?ToUrl=" + strPara + "&_=" + Math.random();
    window.open("http://wo.online.cn/IssueInformation.aspx?navIndex=4&ToUrl=" + strPara + "&_" + Math.random());
    return false;
}
function formtime(t) {
    var timev = t.toString();
    if (timev.length == 14) {
        return timev.substr(0, 4) + "-" + timev.substr(4, 2) + "-" + timev.substr(6, 2);
        //imevtimev.Substring(0, 4) + "-" + timev.Substring(4, 2) + "-" + timev.Substring(6, 2) + " " + timev.Substring(8, 2) + ":" + timev.Substring(10, 2) + ":" + timev.Substring(12, 2);

    }
}

//Load事件

$(document).ready(function() {
    DarenGRMP();
    DarenXXL();
});


