|
|
@@ -9,6 +9,7 @@ define(['jquery', "template", "Tools", "newApi", "paging", 'swiper'], function ( |
|
|
|
focusListTop: [], |
|
|
|
//新闻列表 |
|
|
|
newsInformationList:'', |
|
|
|
priceIndexList:'', |
|
|
|
//页码 |
|
|
|
pageNum: 1, |
|
|
|
//页码集合 |
|
|
@@ -33,6 +34,7 @@ define(['jquery', "template", "Tools", "newApi", "paging", 'swiper'], function ( |
|
|
|
}else{ |
|
|
|
//新闻资讯 |
|
|
|
tools.doGet(newList, {number:2,deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.NewsInformation,true); |
|
|
|
tools.doGet(newList, {number:9,deptId:100,pageNum:module.data.pageNum,pageSize:module.data.pageSize}, module.NewsInformation2,true); |
|
|
|
} |
|
|
|
//网站配置信息(网站名称 底部联系方式 公安备案号 网站备案号) |
|
|
|
tools.getWebConfig(); |
|
|
@@ -121,13 +123,60 @@ define(['jquery', "template", "Tools", "newApi", "paging", 'swiper'], function ( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//新闻资讯数据 |
|
|
|
module.NewsInformation2 = function (data) { |
|
|
|
if (data.code == 200) { |
|
|
|
var content = data.rows; |
|
|
|
var pageCount = (data.total/module.data.pageSize).toFixed(0); |
|
|
|
if (pageCount < 1){ |
|
|
|
pageCount = 1; |
|
|
|
} |
|
|
|
if(module.data.priceIndexList == ''){ |
|
|
|
// 初始化 分页器 |
|
|
|
var page_s2=createPage('.page_s2'); |
|
|
|
// 设置分页 |
|
|
|
setPage(page_s2,{ |
|
|
|
pageTotal: data.total, // 数据总条数 |
|
|
|
pageSize: module.data.pageSize, // 每页显示条数 |
|
|
|
pageCurrent: 1, // 当前页 |
|
|
|
maxBtnNum: 5, // 最多按钮个数 (最少5个) |
|
|
|
}) |
|
|
|
$('#page_s2').html('共'+pageCount+'页') |
|
|
|
} |
|
|
|
module.data.pageCount = pageCount; |
|
|
|
module.data.priceIndexList = content; |
|
|
|
var priceIndexData = template('priceIndexData', module.data); |
|
|
|
$("#priceIndexContent").html(priceIndexData); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
tabList = function(type){ |
|
|
|
console.log(type) |
|
|
|
document.getElementById('NewsInformationContent').style.display = 'none'; |
|
|
|
document.getElementById('priceIndexContent').style.display = 'none'; |
|
|
|
document.getElementById(type+'Content').style.display = 'block'; |
|
|
|
|
|
|
|
document.getElementById('NewsInformation').className = ''; |
|
|
|
document.getElementById('priceIndex').className = ''; |
|
|
|
document.getElementById(type).className = 'active'; |
|
|
|
|
|
|
|
document.getElementById('NewsInformationNum').style.display = 'none'; |
|
|
|
document.getElementById('priceIndexNum').style.display = 'none'; |
|
|
|
document.getElementById(type+'Num').style.display = 'block'; |
|
|
|
|
|
|
|
module.data.clickType = type; |
|
|
|
module.data.pageNum = 1 ; |
|
|
|
} |
|
|
|
|
|
|
|
turnThePage = function (pageNum) { |
|
|
|
module.data.pageNum = pageNum ; |
|
|
|
if (getQueryVariable('title')){ |
|
|
|
tools.doGet(newList, {deptId:100,pageNum:pageNum,pageSize:module.data.pageSize,title:getQueryVariable('title')}, module.NewsInformation,true); |
|
|
|
}else{ |
|
|
|
}else if(module.data.clickType == 'NewsInformation'){ |
|
|
|
tools.doGet(newList, {number:2,deptId:100,pageNum:pageNum,pageSize:module.data.pageSize}, module.NewsInformation,true); |
|
|
|
}else if(module.data.clickType == 'priceIndex'){ |
|
|
|
tools.doGet(newList, {number:9,deptId:100,pageNum:pageNum,pageSize:module.data.pageSize}, module.NewsInformation2,true); |
|
|
|
} |
|
|
|
} |
|
|
|
return module; |
|
|
|
}); |
|
|
|
}); |