/div>

11 Commits (ff0e9f8771942c6a8a9ccabedabca5ccdce2d634)

Author SHA1 Message Date
  LIPENGTAO1313 4f6e3971dd 修正 6 years ago
  LIPENGTAO1313 c5aeefbc04 修正需求 6 years ago
  luyanan 3f6f93ac9f 日期显示,用途详情 6 years ago
  luyanan 51d486a199 删除之前废弃咨询模块 6 years ago
  jack 12749adc25 需求修改 7 years ago
  jack 6299ac6f53 发布需求及修改bug 7 years ago
  luyanan 43f1990725 添加回到顶部按钮 7 years ago
  luyanan 2ae619e6df 需求修改和发布相关样式问题 7 years ago
  jack 3904f56beb 发布需求及修改 7 years ago
  jack bdec6924e8 需求发布需求修改 7 years ago
  happy fa82d8fcc8 需求修改 7 years ago
portal-front - Gogs: Go Git Service

portal html css js resource

discover.js 6.5KB

    //发现模块 $(function() { $(".headnav li").eq(1).addClass("navcurrent"); loginStatus();//判断个人是否登录 var userid = $.cookie("userid"); discover(10, 1,true); /*发现列表显示*/ function discover(pageSize, pageNo,isbind) { $.ajax({ "url": "/ajax/article/findHot", "type": "get", "async": true, "data": { "pageSize": pageSize, "pageNo": pageNo }, "beforeSend": function() { $("#table-item").append('<img src="../images/loading.gif" class="loading" style="position: absolute;left: 50%; top: 50%;" />'); }, "success": function(data) { console.log(data); if(data.success && data.data != null) { var itemlist = ''; $("#table-item").html(""); for(var i = 0; i < data.data.data.length; i++) { var itemlist = '<li><div class="table-item-media">'; itemlist += '<a href="" class="table-item-logo" id="userimg"></a>'; itemlist += '<div class="table-item-name clearfix">'; itemlist += '<a href="" id="userUrl"><span class="nameSpan" id="nameSpan"></span></a><em class="authiconNew " title=""></em>'; itemlist += '<p><span class="timeLabel" id="time"></span></p></div></div>'; itemlist += '<div class="table-item-cell"><a href="" id="newsurl">'; itemlist += '<div class="table-item-img" id="newsimg"></div>'; itemlist += '<div class="table-item-body">'; itemlist += '<p class="ellipsisSty" id="centent"></p>'; itemlist += '<p><em class="cmpLable" id="newstype"></em></p>'; itemlist += '</div></a></div></li>'; $itemlist = $(itemlist); $("#table-item").append($itemlist); var datalist = data.data.data[i]; var type = datalist.type; $itemlist.find("#centent").text(datalist.name); $itemlist.find("#time").text(commenTime(datalist.createTime)); if(type == 1) { //专家文章 $itemlist.find("#newstype").text("文章"); $itemlist.find("#newstype").addClass("articalLabel"); $itemlist.find("#newsimg").addClass("artical-default"); $itemlist.find("#userimg").addClass("userhead"); $itemlist.find("#newsurl").attr("href", "articalShow.html?articleId=" + datalist.id ); if(datalist.image) { $itemlist.find("#newsimg").attr("style", "background-image: url(/data/article/" + datalist.image + ");"); } userFun(datalist.owner, $itemlist); } else if(type == 2) { //企业文章 $itemlist.find("#newstype").text("文章"); $itemlist.find("#newstype").addClass("articalLabel"); $itemlist.find("#newsimg").addClass("artical-default"); $itemlist.find("#userimg").addClass("cmplogohead"); $itemlist.find("#newsurl").attr("href", "articalShow.html?oFlag=1&articleId=" + datalist.id ); if(datalist.image) { $itemlist.find("#newsimg").attr("style", "background-image: url(/data/article/" + datalist.image + ");"); } cmpFun(datalist.owner, $itemlist) } else if(type == 3) { //专家资源 $itemlist.find("#newstype").text("资源"); $itemlist.find("#newstype").addClass("resourceLabel"); $itemlist.find("#newsimg").addClass("resource-default"); $itemlist.find("#userimg").addClass("userhead"); $itemlist.find("#newsurl").attr("href", "resourceShow.html?resourceId=" + datalist.id); if(datalist.image) { $itemlist.find("#newsimg").attr("style", "background-image: url(/data/resource/" + datalist.image + ");"); } userFun(datalist.owner, $itemlist); } else if(type == 4) { //企业资源 $itemlist.find("#newstype").text("资源"); $itemlist.find("#newstype").addClass("resourceLabel"); $itemlist.find("#newsimg").addClass("resource-default"); $itemlist.find("#userimg").addClass("cmplogohead"); $itemlist.find("#newsurl").attr("href", "resourceShow.html?resourceId=" + datalist.id); if(datalist.image) { $itemlist.find("#newsimg").attr("style", "background-image: url(/data/resource/" + datalist.image + ");"); } cmpFun(datalist.owner, $itemlist) } } //分页 if(isbind==true){ $(".tcdPageCode").createPage({ pageCount: Math.ceil(data.data.total / 10), current: data.data.pageNo, backFn: function(p) { $("#table-item").html(""); discover(10, p,false); document.body.scrollTop = document.documentElement.scrollTop = 0; } }); } $(".loading").remove(); } }, "error": function() { $.MsgBox.Alert('提示', '链接服务器超时') } }); } /*用户信息*/ function userFun(id, $itemlist) { $.ajax({ "url": "/ajax/professor/baseInfo/" + id, "type": "get", "async": true, "success": function(data) { console.log(data); if(data.success && data.data) { $itemlist.find("#nameSpan").text(data.data.name); if(data.data.hasHeadImage == 1) { $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_m.jpg);"); } $itemlist.find("#userimg").attr("href", "information-brow.html?professorId=" + data.data.id); $itemlist.find("#userUrl").attr("href", "information-brow.html?professorId=" + data.data.id); var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus); $itemlist.find(".authiconNew").attr("title", userType.title); $itemlist.find(".authiconNew").addClass(userType.sty); } }, "error": function() { $.MsgBox.Alert('提示', '链接服务器超时') } }); } /*企业用户信息*/ function cmpFun(id, $itemlist) { $.ajax({ "url": "/ajax/org/" + id, "type": "get", "async": true, "success": function(data) { console.log(data); if(data.success && data.data) { $itemlist.find("#nameSpan").text(data.data.name); if(data.data.hasOrgLogo) { $itemlist.find("#userimg").attr("style", "background-image: url(/images/org/" + data.data.id + ".jpg);"); } $itemlist.find("#userimg").attr("href", "companybrowinfor.html?orgid=" + data.data.id); $itemlist.find("#userUrl").attr("href", "companybrowinfor.html?orgid=" + data.data.id); if(data.data.authStatus==3){ $itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "认证企业");; }/*else{ $itemlist.find(".authiconNew").addClass("authicon-com-no").attr("title", "未认证企业");; }*/ } }, "error": function() { $.MsgBox.Alert('提示', '链接服务器超时') } }); } })