| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590 |
- <!DOCTYPE html>
- <html lang="en"
- xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{home/common/common}">
- <head>
- <meta charset="UTF-8">
- <title th:text="${navigation_name}"></title>
- <style>
- .criteria.active {
- color: rgb(255, 255, 255);
- background: rgb(41, 118, 206);
- }
- .project-apply {
- display: inline-block;
- height: 30px;
- width: 76px;
- text-align: center;
- line-height: 30px;
- border-radius: 10px;
- background: #f60;
- color: #fff;
- padding: 0 10px;
- }
- .black-gray {
- background: #ccc;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <!-- 头部导航 -->
- <div th:replace="~{home/common/header :: header}"></div>
- <!--nav-->
- <div class="center_nav">
- <div th:replace="~{home/common/header :: nav}"></div>
- </div>
- <div class="main list-main">
- <!--面包屑-->
- <div class="container projects">
- <div>
- <!--class="col-sm-6 col-md-6 col-lg-8 hidden-xs"-->
- <div style="padding-left: 0;">
- <ol class="breadcrumbFixed clearfix" style="border-bottom: 0px solid #fff;margin-bottom: 0;">
- <li>
- <a th:href="@{/home}">首页</a>
- </li>
- <li class="active"><a><cite>[[${navigation_name}]]</cite></a></li>
- </ol>
- </div>
- <!--搜索框-->
- <!--<div class="col-sm-6 col-md-6 col-lg-4 col-xs-12">-->
- <!--<div style="display: inline-block;float: right;padding-top: 10px;width: 100%;">-->
- <!--<span style="display: inline-block;width:100%">-->
- <!--<input type="text" name="keyword" lay-verify="required" placeholder="请输入关键字搜索"-->
- <!--autocomplete="off" class="layui-input" style="width: 100%;display: inline-block">-->
- <!--</span>-->
- <!--<button onclick="onInit(1)" id="keywordSearch"-->
- <!--style="display: inline-block;float: right;background:none;border:none;">-->
- <!--<i class=" iconfont icon-sousuo"></i>-->
- <!--</button>-->
- <!--</div>-->
- <!--</div>-->
- </div>
- </div>
- <div id="activity_box" class="container projects" hidden>
- <div class="kind-tip" id="type">
- </div>
- <div class="clearfix screen-box">
- <div class="pull-left sort-box" id="criteria">
- </div>
- <div class="pull-left screen-tj">
- <span class="right-line"><input id="valid" type="checkbox"/> 过滤失效活动</span>
- <a onclick="gotoCalendar()"><i class="iconfont" style="font-size: 20px;"></i>查看活动日历</a>
- </div>
- </div>
- <div class="activity-list">
- <ul id="activityContainer">
- </ul>
- </div>
- </div>
- <div id="project_box" class="container projects">
- <div id="projectSource">
- </div>
- <div class="activity-list">
- <ul id="projectsContent">
- </ul>
- </div>
- </div>
- <div id="news_box" class="container projects">
- <div class="row">
- <div class="col-sm-12 col-md-12 col-lg-12 activityList" id="centerContent"></div>
- </div>
- </div>
- <!--分页-->
- <div class="container projects">
- <div style="padding-top: 28px;">
- <div id="paging"></div>
- </div>
- </div>
- <input type="hidden" id="navigation_id" th:value="${navigation_id}"/>
- <input type="hidden" id="count" th:value="${count}"/>
- </div>
- <!--页底-->
- <div th:replace="~{home/common/footer :: footer}"></div>
- <script id="content" type="text/html">
- {{each contents content }}
- <div>
- <p style="display: inline-block;width: 80%" class="textEllipsis">
- <a href="{{pagePath}}/home/contentDetail/{{content.id}}" target="_blank">{{ content.title }}</a>
- </p>
- <p style="display: inline-block;margin: 0 0 10px;" class="fr textColor hidden-xs">{{ content.create_time }}</p>
- </div>
- <!--<p class="textEllipsis1">{{ content.brief }}</p>-->
- {{/each}}
- </script>
- <script id="project" type="text/html">
- {{each projects project }}
- <li class="clearfix row">
- <div class="col-sm-1 col-md-1 col-lg-1 col-xs-1">
- <span class="project-apply black-gray">申报中</span>
- </div>
- <div class="col-sm-11 col-md-11 col-lg-11 col-xs-11" style="display: inline-block;width: 80%">
- <p style="display: inline-block;width: 80%;" class="textEllipsis">
- <a href="{{pagePath}}/home/projectDetail/{{project.id}}/{{project.isFilling}}" target="_blank">【{{
- project.project_source_name }}】 {{
- project.project_name }}</a>
- </p>
- <p style="display: inline-block;margin: 0 0 10px;" class="fr textColor hidden-xs">{{ project.create_time
- }}</p>
- <p>申报截止日期:{{ project.apply_enddate }}</p>
- </div>
- </li>
- {{/each}}
- </script>
- <script th:inline="javascript">
- var fileUrl = [[${fileUrl}]];
- $(function () {
- var date = new Date();
- if ($("#navigation_id").val() == 1) {
- $("#activity_box").show();
- $("#news_box").hide();
- }
- else {
- $("#activity_box").hide();
- $("#news_box").show();
- }
- });
- $("li[role='presentation']").removeClass();
- var id = $("#navigation_id").val();
- $("#" + id).parent().attr("class", "active");
- var pagePath = $("meta[name='_ctx']").attr("content");
- pagePath = pagePath.substring(0, pagePath.length - 1);
- var type = "", criteria = "0", isinvalid = "0", status = "";
- layui.use('element', function () {
- var element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
- });
- onInit(1);
- function onInit(pageNo) {
- if ($("#navigation_id").val() == 69 || $("#navigation_id").val() == 77) {
- renderProject(pageNo);
- }else if ($("#navigation_id").val() == 78){
- window.location.href=pagePath + "/home/serverDetail/78";
- } else if ($("#navigation_id").val() != 1) {
- $.ajax({
- url: pagePath + "/home/contentList",
- type: "post",
- data: {
- 'id': $("#navigation_id").val(),
- 'page_no': pageNo,
- 'keyword': $.trim($("input[name='keyword']").val())
- },
- dataType: "json",
- success: function (result) {
- if (result.success) {
- result.obj.pagePath = pagePath;
- var html = template('content', result.obj);
- $('#centerContent').html(html);
- layui.use('laypage', function () {
- var laypage = layui.laypage;
- //执行一个laypage实例
- laypage.render({
- elem: 'paging',
- count: result.obj.counts,
- first: '1',
- last: Math.ceil(result.obj.counts/10),
- prev: '<em><</em>',
- next: '<em>></em>',
- curr: result.obj.page_no, //当前页
- jump: function (obj, first) { //触发分页后的回调
- //触发分页后的回调,并传递当前页obj.cuur
- if (!first) {
- var cuur = obj.curr; //获取当前页
- $("#pageNum").val(cuur);
- onInit(cuur);
- }
- }
- });
- });
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- } else {
- render(pageNo);
- }
- }
- function render(pageNo) {
- $.ajax({
- url: pagePath + "/home/activityList",
- type: "post",
- data: {
- 'id': $("#navigation_id").val(),
- 'page_no': pageNo,
- 'keyword': $.trim($("input[name='keyword']").val()),
- 'type': type,
- 'criteria': criteria,
- 'isinvalid': isinvalid
- },
- dataType: "json",
- success: function (result) {
- if (result.success) {
- //result.obj.pagePath = pagePath;
- var list = result.obj.contents;
- var pangeNo = result.obj.page_no;
- var total = result.obj.counts;
- var startIndex = 10 * (pangeNo - 1);
- var endIndex = 10 * pangeNo;
- if (endIndex > total) endIndex = total;
- var typeList = result.obj.typeList;
- var newList = list.slice(startIndex, endIndex);
- var typeStr = "";
- $("#type").empty();
- typeStr += '<span>类别:</span>'
- if (type == '') {
- typeStr += '<a class="kind-box active">全部</a>'
- } else {
- typeStr += '<a class="kind-box">全部</a>'
- }
- for (var i = 0; i < typeList.length; i++) {
- if (type == typeList[i].value) {
- typeStr += '<a class="kind-box active" id="' + typeList[i].value + '">' + typeList[i].name + '</a>'
- } else {
- typeStr += '<a class="kind-box" id="' + typeList[i].value + '">' + typeList[i].name + '</a>'
- }
- }
- $("#type").append(typeStr);
- var criteriaStr = "";
- $("#criteria").empty();
- if (criteria == '0') {
- criteriaStr += '<span class="criteria active" id="0">综合排序</span>'
- } else {
- criteriaStr += '<span class="criteria" id="0">综合排序</span>'
- }
- if (criteria == '1') {
- criteriaStr += '<span class="criteria active" id="1">最新发布</span>'
- } else {
- criteriaStr += '<span class="criteria" id="1">最新发布</span>'
- }
- if (criteria == '2') {
- criteriaStr += '<span class="criteria active" id="2">热门活动</span>'
- } else {
- criteriaStr += '<span class="criteria" id="2">热门活动</span>'
- }
- $("#criteria").append(criteriaStr);
- var str = "";
- $("#activityContainer").empty();
- for (var i = 0; i < newList.length; i++) {
- str += '<li class="clearfix">'
- str += '<div class="notice-img-box">'
- str += '<img src="' + fileUrl + newList[i].fileDown.file_url + '" class="notice-img"/>'
- /* str += '<img src="' + newList[i].fileDown.download_uri + newList[i].fileDown.file_url + '" class="notice-img"/>' */
- str += '</div>'
- str += '<div class="activity-left">'
- if (newList[i].push_level == '1') {
- str += '<span style="float:right;border: 1px solid transparent;border-radius: 4px;color: #fff;background-color: #FF9900; border-color: #FF9900;padding: 0px 12px;">重要</span>'
- }
- str += '<h2 class="activity-title">' + newList[i].activity_title + '</h2>'
- str += '<p><i class="iconfont"></i> ' + newList[i].activity_starttime.substring(0, 4) + '年' + newList[i].activity_starttime.substring(5, 7) + '月' + newList[i].activity_starttime.substring(8, 10) + '日' + newList[i].activity_starttime.substring(10, 16) + '</p>'
- str += '<p><i class="iconfont"></i> ' + newList[i].activity_location + '</p>'
- str += '<div>'
- if (newList[i].activity_deadline == '0') {
- str += '<a href="' + pagePath + '/home/activityDetail/' + newList[i].id + '" class="btn btn-success radius" onclick="" target="_blank">参与报名</a>'
- } else if (newList[i].activity_deadline == '1') {
- str += '<a href="' + pagePath + '/home/activityDetail/' + newList[i].id + '" class="btn btn-success radius" onclick="" target="_blank">活动详情</a>'
- }
- //str += '<span>本活动推送于 2018年3月10日 19:00:00</span>'
- str += '</div>'
- str += '</div>'
- str += '</li>'
- }
- $("#activityContainer").append(str);
- layui.use('laypage', function () {
- var laypage = layui.laypage;
- //执行一个laypage实例
- laypage.render({
- elem: 'paging',
- count: result.obj.counts,
- first: '首页',
- last: Math.ceil(result.obj.counts/10),
- prev: '<em><</em>',
- next: '<em>></em>',
- curr: result.obj.page_no, //当前页
- jump: function (obj, first) { //触发分页后的回调
- //触发分页后的回调,并传递当前页obj.cuur
- if (!first) {
- var cuur = obj.curr; //获取当前页
- $("#pageNum").val(cuur);
- onInit(cuur);
- }
- }
- });
- });
- $(".kind-box").click(function () {
- type = this.id;
- $(".kind-box").removeClass("active")
- $(this).addClass("active")
- render(pageNo);
- })
- $(".criteria").click(function () {
- criteria = this.id;
- $(".criteria").removeClass("active")
- $(this).addClass("active")
- render(pageNo);
- })
- document.getElementById('valid').onclick = function () {
- if (this.checked) {
- isinvalid = "1"
- } else {
- isinvalid = "0"
- }
- render(pageNo);
- }
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- function gotoCalendar() {
- location.href = pagePath + '/home/calendar'
- }
- function renderProject(pageNo) {
- $.ajax({
- url: pagePath + "/home/projectList",
- type: "post",
- data: {
- 'id': $("#navigation_id").val(),
- 'page_no': pageNo,
- 'keyword': $.trim($("input[name='keyword']").val()),
- 'type': type,
- 'status': status
- },
- dataType: "json",
- success: function (result) {
- if (result.success) {
- result.obj.pagePath = pagePath;
- //项目来源类型
- var typeList = result.obj.projectSourceList;
- var statusList = result.obj.projectStatusList;
- var typeStr = "";
- $("#projectSource").empty();
- typeStr += '<div class="kind-tip"><span>来源:</span>'
- if (type == '') {
- typeStr += '<a class="kind-box active">全部</a>'
- } else {
- typeStr += '<a class="kind-box">全部</a>'
- }
- for (var i = 0; i < typeList.length; i++) {
- if (type == typeList[i].value) {
- typeStr += '<a class="kind-box active" id="' + typeList[i].value + '">' + typeList[i].name + '</a>'
- } else {
- typeStr += '<a class="kind-box" id="' + typeList[i].value + '">' + typeList[i].name + '</a>'
- }
- }
- typeStr += '</div>'
- //statusStr
- // var statusStr = "";
- // statusStr += '<span>状态:</span>'
- // if (status == '') {
- // statusStr += '<a class="kind-box active">全部</a>'
- // } else {
- // statusStr += '<a class="kind-box">全部</a>'
- // }
- // for (var i = 0; i < statusList.length; i++) {
- // if (status == statusList[i].value) {
- // statusStr += '<a class="kind-box active" id="' + statusList[i].value + '">' + statusList[i].name + '</a>'
- // } else {
- // statusStr += '<a class="kind-box" id="' + statusList[i].value + '">' + statusList[i].name + '</a>'
- // }
- // }
- $("#projectSource").append(typeStr);
- // $("#projectStatus").append(statusStr);
- var projects = result.obj.projects;
- console.log(projects);
- // var html = template('project', result.obj);
- var html = '';
- var applyStatus = "";
- for (var i = 0; i< projects.length; i++){
- if(projects[i].apply_enddate){
- var tempTime = (projects[i].apply_enddate).replace(/-/g,'/');
- }
- var applyEnddate = new Date(Date.parse(tempTime)).getTime();
- // var applyEnddate = new Date(Date.parse(tempTime.replace(/-/g,"/"))).getTime();
- // var applyStartdate = new Date(Date.parse(projects[i].apply_startdate.replace(/-/g,"/"))).getTime();
- var newDate = new Date().getTime();
- if ( applyEnddate < newDate){
- applyStatus = "申报结束";
- html += '<li class="clearfix row">' +
- ' <div style="float:left; width:100px">' +
- ' <span class="project-apply black-gray" id="apply_status">'+ applyStatus +'</span>' +
- ' </div>' ;
- }
- // else if (applyEnddate > newDate){
- // if (applyStartdate > newDate){
- // applyStatus = "未开始";
- // }
- // }
- else {
- applyStatus = "申报中";
- html += '<li class="clearfix">' +
- ' <div style="float:left; width:100px">' +
- ' <span class="project-apply" id="apply_status">'+ applyStatus +'</span>' +
- ' </div>' ;
- }
- html += /*'<li class="clearfix row">' +
- ' <div class="col-sm-1 col-md-1 col-lg-1 col-xs-1">' +
- ' <span class="project-apply" id="apply_status">'+ applyStatus +'</span>' +
- ' </div>' +*/
- ' <div class="col-sm-11 col-md-11 col-lg-11 col-xs-11" style="display: inline-block;width: 100%">' +
- ' <p style="display: inline-block;width: 80%;" class="textEllipsis">' +
- ' <a href="'+ pagePath +'/home/projectDetail/'+ projects[i].id +'/'+ projects[i].isFilling +'" target="_blank">【' +
- ' '+ projects[i].project_source_name +'】 ' +
- ' '+ projects[i].project_name +'</a>' +
- ' </p>' +
- ' <p style="display: inline-block;" class="fr textColor hidden-xs">'+ projects[i].create_time +'</p>' +
- // ' <p>申报截止日期:'+ projects[i].apply_enddate +'</p>' +
- ' </div>' +
- ' </li>';
- }
- $('#projectsContent').html(html);
- layui.use('laypage', function () {
- var laypage = layui.laypage;
- //执行一个laypage实例
- laypage.render({
- elem: 'paging',
- count: result.obj.counts,
- first: '1',
- last: Math.ceil(result.obj.counts/10),
- prev: '<em><</em>',
- next: '<em>></em>',
- curr: result.obj.page_no, //当前页
- jump: function (obj, first) { //触发分页后的回调
- //触发分页后的回调,并传递当前页obj.cuur
- if (!first) {
- var cuur = obj.curr; //获取当前页
- $("#pageNum").val(cuur);
- onInit(cuur);
- }
- }
- });
- });
- $(".kind-box").click(function () {
- type = this.id;
- // status = this.id;
- $(".kind-box").removeClass("active")
- $(this).addClass("active")
- renderProject(pageNo);
- })
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- /**
- * 服务事项
- * @param pageNo
- */
- function renderMatters(pageNo) {
- $.ajax({
- url: pagePath + "/home/serverDetail",
- type: "get",
- data: {
- 'id': $("#navigation_id").val(),
- 'page_no': pageNo,
- 'keyword': $.trim($("input[name='keyword']").val()),
- 'type': type,
- 'status': status
- },
- dataType: "json",
- success: function (result) {
- if (result.success) {
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- $("input[name='keyword']").keyup(function () {
- if (event.keyCode == 13) {
- $("#keywordSearch").trigger("click");
- }
- });
- </script>
- </body>
- </html>
- <style type="text/css">
- /*轮播图样式*/
- .pagination {
- position: absolute;
- z-index: 20;
- bottom: 10px;
- width: 100%;
- text-align: center;
- }
- .swiper-pagination-bullet {
- display: inline-block;
- width: 12px;
- height: 12px;
- border-radius: 8px;
- background: #555;
- margin: 0 8px;
- opacity: 0.8;
- border: 1px solid #fff;
- cursor: pointer;
- }
- .swiper-pagination-bullet-active {
- background: #fff;
- }
- </style>
|