/********************************************
|
* 前台展示 - 资源中心 *
|
*******************************************/
|
|
//------------------------------------------
|
//F1.页面初始化
|
//F2.访问排行
|
//F3.最新资源
|
//F4.我的收藏夹
|
//F5.资源使用情况
|
//F6.初始化热门搜索关键字
|
//F7.热门搜索
|
//F8.搜索功能
|
//F9.我的申请资源
|
//F10.推荐资源
|
//F11.图表
|
//F12.我的申请详情
|
//F13 换一批(0定向推送1资源推荐)
|
//------------------------------------------
|
|
//F1.页面初始化
|
$(function () {
|
$('.txt').css('width', $('.img').width() + 'px');
|
var width1 = ($('.YWJC_Img').width() - $('.img').width()) / 2;
|
$('.txt').css('left', width1 + 'px');
|
$('.noanimate').css('width', $('.img').width() + 'px');
|
|
var width1 = ($('.YWJC_Img').width() - $('.img').width()) / 2;
|
$('.noanimate').css('left', width1 + 'px');
|
|
//F2.访问排行
|
FangWenPaiHang();
|
|
//F3.最新资源
|
ZuiXinZiYuan();
|
|
//F4.我的收藏夹
|
WoDeShouCangJia();
|
|
//F5.我的足迹
|
WoDeZuJi();
|
|
//F6.初始化热门搜索关键字
|
initHotSearch();
|
|
//F9.我的申请资源
|
WoDeShenQing();
|
|
//F10.我的推荐资源
|
TuiJianZiYuan(0,0);
|
|
//F11.图表
|
initEchaerts();
|
|
//F14 资源推荐
|
ZiYuanRecommend(0,0);
|
});
|
|
//F2.访问排行
|
function FangWenPaiHang() {
|
$.ajax({
|
url: '/res/resActionRecord/selectFangWenPaiHang',
|
type: 'get',
|
success: function (data) {
|
var html = "";
|
var jsonb = eval('(' + data + ')');
|
if (jsonb.length < 10) {
|
$("#fwph").css("height", "400px");
|
}
|
for (var i = 0; i < jsonb.length; i++) {
|
if (i == 0) {
|
html += "<li>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" +
|
" <img src=\"/image/ZiYuanZhongXin/top1.png\" /> " +
|
"<span>" + jsonb[i].title + "</span>" +
|
"</a>" +
|
"</li>";
|
continue;
|
}
|
if (i == 1) {
|
html += "<li>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" +
|
"<img src=\"/image/ZiYuanZhongXin/top2.png\" /> " +
|
"<span>" + jsonb[i].title + "</span>" +
|
"</a>" +
|
"</li>";
|
continue;
|
}
|
if (i == 2) {
|
html += "<li>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" +
|
"<img src=\"/image/ZiYuanZhongXin/top3.png\" /> " +
|
"<span>" + jsonb[i].title + "</span>" +
|
"</a>" +
|
"</li>";
|
continue;
|
}
|
if (i == 9) {
|
html += "<li style='border: none;'>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" +
|
"<span>" + jsonb[i].title + "</span>" +
|
"</a>" +
|
"</li>";
|
continue;
|
}
|
else {
|
html += "<li>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" +
|
"<span>" + jsonb[i].title + "</span>" +
|
"</a>" +
|
"</li>";
|
}
|
}
|
|
$("#fwph").append(html);
|
},
|
error: function (e) {
|
// alert(e.message);
|
}
|
});
|
}
|
|
//F3.最新资源
|
function ZuiXinZiYuan() {
|
$.ajax({
|
url: '/res/ZiYuan/getAllOrderByTime',
|
type: 'get',
|
success: function (data) {
|
var html = "";
|
var jsonb = eval('(' + data + ')');
|
var today = new Date();
|
var year = today.getFullYear() + "-";
|
var month = today.getMonth() + 1;
|
if (month < 10) {
|
month = "0" + month;
|
}
|
var day = today.getDate();
|
if (day < 10) {
|
day = "0" + day;
|
}
|
var newday = year + month + "-" + day;
|
if (jsonb.length < 10) {
|
$("#zxzy").css("height", "463px");
|
}
|
for (var i = 0; i < jsonb.length; i++) {
|
if (8 != i) {
|
if (jsonb[i].pubdate == newday) {
|
html += "<li>" +
|
"<div>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" + jsonb[i].title + "</a><img src=\"/image/ZiYuanZhongXin/new.gif\" style=\"margin-left: 10px;margin-top: -7px;\" /><br />" +
|
" <span style=\"color: gray;\">" + jsonb[i].pubdate + "</span>" +
|
"</div>" +
|
"</li>";
|
}
|
else {
|
html += "<li>" +
|
"<div>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" + jsonb[i].title + "</a><br />" +
|
" <span style=\"color: gray;\">" + jsonb[i].pubdate + "</span>" +
|
"</div>" +
|
"</li>";
|
}
|
}
|
if (i == 8) {
|
if (jsonb[i].pubdate == newday) {
|
html += "<li style='border-bottom: none !important;'>" +
|
"<div>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" + jsonb[i].title + "</a><img src=\"/image/ZiYuanZhongXin/new.gif\" style=\"margin-left: 10px;margin-top: -7px;\" /><br />" +
|
" <span style=\"color: gray;\">" + jsonb[i].pubdate + "</span>" +
|
"</div>" +
|
"</li>";
|
}
|
else {
|
html += "<li style='border-bottom: none !important;'>" +
|
"<div>" +
|
"<a title='" + jsonb[i].fulltitle + "' onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">" + jsonb[i].title + "</a><br />" +
|
" <span style=\"color: gray;\">" + jsonb[i].pubdate + "</span>" +
|
"</div>" +
|
"</li>";
|
}
|
}
|
}
|
$("#zxzy").append(html);
|
},
|
error: function (e) {
|
// alert(e.message);
|
}
|
});
|
}
|
|
//F4.我的收藏夹
|
function WoDeShouCangJia() {
|
$.ajax({
|
// url: '/res/ditufuwu/getTopListWDSCJ',
|
url: '/res/resActionRecord/selectByActiontype',
|
type: 'post',
|
dataType: 'json',
|
data: {'actiontype': '收藏'},
|
success: function (data) {
|
var html = "";
|
// var jsona = eval('(' + data + ')');
|
var jsona = data.result;
|
if (jsona.length < 10) {
|
$(".mtree").css("height", "400px");
|
}
|
for (var i = 0; i < jsona.length; i++) {
|
if (9 != i) {
|
html += "<li>" +
|
"<a title=\"" + jsona[i].fulltitle + "\" style=\"vertical-align: middle;\" href=\"#\"></a>" +
|
"<a title=\"" + jsona[i].fulltitle + "\" style=\"font-size: 13px; border-bottom-color: rgb(225, 225, 225); cursor: pointer;\" onclick=\"OpenZiYuan('" + jsona[i].resourceid + "')\" >" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/shoucangicon.png\" />" + jsona[i].title +
|
"</a>" +
|
" </li>";
|
}
|
if (i == 9) {
|
html += "<li style='border-bottom: none;'>" +
|
"<a title=\"" + jsona[i].fulltitle + "\" style=\"vertical-align: middle;\" href=\"#\"></a>" +
|
"<a title=\"" + jsona[i].fulltitle + "\" style=\"font-size: 13px;cursor: pointer;\" onclick=\"OpenZiYuan('" + jsona[i].resourceid + "')\" >" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/shoucangicon.png\" />" + jsona[i].title +
|
"</a>" +
|
" </li>";
|
}
|
}
|
$(".mtree").append(html);
|
|
},
|
error: function (e) {
|
// alert(e.message);
|
}
|
});
|
}
|
|
//F5.我的足迹
|
function WoDeZuJi() {
|
$.ajax({
|
url: '/res/resActionRecord/selectByActiontype',
|
type: 'post',
|
dataType: 'json',
|
data: {'actiontype': '浏览'},
|
success: function (result) {
|
var html = "";
|
// var json = eval('(' + result + ')');
|
var json = result.result;
|
for (var i = 0; i < json.length; i++) {
|
if (json.length - 1 != i) {
|
html += "<li>" +
|
"<a title=\"" + json[i].title + "\" style=\"vertical-align: middle;\" href=\"#\"></a>" +
|
"<a title=\"" + json[i].title + "\" style=\"color: rgb(250, 62, 69); cursor: pointer;\" onclick=\"OpenZiYuan('" + json[i].resourceid + "')\">" + json[i].title +
|
"</a>" +
|
" <span style=\"padding-right: 2px; font-size: 12px; float: right;\">" + json[i].finaltime + "</span>" +
|
"</li>";
|
}
|
if (json.length - 1 == i) {
|
html += "<li style='border-bottom: none !important;'>" +
|
"<a title=\"" + json[i].title + "\" style=\"vertical-align: middle;\" href=\"#\"></a>" +
|
"<a title=\"" + json[i].title + "\" style=\"color: rgb(250, 62, 69); cursor: pointer;\" onclick=\"OpenZiYuan('" + json[i].resourceid + "')\">" + json[i].title +
|
"</a>" +
|
" <span style=\"padding-right: 2px; font-size: 12px; float: right;\">" + json[i].finaltime + "</span>" +
|
"</li>";
|
}
|
}
|
$(".zuji").append(html);
|
},
|
error: function (e) {
|
// alert(e.message);
|
}
|
});
|
}
|
|
//F6.初始化热门搜索关键字
|
function initHotSearch() {
|
$.ajax({
|
url: '/res/getTopHotSearch',
|
type: 'get',
|
success: function (data) {
|
if (data != "") {
|
var list = data.result;
|
var html = "<li>热门搜索:</li>";
|
for (var i = 0; i < list.length; i++) {
|
html += "<li onclick='HotSearch(this)' title='"+list[i].keyword+"' >" + list[i].keyword + "</li>";
|
}
|
$("#ReMenSouSuoBox").css("width",window.innerWidth);
|
$("#ReMenSouSuoBox ul").append(html);
|
}
|
},
|
error: function (e) {
|
// alert(e.message);
|
}
|
});
|
}
|
|
//F7.热门搜索
|
function HotSearch(e) {
|
var keyword = $(e).attr("title");
|
window.open("/res/ziyuanmulu/index?Menu=ZYZX&menuId=08&Message=" + encodeURIComponent(keyword), "_black");
|
}
|
|
//F8.搜索功能
|
function Search() {
|
var key = document.getElementById("guanjianziSeach").value;
|
if (key != "") {
|
$.ajax({
|
url: 'Search',//TuiJianZiYuan
|
type: 'post',
|
data: {"key": key},
|
success: function (data) {
|
}
|
});
|
window.open("/res/ziyuanmulu/index?Menu=ZYZX&menuId=08&Message=" + encodeURIComponent(key), "_black");
|
}
|
}
|
|
//F9.我的申请资源
|
function WoDeShenQing() {
|
$.ajax({
|
url: '/res/resApplyRecommend/shenQingZiYuan',
|
type: 'get',
|
success: function (sqzy) {
|
var html = "";
|
var jsonzy = sqzy.result;
|
if (jsonzy.length < 10) {
|
$("#sqzy").css("height", "463px");
|
}
|
for (var i = 0; i < jsonzy.length; i++) {
|
if (jsonzy.length == 0) {
|
break;
|
}
|
if (9 != i) {
|
html += "<div class=\"sqzy\" style=\"padding: 11.4px 0px 11.5px 10px; font-size: 15px; border-bottom-color: rgb(225, 225, 225); border-bottom-width: 1px; border-bottom-style: dashed;\">";
|
if (jsonzy[i].auditresult == "0") {
|
html += "<a title='" + jsonzy[i].fulltitle + "' style=\"color: black; cursor: pointer;transition: 0.3s;\" onclick=\"OpenZiYuan('" + jsonzy[i].resourceid + "')\">" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/wodeshenqing_icon.png\" />"+ jsonzy[i].title + " </a>" +
|
" <img onclick='showApplyInfo("+jsonzy[i].appid+")' style=\"padding-top: 2px; padding-right: 5px; float: right;cursor: pointer;\" src=\"/image/ZiYuanZhongXin/weipifu.gif\" />";
|
} else if (jsonzy[i].auditresult == "1") {
|
html += "<a title='" + jsonzy[i].fulltitle + "' style=\"color: black; cursor: pointer;transition: 0.3s;\" onclick=\"OpenZiYuan('" + jsonzy[i].resourceid + "')\">"+
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/wodeshenqing_icon.png\" />"+ jsonzy[i].title + " </a>" +
|
" <img onclick='showApplyInfo("+jsonzy[i].appid+")' style=\"padding-top: 2px; padding-right: 5px; float: right;cursor: pointer;\" src=\"/image/ZiYuanZhongXin/yitongguo.gif\" />";
|
} else if (jsonzy[i].auditresult == "2") {
|
html += "<a title='" + jsonzy[i].fulltitle + "' style=\"color: black; cursor: pointer;transition: 0.3s;\" onclick=\"OpenZiYuan('" + jsonzy[i].resourceid + "')\">" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/wodeshenqing_icon.png\" />"+ jsonzy[i].title + " </a>" +
|
" <img onclick='showApplyInfo("+jsonzy[i].appid+")' style=\"padding-top: 2px; padding-right: 5px; float: right;cursor: pointer;\" src=\"/image/ZiYuanZhongXin/weitongguo.gif\" />";
|
} else if (jsonzy[i].auditresult == "null") {
|
html += "<a title='" + jsonzy[i].fulltitle + "' style=\"color: black; cursor: pointer;\" onclick=\"OpenZiYuan('" + jsonzy[i].resourceid + "')\">" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/wodeshenqing_icon.png\" />"+ jsonzy[i].title + " </a>" +
|
" <img onclick='showApplyInfo(+jsonzy[i].appid+)' style=\"padding-top: 2px; padding-right: 5px; float: right;cursor: pointer;\" src=\"/image/ZiYuanZhongXin/weipifu.gif\" />";
|
}
|
html += "</div>";
|
}
|
if (i == 9) {
|
html += "<div class=\"sqzy\" style=\"padding: 11.4px 0px 11.5px 10px; font-size: 15px;\">";
|
if (jsonzy[i].auditresult == "0") {
|
html += "<a title='" + jsonzy[i].fulltitle + "' style=\"color: black; cursor: pointer;transition: 0.3s;\" onclick=\"OpenZiYuan('" + jsonzy[i].resourceid + "')\">" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/wodeshenqing_icon.png\" />"+ jsonzy[i].title + " </a>" +
|
" <img onclick='showApplyInfo("+jsonzy[i].appid+")' style=\"padding-top: 2px; padding-right: 5px; float: right;cursor: pointer;\" src=\"/image/ZiYuanZhongXin/weipifu.gif\" />";
|
} else if (jsonzy[i].auditresult == "1") {
|
html += "<a title='" + jsonzy[i].fulltitle + "' style=\"color: black; cursor: pointer;transition: 0.3s;\" onclick=\"OpenZiYuan('" + jsonzy[i].resourceid + "')\">" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/wodeshenqing_icon.png\" />"+ jsonzy[i].title + " </a>" +
|
" <img onclick='showApplyInfo("+jsonzy[i].appid+")' style=\"padding-top: 2px; padding-right: 5px; float: right;cursor: pointer;\" src=\"/image/ZiYuanZhongXin/yitongguo.gif\" />";
|
} else if (jsonzy[i].auditresult == "2") {
|
html += "<a title='" + jsonzy[i].fulltitle + "' style=\"color: black; cursor: pointer;transition: 0.3s;\" onclick=\"OpenZiYuan('" + jsonzy[i].resourceid + "')\">" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/wodeshenqing_icon.png\" />"+ jsonzy[i].title + " </a>" +
|
" <img onclick='showApplyInfo("+jsonzy[i].appid+")' style=\"padding-top: 2px; padding-right: 5px; float: right;cursor: pointer;\" src=\"/image/ZiYuanZhongXin/weitongguo.gif\" />";
|
} else if (jsonzy[i].auditresult == "null") {
|
html += "<a title='" + jsonzy[i].fulltitle + "' style=\"color: black; cursor: pointer;\" onclick=\"OpenZiYuan('" + jsonzy[i].resourceid + "')\">" +
|
"<img style=\"padding-right: 5px; vertical-align: text-bottom;\" src=\"/image/ZiYuanZhongXin/wodeshenqing_icon.png\" />"+ jsonzy[i].title + " </a>" +
|
" <img onclick='showApplyInfo("+jsonzy[i].appid+")' style=\"padding-top: 2px; padding-right: 5px; float: right;cursor: pointer;\" src=\"/image/ZiYuanZhongXin/weipifu.gif\" />";
|
}
|
html += "</div>";
|
}
|
}
|
$("#sqzy").append(html);
|
},
|
error: function (e) {
|
// alert(e.message);
|
}
|
});
|
}
|
|
//F10.我的推荐资源(0默认1换一批,)
|
function TuiJianZiYuan(type,num) {
|
var url = (type == 0 ?'/res/ZiYuan/getTopRecommend?isDiTuFuwu=false':('/res/ditufuwu/getTuiJianZiYuanByIndex?isDiTuFuwu=false&limit=3&page='+num));
|
$.ajax({
|
url: url,
|
type: 'get',
|
success: function (data) {
|
var html = "";
|
// var r = decodeURIComponent(data);
|
var jsonb = eval('('+ data +')');
|
// if (jsonb.length < 3) {
|
// $("#divtuijianziyuan").css("height", "398.5px");
|
// }
|
for (var i = 0; i < (jsonb.length>3?3:jsonb.length); i++) {
|
var description = decodeURIComponent(jsonb[i].description);
|
var fulldescription = decodeURIComponent(jsonb[i].fulldescription);
|
html += "<li class=\"YWJC_Img\" style=\"margin: 10.5px 0px 10.5px 0px !important;\" onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">"
|
+ "<div style=\"margin: 0px auto; text-align: center;\">";
|
html += "<img class=\"img\" style=\"width: 80%; height: 146px;\" src=\"" + jsonb[i].imgurl + "\" />";
|
html += "<div class=\"txt\" style=\"float:left;margin-left: 10%;width: 80%; height: 40px; overflow: hidden; cursor: pointer;\">"
|
+ "<h3 style=\"padding-top: 0px;\">" + jsonb[i].title + "</h3>"
|
+ "<p title='" + fulldescription + "' style=\"text-align: left; padding-right: 10px; padding-left: 10px;\"> " + description + "</p>"
|
+ "</div>"
|
+ "</div>"
|
+ "</li>";
|
}
|
|
$("#tjzy").html(html);
|
|
var width = $(".YWJC_Img").width();
|
var margin_L_R = ($(".lanren").width() - width * 3) / 6;
|
$(".lanren ul li").css("margin-left", margin_L_R + "px");
|
$(".lanren ul li").css("margin-right", margin_L_R + "px");
|
$(".lanren ul li").hover(function () {
|
$(this).find(".txt").stop().animate({height: "170px"}, 400);
|
$(this).find(".txt h3").stop().animate({paddingTop: "30px"}, 400);
|
}, function () {
|
$(this).find(".txt").stop().animate({height: "40px"}, 400);
|
$(this).find(".txt h3").stop().animate({paddingTop: "0"}, 400);
|
});
|
},
|
error: function (e) {
|
// alert(e.message);
|
}
|
});
|
}
|
|
//F11.图表
|
function initEchaerts() {
|
var divzylx = document.getElementById("zylx");
|
var divzyly = document.getElementById("zyly");
|
var divzyml = document.getElementById("zyml");
|
var zylx = echarts.init(divzylx);
|
var zyly = echarts.init(divzyly);
|
var zyml = echarts.init(divzyml);
|
var zylxoption = {
|
title: {
|
text: '资源类型统计',
|
x: 'center'
|
},
|
tooltip: {
|
trigger: 'item',
|
formatter: "{a} <br/>{b} : {c} ({d}%)"
|
},
|
color: ['#85CFFF', '#DD71D4', '#FF7D53', '#6496EF', '#31CF32'],
|
calculable: true,
|
series: [
|
{
|
name: '资源类型',
|
type: 'pie',
|
radius: '50%',
|
center: ['50%', '60%'],
|
data: resourceclassSeries
|
}
|
]
|
};
|
zylx.setOption(zylxoption);
|
var zylyoption = {
|
title: {
|
text: '资源来源统计',
|
x: 'center'
|
},
|
tooltip: {
|
trigger: 'axis'
|
},
|
calculable: true,
|
xAxis: [
|
{
|
type: 'category',
|
axisLabel: {
|
interval: 0,
|
rotate: 30
|
},
|
data: DataSourceLegends,
|
splitLine: {
|
show: true
|
}
|
}
|
],
|
yAxis: [
|
{
|
type: 'value',
|
splitLine: {
|
show: true
|
}
|
}
|
],
|
series: [
|
{
|
name: '资源数量',
|
type: 'bar',
|
barWidth: 10,
|
data: DataSourceSeries,
|
itemStyle: {
|
normal: {
|
color: '#5AB3EF',
|
label: {
|
show: true,
|
position: 'top'
|
}
|
}
|
}
|
}
|
]
|
};
|
zyly.setOption(zylyoption);
|
var zymloption = {
|
title: {
|
text: '资源目录统计',
|
x: 'center'
|
},
|
tooltip: {
|
trigger: 'axis'
|
},
|
grid: {
|
borderWidth: 0,
|
},
|
calculable: false,
|
xAxis: [
|
{
|
type: 'category',
|
axisLabel: {
|
interval: 0,
|
rotate: 40
|
},
|
boundaryGap: false,
|
data: MuLuLegends,
|
splitLine: {
|
show: false
|
}
|
}
|
],
|
yAxis: [
|
{
|
type: 'value',
|
axisLabel: {
|
formatter: '{value}'
|
},
|
splitLine: {
|
show: true
|
}
|
}
|
],
|
series: [
|
{
|
name: '资源数量',
|
type: 'line',
|
data: MuLuSeries,
|
itemStyle: {
|
normal: {
|
label: {show: true},
|
color: '#FF7D53'
|
}
|
},
|
},
|
]
|
};
|
zyml.setOption(zymloption);
|
}
|
|
//F12.我的申请详情
|
function showApplyInfo(appid) {
|
var url = "/res/resApplyRecommend/applyRecommendInfo?appid="+appid;
|
// winPro.openFullwin(url, "查看资源申请", "yes");
|
openFullWindow(url, "查看资源申请");
|
}
|
|
//F13 换一批(0定向推送1资源推荐)
|
var indexp = 2;
|
var indexr = 2;
|
function ChangeNext(type) {
|
var totalIndex = 0;
|
if(type == 0) {
|
totalIndex = (totalpNum % 3) > 0 ? (totalpNum / 3) + 1 : (totalpNum / 3);
|
if(indexp > totalIndex){
|
indexp = 1;
|
}
|
TuiJianZiYuan(1,indexp);
|
indexp++;
|
}else {
|
totalIndex = (totalrNum % 3) > 0 ? (totalrNum / 3) + 1 : (totalrNum / 3);
|
if(indexr > totalIndex){
|
indexr = 1;
|
}
|
ZiYuanRecommend(1,indexr);
|
indexr++;
|
}
|
|
}
|
|
//F14 资源推荐
|
function ZiYuanRecommend(type,num) {
|
var url = (type == 0 ?'/res/ditufuwu/getMainInfoRecommends?isDiTuFuwu=false&limit=3&page=1':('/res/ditufuwu/getMainInfoRecommends?isDiTuFuwu=false&limit=3&page='+num));
|
$.ajax({
|
url: url,
|
type: 'get',
|
success: function (data) {
|
var html = "";
|
var jsonb = eval('('+ data +')');
|
for (var i = 0; i < (jsonb.length>3?3:jsonb.length); i++) {
|
var description = decodeURIComponent(jsonb[i].description);
|
var fulldescription = decodeURIComponent(jsonb[i].fulldescription);
|
html += "<li class=\"YWJC_Img\" style=\"margin: 10.5px 0px 10.5px 0px !important;\" onclick=\"OpenZiYuan('" + jsonb[i].resourceid + "')\">"
|
+ "<div style=\"margin: 0px auto; text-align: center;\">";
|
html += "<img class=\"img\" style=\"width: 80%; height: 146px;\" src=\"" + jsonb[i].imgurl + "\" />";
|
html += "<div class=\"txt\" style=\"float:left;margin-left: 10%;width: 80%; height: 40px; overflow: hidden; cursor: pointer;\">"
|
+ "<h3 style=\"padding-top: 0px;\">" + jsonb[i].title + "</h3>"
|
+ "<p title='" + fulldescription + "' style=\"text-align: left; padding-right: 10px; padding-left: 10px;\"> " + description + "</p>"
|
+ "</div>"
|
+ "</div>"
|
+ "</li>";
|
}
|
$("#rrzy").html(html);
|
var width = $(".YWJC_Img").width();
|
var margin_L_R = ($(".lanren").width() - width * 3) / 6;
|
$(".lanren ul li").css("margin-left", margin_L_R + "px");
|
$(".lanren ul li").css("margin-right", margin_L_R + "px");
|
$(".lanren ul li").hover(function () {
|
$(this).find(".txt").stop().animate({height: "170px"}, 400);
|
$(this).find(".txt h3").stop().animate({paddingTop: "30px"}, 400);
|
}, function () {
|
$(this).find(".txt").stop().animate({height: "40px"}, 400);
|
$(this).find(".txt h3").stop().animate({paddingTop: "0"}, 400);
|
});
|
},
|
error: function (e) {
|
// alert(e.message);
|
}
|
});
|
}
|