| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>活动管理列表</title>
- <style>
- /*.clearfix:after {*/
- /*display: block;*/
- /*content: " ";*/
- /*overflow: hidden;*/
- /*height: 0;*/
- /*}*/
- *{
- box-sizing: border-box;
- }
- .activity-top {
- border: solid 1px #dadada;
- padding: 15px;
- }
- .activity-box {
- margin-bottom: 10px;
- }
- .activity-box:last-child {
- margin-bottom: 0;
- }
- .activity-box-label {
- display: block;
- float: left;
- width: 80px;
- padding: 5px 0;
- }
- .activity-box-list {
- float: left;
- }
- .activity-box-list ul {
- border: solid 1px #dadada;
- }
- .activity-box-list ul li {
- float: left;
- border-right: solid 1px #dadada;
- padding: 5px 20px;
- cursor: pointer;
- }
- .activity-box-list ul li.active {
- background: #7DB4D8;
- color: #fff;
- }
- .activity-box-list ul li:last-child {
- border-right: 0;
- }
- .activity-comments-list {
- padding: 40px 0;
- }
- .activity-comments-list ul li {
- border-bottom: solid 1px #dadada;
- padding-bottom: 20px;
- margin-bottom: 20px;
- }
- .comments-info {
- float: left;
- width: 80%;
- }
- .activity-info {
- float: left;
- width: 20%;
- padding-left: 30px;
- }
- .ft-green {
- display: inline-block;
- color: #fff;
- background: #00AA91;
- padding: 4px 10px;
- cursor: pointer;
- }
- .ft-gary {
- display: inline-block;
- padding: 4px 10px;
- color: #fff;
- background: #999;
- cursor: pointer;
- }
- .op-btn {
- color: #0c80fe;
- cursor: pointer;
- padding-left: 10px;
- }
- .ft-yellow {
- color: #f60;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <nav class="breadcrumb">
- <i class="Hui-iconfont"></i>
- 首页 <span class="c-gray en">></span>
- 最新反馈
- </nav>
- <div class="page-container">
- <div class="activity-top">
- <div class="clearfix activity-box">
- <span class="activity-box-label">反馈类型:</span>
- <div class="activity-box-list">
- <ul class="clearfix" id="feedback_type">
- <li class="active">全部</li>
- <li>
- <input type="hidden" value="5">
- <span>五星</span>
- <span id="five">(0)</span>
- </li>
- <li>
- <input type="hidden" value="4">
- <span>四星</span>
- <span id="four">(0)</span>
- </li>
- <li>
- <input type="hidden" value="3">
- <span>三星</span>
- <span id="three">(0)</span>
- </li>
- <li>
- <input type="hidden" value="2">
- <span>二星</span>
- <span id="two">(0)</span>
- </li>
- <li>
- <input type="hidden" value="1">
- <span>一星</span>
- <span id="one">(0)</span>
- </li>
- <!--<li>-->
- <!--<input type="hidden" value="0">-->
- <!--<span>评论</span>-->
- <!--<span id="zero">(0)</span>-->
- <!--</li>-->
- </ul>
- </div>
- </div>
- <div class="clearfix activity-box">
- <span class="activity-box-label">审核状态:</span>
- <div class="activity-box-list">
- <ul class="clearfix" id="approval_status">
- <li class="active">全部</li>
- <li>
- <input type="hidden" value="0">
- <span>待审核</span>
- <span id="approval">(0)</span>
- </li>
- <li>
- <input type="hidden" value="1">
- <span>门户显示</span>
- <span id="view">(0)</span>
- </li>
- <li>
- <input type="hidden" value="2">
- <span>门户不显示</span>
- <span id="notview">(0)</span>
- </li>
- </ul>
- </div>
- </div>
- <div style="text-align: right">
- <input type="text" class="input-text" style="width:200px" placeholder="请输入活动名称进行查询" id="activity_title"/>
- <button type="submit" class="btn btn-primary" onclick="submit()">
- 搜索
- </button>
- </div>
- </div>
- <form id="form" th:method="get">
- <div class="cl pd-5 bg-1 bk-gray mt-20">
- <span class="r">共有数据:<strong th:text="${pageInfo?.total}" id="total">0</strong> 条</span>
- </div>
- <div class="activity-comments-list">
- <ul id="feedack_list">
- </ul>
- <div th:replace="admin/common/page :: page"></div>
- </div>
- </form>
- </div>
- <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
- <script th:inline="javascript">
- var feedback_type = "";
- var approval_status = "";
- $(function () {
- $(".activity-box-list ul li").on("click", function () {
- if($(this).hasClass("active")) {
- $(this).removeClass("active")
- }
- else {
- $(this).addClass("active").siblings().removeClass("active")
- }
- });
- feedbackCount(0);
- feedbackCount(1);
- feedbackCount(2);
- feedbackCount(3);
- feedbackCount(4);
- feedbackCount(5);
- feedbackApprovalCount(0);
- feedbackApprovalCount(1);
- feedbackApprovalCount(2);
- feedbackList(null, null, null);
- });
- function feedbackList(feedback_type, approval_status, activity_title) {
- $.ajax({
- type: "GET",
- dataType: "json",
- url: pagePath + "/activity/comment/list",
- data: {
- "approval_status" : approval_status,
- "activity_title" : activity_title,
- "feedback_type" : feedback_type,
- "pageNum" : $("#pageNum").val()
- },
- success: function (result) {
- if (result.success) {
- var html = getfeedbackList(result.obj.list);
- $("#feedack_list").html(html);
- $("#total").text(result.obj.total);
- $("#pageNum").val(result.obj.pageNum);
- $("#pages").val(result.obj.pages);
- $("#export").css("display","block");
- $("#dataType").val(0);
- $("#exportData").val(0);
- loadPage();
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- function loadPage() {
- //显示分页的容器
- var paging = $("#paging");
- //当前页
- var pageNum = $("#pageNum").val();
- // //总页数
- var pages = $("#pages").val();
- //连续显示分页数
- var groups = 6;
- laypage({
- cont: paging, //容器,仅支持id名\原生DOM对象,jquery对象
- pages: pages, //总页数
- // skip:true, //是否开启跳页
- groups: groups, //连续显示分页数
- first: '首页', //首页
- last: '尾页', //尾页
- skin: '#1E9FFF', //皮肤
- curr: pageNum || 1, //当前页
- jump: function (obj, first) { //触发分页后的回调
- //触发分页后的回调,并传递当前页obj.cuur
- console.log("obj.curr:"+obj.curr);
- $("#pageNum").val(obj.curr);
- if (!first) {
- feedbackList(feedback_type, approval_status, $("#activity_title").val());
- }
- }
- });
- }
- function getfeedbackList(list){
- var html = '';
- for(var i=0; i<list.length; i++){
- html += '<li class="clearfix" >' +
- '<div class="comments-info">'+list[i].content+'</div>' +
- '<div class="activity-info" style="float: right;">'+
- /* '<p>活动名称:'+list[i].activity_title+'</p>';*/
- '<p>'+list[i].activity_title+'</p>';
- if(list[i].feedback_type === 0){
- }
- else if(list[i].feedback_type === 1){
- html += '<p>活动评价:<span class="ft-yellow">★</span></p>';
- }
- else if(list[i].feedback_type === 2){
- html += '<p>活动评价:<span class="ft-yellow">★★</span></p>';
- }
- else if(list[i].feedback_type === 3){
- html += '<p>活动评价:<span class="ft-yellow">★★★</span></p>';
- }
- else if(list[i].feedback_type === 4){
- html += '<p>活动评价:<span class="ft-yellow">★★★★</span></p>';
- }
- else if(list[i].feedback_type === 5){
- html += '<p>活动评价:<span class="ft-yellow">★★★★★</span></p>';
- }
- html += '<p>用户昵称:'+list[i].create_name+'</p>' +
- '<p>'+list[i].create_time+'</p>';
- if (list[i].approval_status === 0){
- html += '<p>' +
- '<a class="ft-green" onclick="isView(true, '+list[i].id+')">门户显示</a>'+
- '<span class="ft-gary" onclick="isView(false, '+list[i].id+')">门户不显示</span>' +
- '</p>';
- }
- else if (list[i].approval_status === 1){
- html += '<p>' +
- '<span class="ft-green">状态:门户显示</span>'+
- '<span class="op-btn" onclick="reApproval('+list[i].id+')">重新审核</span>' +
- '</p>';
- }
- else if (list[i].approval_status === 2){
- html += '<p>' +
- '<span class="ft-gary">状态:门户不显示</span>' +
- '<span class="op-btn" onclick="reApproval('+list[i].id+')">重新审核</span>' +
- '</p>';
- }
- html += '</div>'+
- '</li>';
- }
- return html;
- }
- function feedbackCount(feedback_type) {
- var feedback_count = 0;
- $.ajax({
- type: "GET",
- dataType: "json",
- // async: false,
- url: pagePath + "/activity/comment/feedbackCount",
- data: {
- "feedback_type" : feedback_type
- },
- success: function (result) {
- if (result.success) {
- feedback_count = result.obj.feedback_count;
- if (feedback_type === 0){
- $("#zero").html("("+feedback_count+")" );
- }
- else if (feedback_type === 1){
- $("#one").html("("+feedback_count+")" );
- }
- else if (feedback_type === 2){
- $("#two").html("("+feedback_count+")" );
- }
- else if (feedback_type === 3){
- $("#three").html("("+feedback_count+")" );
- }
- else if (feedback_type === 4){
- $("#four").html("("+feedback_count+")" );
- }
- else if (feedback_type === 5){
- $("#five").html("("+feedback_count+")" );
- }
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- }
- function feedbackApprovalCount(status) {
- var feedback_count = 0;
- $.ajax({
- type: "GET",
- dataType: "json",
- // async: false,
- url: pagePath + "/activity/comment/feedbackCount",
- data: {
- "approval_status" : status
- },
- success: function (result) {
- if (result.success) {
- feedback_count = result.obj.feedback_count;
- if (status === 0){
- $("#approval").html("("+feedback_count+")" );
- }
- else if (status === 1){
- $("#view").html("("+feedback_count+")" );
- }
- else if (status === 2){
- $("#notview").html("("+feedback_count+")" );
- }
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- // return approval_status;
- }
- $("ul#feedback_type").on("click","li",function(){
- feedback_type = $(this).children("input").val();
- feedbackList(feedback_type, approval_status, null);
- });
- $("ul#approval_status").on("click","li",function(){
- approval_status = $(this).children("input").val();
- feedbackList(feedback_type, approval_status, null);
- });
- function submit() {
- feedbackList(feedback_type, approval_status, $("#activity_title").val());
- }
- function isView(is_view, feedback_id) {
- var message = "确认门户显示吗?";
- if(!is_view){
- message = "确认门户不显示吗?";
- }
- layer.confirm(message, function () {
- $.ajax({
- type: "POST",
- dataType: "json",
- url: pagePath + "/activity/comment/isView",
- data: {
- "is_view" : is_view,
- "id" : feedback_id
- },
- success: function (result) {
- if (result.success) {
- smileMessage(result.message);
- window.location.href = pagePath + "/activity/comment/index";
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- });
- }
- function reApproval(id) {
- layer_show("重新审核",pagePath+"/activity/comment/re_review/"+id ,430,260);
- }
- function reFlash() {
- feedbackApprovalCount(0);
- feedbackApprovalCount(1);
- feedbackApprovalCount(2);
- feedbackList(feedback_type, approval_status, $("#activity_title").val());
- }
- </script>
- </body>
- </html>
|