| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <!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>
- .bFind-wrapper-top {
- background: #fff;
- border-color: #ccc #aaa #aaa #ccc;
- border-style: solid;
- border-width: 1px;
- height: 25px !important;
- padding: 4px;
- margin: 0;
- }
- .bsBox {
- width: auto !important;
- height: auto !important;
- }
- .text-overflow {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- </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">
- <div class="container projects">
- <div class="row">
- <div class="col-sm-6 col-md-6 col-lg-9 hidden-xs" style="padding-left: 0;">
- <ol class="breadcrumb clearfix"
- style="padding-top: 15px;border-bottom: 0px solid #fff;margin-bottom: 0;">
- <li>
- <a th:href="@{/home}">首页</a>
- </li>
- <li th:if="${navigation_id!=2}" class="active"><a th:href="@{'/home/informList/'+${navigation_id}}">[[${navigation_name}]]</a>
- </li>
- <li th:if="${navigation_id==2}" class="active"><a th:href="@{/home/unionCompany}">[[${navigation_name}]]</a>
- </li>
- <li class="active"><a><cite>活动列表</cite></a></li>
- </ol>
- </div>
- </div>
- </div>
- <div class="container projects" style="margin-top: 20px;">
- <div class="row cl">
- <div class="col-xs-3 col-sm-3">
- <div id="datebox" style="width: 250px;height: 250px;"></div>
- </div>
- <div class="col-xs-9 col-sm-9">
- <div class="cl pd-5 bg-1 bk-gray">
- <span class="l">
- <span id="currentTime"></span>
- </span>
- <span class="r">共有数据:<strong id="total">0</strong> 条</span><!-- -->
- </div>
- <table class="table table-border table-bordered table-bg table-hover">
- <thead>
- <tr>
- <th style="text-align: center">活动</th>
- </tr>
- </thead>
- <tbody id="dataTable">
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- <!--页底-->
- <div th:replace="~{home/common/footer :: footer}"></div>
- <script th:inline="javascript">
- var mark = {};
- var arr = new Array();
- var total = 0;
- var pagePath = $("meta[name='_ctx']").attr("content");
- pagePath = pagePath.substring(0, pagePath.length - 1);
- $(function () {
- getAllEvents();
- })
- //获取有活动的日期
- function getAllEvents() {
- $.ajax({
- url: pagePath + "/government/activity/getAllEvents",
- type: "get",
- dataType: "json",
- success: function (result) {
- if (result.success) {
- var list = result.obj;
- if (list.length > 0) {
- for (var i = 0; i < list.length; i++) {
- /*mark[list[i]] = "";*/
- //console.log(list[i])
- arr.push(list[i])
- }
- }
- renderDate();
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- //初始化日期插件
- function renderDate() {
- /*laydate.render({
- elem: '#datebox',
- position: 'static',
- mark: mark,
- ready: function (date) {
- var year = date.year;
- var month = date.month;
- var date = date.date;
- if (month <= 9) {
- month = "0" + month;
- }
- if (date <= 9) {
- date = "0" + date;
- }
- var value = year + "-" + month + "-" + date;
- getEventList(value);
- $("#currentTime").html(value);
- },
- change: function (value, date, endDate) {
- //console.log(value); //得到日期生成的值,如:2017-08-18
- //console.log(date); //得到日期时间对象:{year: 2017, month: 8, date: 18, hours: 0, minutes: 0, seconds: 0}
- //console.log(endDate); //得结束的日期时间对象,开启范围选择(range: true)才会返回。对象成员同上。
- getEventList(value);
- $("#currentTime").html(value);
- }
- });*/
- WdatePicker({
- eCont: 'datebox', onpicked: function (dp) {
- //alert('你选择的日期是:' + dp.cal.getDateStr())
- var date = dp.cal.getDateStr();
- getEventList(date);
- },
- specialDates: arr/*['2018-06-01', '2018-06-13']*/
- })
- }
- function getEventList(value) {
- $.ajax({
- url: pagePath + "/government/activity/getEventList",
- type: "post",
- dataType: "json",
- data: {
- activity_starttime: value
- },
- success: function (result) {
- if (result.success) {
- var list = result.obj;
- renderList(list);
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- function renderList(obj) {
- $("#dataTable").empty();
- var str = '';
- total = obj.length;
- if (obj.length > 0) {
- for (var i = 0; i < obj.length; i++) {
- str += '<tr>'
- str += '<td style="text-align: center"><a onclick="gotoDetail(' + obj[i].id + ')">' + obj[i].activity_title + '</a></td>'
- str += '</tr>'
- }
- }
- $("#total").html(total)
- $("#dataTable").append(str);
- }
- function gotoDetail(id) {
- top.location.href = pagePath + "/home/activityDetail/" + id;
- }
- </script>
- </body>
- </html>
|