list.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>活动管理列表</title>
  7. <style>
  8. /*.clearfix:after {*/
  9. /*display: block;*/
  10. /*content: " ";*/
  11. /*overflow: hidden;*/
  12. /*height: 0;*/
  13. /*}*/
  14. *{
  15. box-sizing: border-box;
  16. }
  17. .activity-top {
  18. border: solid 1px #dadada;
  19. padding: 15px;
  20. }
  21. .activity-box {
  22. margin-bottom: 10px;
  23. }
  24. .activity-box:last-child {
  25. margin-bottom: 0;
  26. }
  27. .activity-box-label {
  28. display: block;
  29. float: left;
  30. width: 80px;
  31. padding: 5px 0;
  32. }
  33. .activity-box-list {
  34. float: left;
  35. }
  36. .activity-box-list ul {
  37. border: solid 1px #dadada;
  38. }
  39. .activity-box-list ul li {
  40. float: left;
  41. border-right: solid 1px #dadada;
  42. padding: 5px 20px;
  43. cursor: pointer;
  44. }
  45. .activity-box-list ul li.active {
  46. background: #7DB4D8;
  47. color: #fff;
  48. }
  49. .activity-box-list ul li:last-child {
  50. border-right: 0;
  51. }
  52. .activity-comments-list {
  53. padding: 40px 0;
  54. }
  55. .activity-comments-list ul li {
  56. border-bottom: solid 1px #dadada;
  57. padding-bottom: 20px;
  58. margin-bottom: 20px;
  59. }
  60. .comments-info {
  61. float: left;
  62. width: 80%;
  63. }
  64. .activity-info {
  65. float: left;
  66. width: 20%;
  67. padding-left: 30px;
  68. }
  69. .ft-green {
  70. display: inline-block;
  71. color: #fff;
  72. background: #00AA91;
  73. padding: 4px 10px;
  74. cursor: pointer;
  75. }
  76. .ft-gary {
  77. display: inline-block;
  78. padding: 4px 10px;
  79. color: #fff;
  80. background: #999;
  81. cursor: pointer;
  82. }
  83. .op-btn {
  84. color: #0c80fe;
  85. cursor: pointer;
  86. padding-left: 10px;
  87. }
  88. .ft-yellow {
  89. color: #f60;
  90. }
  91. </style>
  92. </head>
  93. <body layout:fragment="content">
  94. <nav class="breadcrumb">
  95. <i class="Hui-iconfont">&#xe67f;</i>
  96. 首页 <span class="c-gray en">&gt;</span>
  97. 最新反馈
  98. </nav>
  99. <div class="page-container">
  100. <div class="activity-top">
  101. <div class="clearfix activity-box">
  102. <span class="activity-box-label">反馈类型:</span>
  103. <div class="activity-box-list">
  104. <ul class="clearfix" id="feedback_type">
  105. <li class="active">全部</li>
  106. <li>
  107. <input type="hidden" value="5">
  108. <span>五星</span>
  109. <span id="five">(0)</span>
  110. </li>
  111. <li>
  112. <input type="hidden" value="4">
  113. <span>四星</span>
  114. <span id="four">(0)</span>
  115. </li>
  116. <li>
  117. <input type="hidden" value="3">
  118. <span>三星</span>
  119. <span id="three">(0)</span>
  120. </li>
  121. <li>
  122. <input type="hidden" value="2">
  123. <span>二星</span>
  124. <span id="two">(0)</span>
  125. </li>
  126. <li>
  127. <input type="hidden" value="1">
  128. <span>一星</span>
  129. <span id="one">(0)</span>
  130. </li>
  131. <!--<li>-->
  132. <!--<input type="hidden" value="0">-->
  133. <!--<span>评论</span>-->
  134. <!--<span id="zero">(0)</span>-->
  135. <!--</li>-->
  136. </ul>
  137. </div>
  138. </div>
  139. <div class="clearfix activity-box">
  140. <span class="activity-box-label">审核状态:</span>
  141. <div class="activity-box-list">
  142. <ul class="clearfix" id="approval_status">
  143. <li class="active">全部</li>
  144. <li>
  145. <input type="hidden" value="0">
  146. <span>待审核</span>
  147. <span id="approval">(0)</span>
  148. </li>
  149. <li>
  150. <input type="hidden" value="1">
  151. <span>门户显示</span>
  152. <span id="view">(0)</span>
  153. </li>
  154. <li>
  155. <input type="hidden" value="2">
  156. <span>门户不显示</span>
  157. <span id="notview">(0)</span>
  158. </li>
  159. </ul>
  160. </div>
  161. </div>
  162. <div style="text-align: right">
  163. <input type="text" class="input-text" style="width:200px" placeholder="请输入活动名称进行查询" id="activity_title"/>
  164. <button type="submit" class="btn btn-primary" onclick="submit()">
  165. 搜索
  166. </button>
  167. </div>
  168. </div>
  169. <form id="form" th:method="get">
  170. <div class="cl pd-5 bg-1 bk-gray mt-20">
  171. <span class="r">共有数据:<strong th:text="${pageInfo?.total}" id="total">0</strong> 条</span>
  172. </div>
  173. <div class="activity-comments-list">
  174. <ul id="feedack_list">
  175. </ul>
  176. <div th:replace="admin/common/page :: page"></div>
  177. </div>
  178. </form>
  179. </div>
  180. <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
  181. <script th:inline="javascript">
  182. var feedback_type = "";
  183. var approval_status = "";
  184. $(function () {
  185. $(".activity-box-list ul li").on("click", function () {
  186. if($(this).hasClass("active")) {
  187. $(this).removeClass("active")
  188. }
  189. else {
  190. $(this).addClass("active").siblings().removeClass("active")
  191. }
  192. });
  193. feedbackCount(0);
  194. feedbackCount(1);
  195. feedbackCount(2);
  196. feedbackCount(3);
  197. feedbackCount(4);
  198. feedbackCount(5);
  199. feedbackApprovalCount(0);
  200. feedbackApprovalCount(1);
  201. feedbackApprovalCount(2);
  202. feedbackList(null, null, null);
  203. });
  204. function feedbackList(feedback_type, approval_status, activity_title) {
  205. $.ajax({
  206. type: "GET",
  207. dataType: "json",
  208. url: pagePath + "/activity/comment/list",
  209. data: {
  210. "approval_status" : approval_status,
  211. "activity_title" : activity_title,
  212. "feedback_type" : feedback_type,
  213. "pageNum" : $("#pageNum").val()
  214. },
  215. success: function (result) {
  216. if (result.success) {
  217. var html = getfeedbackList(result.obj.list);
  218. $("#feedack_list").html(html);
  219. $("#total").text(result.obj.total);
  220. $("#pageNum").val(result.obj.pageNum);
  221. $("#pages").val(result.obj.pages);
  222. $("#export").css("display","block");
  223. $("#dataType").val(0);
  224. $("#exportData").val(0);
  225. loadPage();
  226. } else {
  227. errorMessage(result.message);
  228. }
  229. },
  230. error: function () {
  231. errorMessage('系统错误!');
  232. }
  233. });
  234. }
  235. function loadPage() {
  236. //显示分页的容器
  237. var paging = $("#paging");
  238. //当前页
  239. var pageNum = $("#pageNum").val();
  240. // //总页数
  241. var pages = $("#pages").val();
  242. //连续显示分页数
  243. var groups = 6;
  244. laypage({
  245. cont: paging, //容器,仅支持id名\原生DOM对象,jquery对象
  246. pages: pages, //总页数
  247. // skip:true, //是否开启跳页
  248. groups: groups, //连续显示分页数
  249. first: '首页', //首页
  250. last: '尾页', //尾页
  251. skin: '#1E9FFF', //皮肤
  252. curr: pageNum || 1, //当前页
  253. jump: function (obj, first) { //触发分页后的回调
  254. //触发分页后的回调,并传递当前页obj.cuur
  255. console.log("obj.curr:"+obj.curr);
  256. $("#pageNum").val(obj.curr);
  257. if (!first) {
  258. feedbackList(feedback_type, approval_status, $("#activity_title").val());
  259. }
  260. }
  261. });
  262. }
  263. function getfeedbackList(list){
  264. var html = '';
  265. for(var i=0; i<list.length; i++){
  266. html += '<li class="clearfix" >' +
  267. '<div class="comments-info">'+list[i].content+'</div>' +
  268. '<div class="activity-info" style="float: right;">'+
  269. /* '<p>活动名称:'+list[i].activity_title+'</p>';*/
  270. '<p>'+list[i].activity_title+'</p>';
  271. if(list[i].feedback_type === 0){
  272. }
  273. else if(list[i].feedback_type === 1){
  274. html += '<p>活动评价:<span class="ft-yellow">★</span></p>';
  275. }
  276. else if(list[i].feedback_type === 2){
  277. html += '<p>活动评价:<span class="ft-yellow">★★</span></p>';
  278. }
  279. else if(list[i].feedback_type === 3){
  280. html += '<p>活动评价:<span class="ft-yellow">★★★</span></p>';
  281. }
  282. else if(list[i].feedback_type === 4){
  283. html += '<p>活动评价:<span class="ft-yellow">★★★★</span></p>';
  284. }
  285. else if(list[i].feedback_type === 5){
  286. html += '<p>活动评价:<span class="ft-yellow">★★★★★</span></p>';
  287. }
  288. html += '<p>用户昵称:'+list[i].create_name+'</p>' +
  289. '<p>'+list[i].create_time+'</p>';
  290. if (list[i].approval_status === 0){
  291. html += '<p>' +
  292. '<a class="ft-green" onclick="isView(true, '+list[i].id+')">门户显示</a>'+
  293. '<span class="ft-gary" onclick="isView(false, '+list[i].id+')">门户不显示</span>' +
  294. '</p>';
  295. }
  296. else if (list[i].approval_status === 1){
  297. html += '<p>' +
  298. '<span class="ft-green">状态:门户显示</span>'+
  299. '<span class="op-btn" onclick="reApproval('+list[i].id+')">重新审核</span>' +
  300. '</p>';
  301. }
  302. else if (list[i].approval_status === 2){
  303. html += '<p>' +
  304. '<span class="ft-gary">状态:门户不显示</span>' +
  305. '<span class="op-btn" onclick="reApproval('+list[i].id+')">重新审核</span>' +
  306. '</p>';
  307. }
  308. html += '</div>'+
  309. '</li>';
  310. }
  311. return html;
  312. }
  313. function feedbackCount(feedback_type) {
  314. var feedback_count = 0;
  315. $.ajax({
  316. type: "GET",
  317. dataType: "json",
  318. // async: false,
  319. url: pagePath + "/activity/comment/feedbackCount",
  320. data: {
  321. "feedback_type" : feedback_type
  322. },
  323. success: function (result) {
  324. if (result.success) {
  325. feedback_count = result.obj.feedback_count;
  326. if (feedback_type === 0){
  327. $("#zero").html("("+feedback_count+")" );
  328. }
  329. else if (feedback_type === 1){
  330. $("#one").html("("+feedback_count+")" );
  331. }
  332. else if (feedback_type === 2){
  333. $("#two").html("("+feedback_count+")" );
  334. }
  335. else if (feedback_type === 3){
  336. $("#three").html("("+feedback_count+")" );
  337. }
  338. else if (feedback_type === 4){
  339. $("#four").html("("+feedback_count+")" );
  340. }
  341. else if (feedback_type === 5){
  342. $("#five").html("("+feedback_count+")" );
  343. }
  344. } else {
  345. errorMessage(result.message);
  346. }
  347. },
  348. error: function () {
  349. errorMessage('系统错误!');
  350. }
  351. });
  352. }
  353. function feedbackApprovalCount(status) {
  354. var feedback_count = 0;
  355. $.ajax({
  356. type: "GET",
  357. dataType: "json",
  358. // async: false,
  359. url: pagePath + "/activity/comment/feedbackCount",
  360. data: {
  361. "approval_status" : status
  362. },
  363. success: function (result) {
  364. if (result.success) {
  365. feedback_count = result.obj.feedback_count;
  366. if (status === 0){
  367. $("#approval").html("("+feedback_count+")" );
  368. }
  369. else if (status === 1){
  370. $("#view").html("("+feedback_count+")" );
  371. }
  372. else if (status === 2){
  373. $("#notview").html("("+feedback_count+")" );
  374. }
  375. } else {
  376. errorMessage(result.message);
  377. }
  378. },
  379. error: function () {
  380. errorMessage('系统错误!');
  381. }
  382. });
  383. // return approval_status;
  384. }
  385. $("ul#feedback_type").on("click","li",function(){
  386. feedback_type = $(this).children("input").val();
  387. feedbackList(feedback_type, approval_status, null);
  388. });
  389. $("ul#approval_status").on("click","li",function(){
  390. approval_status = $(this).children("input").val();
  391. feedbackList(feedback_type, approval_status, null);
  392. });
  393. function submit() {
  394. feedbackList(feedback_type, approval_status, $("#activity_title").val());
  395. }
  396. function isView(is_view, feedback_id) {
  397. var message = "确认门户显示吗?";
  398. if(!is_view){
  399. message = "确认门户不显示吗?";
  400. }
  401. layer.confirm(message, function () {
  402. $.ajax({
  403. type: "POST",
  404. dataType: "json",
  405. url: pagePath + "/activity/comment/isView",
  406. data: {
  407. "is_view" : is_view,
  408. "id" : feedback_id
  409. },
  410. success: function (result) {
  411. if (result.success) {
  412. smileMessage(result.message);
  413. window.location.href = pagePath + "/activity/comment/index";
  414. } else {
  415. errorMessage(result.message);
  416. }
  417. },
  418. error: function () {
  419. errorMessage('系统错误!');
  420. }
  421. });
  422. });
  423. }
  424. function reApproval(id) {
  425. layer_show("重新审核",pagePath+"/activity/comment/re_review/"+id ,430,260);
  426. }
  427. function reFlash() {
  428. feedbackApprovalCount(0);
  429. feedbackApprovalCount(1);
  430. feedbackApprovalCount(2);
  431. feedbackList(feedback_type, approval_status, $("#activity_title").val());
  432. }
  433. </script>
  434. </body>
  435. </html>