Commit 31ce000bd9535b978b60e0f9255ee839aae307e6

Authored by 陈浩
1 parent 9925962b

评论审核添加打回功能,修复评论审核不回显的问题

src/main/java/com/cnlive/shenhe/controller/CommentsController.java
1 package com.cnlive.shenhe.controller; 1 package com.cnlive.shenhe.controller;
2 2
  3 +import com.alibaba.fastjson.JSONObject;
3 import com.cnlive.shenhe.bean.ErrorEnum; 4 import com.cnlive.shenhe.bean.ErrorEnum;
4 import com.cnlive.shenhe.bean.ResponseBean; 5 import com.cnlive.shenhe.bean.ResponseBean;
5 import com.cnlive.shenhe.bean.SessionUser; 6 import com.cnlive.shenhe.bean.SessionUser;
6 import com.cnlive.shenhe.entity.ShyComments; 7 import com.cnlive.shenhe.entity.ShyComments;
7 import com.cnlive.shenhe.entity.ShyUsers; 8 import com.cnlive.shenhe.entity.ShyUsers;
  9 +import com.cnlive.shenhe.entity.ShyVideos;
8 import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; 10 import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl;
9 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; 11 import com.cnlive.shenhe.serviceImpl.UsersServiceImpl;
10 import com.cnlive.shenhe.utils.AuditPass; 12 import com.cnlive.shenhe.utils.AuditPass;
11 import com.cnlive.shenhe.utils.CommonConst; 13 import com.cnlive.shenhe.utils.CommonConst;
12 import com.cnlive.shenhe.utils.CommonUtils; 14 import com.cnlive.shenhe.utils.CommonUtils;
13 import com.github.pagehelper.PageInfo; 15 import com.github.pagehelper.PageInfo;
  16 +import org.slf4j.Logger;
  17 +import org.slf4j.LoggerFactory;
14 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.stereotype.Controller; 19 import org.springframework.stereotype.Controller;
16 import org.springframework.ui.Model; 20 import org.springframework.ui.Model;
@@ -24,6 +28,7 @@ import java.util.List; @@ -24,6 +28,7 @@ import java.util.List;
24 @Controller 28 @Controller
25 @RequestMapping("/comments") 29 @RequestMapping("/comments")
26 public class CommentsController { 30 public class CommentsController {
  31 + private static Logger logger = LoggerFactory.getLogger(CommentsController.class);
27 @Autowired 32 @Autowired
28 AuditPass Pass; 33 AuditPass Pass;
29 @Autowired 34 @Autowired
@@ -178,4 +183,62 @@ public class CommentsController { @@ -178,4 +183,62 @@ public class CommentsController {
178 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "退领了" + n + "条内容"); 183 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "退领了" + n + "条内容");
179 } 184 }
180 185
  186 + /**
  187 + * 打回(审核拒绝,应要求不加权限、状态等限制)
  188 + *
  189 + * @param ids
  190 + * @param msg
  191 + * @param session
  192 + * @return
  193 + */
  194 + @PostMapping("/repulse")
  195 + @ResponseBody
  196 + public ResponseBean repulse(String ids, String msg, HttpSession session) {
  197 + SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey());
  198 + String userId = sessionUser.getUserId();
  199 + ResponseBean responseBean = new ResponseBean();
  200 + String[] commentsIds = ids.split(",");
  201 + String showMsg = "";
  202 + for (String commentsId : commentsIds) {
  203 + ShyComments comments = commentsService.selectByPrimaryKey(Integer.parseInt(commentsId));
  204 + JSONObject result = null;
  205 + JSONObject json = new JSONObject();
  206 + json.put("activity_id", comments.getActivity_id());
  207 + json.put("state", 4);
  208 + json.put("attr_tags", "");
  209 + json.put("msg", msg);
  210 + try {
  211 + result = Pass.commentPass(json, comments.getCallback());
  212 + } catch (Exception e) {
  213 + logger.error("评论回调失败,activity_id:{}", comments.getActivity_id());
  214 + showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败";
  215 + break;
  216 + }
  217 + if (result == null) {
  218 + logger.error("评论回调错误,且无返回信息。activity_id:{}", comments.getActivity_id());
  219 + showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败";
  220 + break;
  221 + } else {
  222 + Integer code = result.getInteger("errorCode");
  223 + if (code != 0) {
  224 + logger.error("评论回调错误,activity_id:{},errorCode:{},errorMessage:{}", comments.getActivity_id(), code, result.getString("errorMessage"));
  225 + showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败";
  226 + break;
  227 + }
  228 + comments.setState(2);
  229 + comments.setAuditor_id(userId);
  230 + comments.setMsg(msg);
  231 + int i = commentsService.updateByPrimaryKeySelective(comments);
  232 + if (i != 1) {
  233 + logger.error("评论回调失败,修改结果为0条activity_id:{}", comments.getActivity_id());
  234 + showMsg = showMsg + "," + comments.getComment_user_name() + "的评论拒绝请求失败";
  235 + }
  236 + }
  237 + }
  238 + if (CommonUtils.isNotEmpty(showMsg)) {
  239 + responseBean.setErrorCode(ErrorEnum.ERROR.getErrorCode());
  240 + responseBean.setErrorMessage(showMsg);
  241 + }
  242 + return responseBean;
  243 + }
181 } 244 }
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
4 import com.cnlive.shenhe.entity.ShyComments; 4 import com.cnlive.shenhe.entity.ShyComments;
5 import com.cnlive.shenhe.entity.ShySites; 5 import com.cnlive.shenhe.entity.ShySites;
6 import com.cnlive.shenhe.entity.ShyUsers; 6 import com.cnlive.shenhe.entity.ShyUsers;
  7 +import com.cnlive.shenhe.entity.ShyVideos;
7 import com.cnlive.shenhe.mapper.ShyCommentsMapper; 8 import com.cnlive.shenhe.mapper.ShyCommentsMapper;
8 import com.cnlive.shenhe.mapper.ShySitesMapper; 9 import com.cnlive.shenhe.mapper.ShySitesMapper;
9 import com.cnlive.shenhe.mapper.ShyUsersMapper; 10 import com.cnlive.shenhe.mapper.ShyUsersMapper;
@@ -234,6 +235,14 @@ public class CommentsServiceImpl { @@ -234,6 +235,14 @@ public class CommentsServiceImpl {
234 } 235 }
235 return n; 236 return n;
236 } 237 }
  238 + public ShyComments selectByPrimaryKey(Integer id) {
  239 + ShyComments shyComments = shyCommentsMapper.selectByPrimaryKey(id);
  240 + return shyComments;
  241 + }
  242 + public int updateByPrimaryKeySelective(ShyComments comments) {
  243 + return shyCommentsMapper.updateByPrimaryKeySelective(comments);
  244 + }
  245 +
237 } 246 }
238 247
239 248
src/main/resources/templates/page/comment.html
@@ -34,21 +34,45 @@ @@ -34,21 +34,45 @@
34 </button> 34 </button>
35 </div> 35 </div>
36 36
37 - <div class="btn-group margin-bottom" id="receive_select" >  
38 - <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" onclick="receive(0);">认领</button>  
39 - <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" onclick="receive(100);">认领100条</button>  
40 - <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" onclick="receive(1000);">认领1000条</button>  
41 - <button type="button" class="btn btn-warning btn-sm margin-r-5 action_bottom" onclick="retReceive();">退领</button> 37 + <div class="btn-group margin-bottom" id="receive_select">
  38 + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
  39 + onclick="receive(0);">认领
  40 + </button>
  41 + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
  42 + onclick="receive(100);">认领100条
  43 + </button>
  44 + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
  45 + onclick="receive(1000);">认领1000条
  46 + </button>
  47 + <button type="button" class="btn btn-warning btn-sm margin-r-5 action_bottom"
  48 + onclick="retReceive();">退领
  49 + </button>
  50 + <button type="button" class="btn btn-danger btn-sm margin-r-5 action claim"
  51 + value="2" data="claim1000" id="claim1000" data-toggle="modal"
  52 + data-target="#modal" onclick="repulse();">拒绝
  53 + </button>
42 </div> 54 </div>
43 55
44 </div> 56 </div>
45 57
46 <div class="btn-group margin-bottom pull-right"> 58 <div class="btn-group margin-bottom pull-right">
47 <div class="btn-group margin-bottom"> 59 <div class="btn-group margin-bottom">
48 - <button type="button" id="all_button" class="btn btn-sm margin-r-5 action_bottom" onclick="searchStatus('','')">全部</button>  
49 - <button type="button" id="before_button" class="btn btn-sm margin-r-5 action_bottom" onclick="searchStatus('0',false)">全部待领</button>  
50 - <button type="button" id="my_after_button" class="btn btn-sm margin-r-5 action_bottom" onclick="searchStatus('1,2',true)">我的已审</button>  
51 - <button type="button" id="my_brfore_button" class="btn btn-sm margin-r-5 action_bottom" onclick="searchStatus('0',true)">我的未审</button> 60 + <button type="button" id="all_button"
  61 + class="btn btn-sm margin-r-5 action_bottom"
  62 + onclick="searchStatus('','')">全部
  63 + </button>
  64 + <button type="button" id="before_button"
  65 + class="btn btn-sm margin-r-5 action_bottom"
  66 + onclick="searchStatus('0',false)">全部待领
  67 + </button>
  68 + <button type="button" id="my_after_button"
  69 + class="btn btn-sm margin-r-5 action_bottom"
  70 + onclick="searchStatus('1,2',true)">我的已审
  71 + </button>
  72 + <button type="button" id="my_brfore_button"
  73 + class="btn btn-sm margin-r-5 action_bottom"
  74 + onclick="searchStatus('0',true)">我的未审
  75 + </button>
52 </div> 76 </div>
53 <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query" 77 <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query"
54 onclick="openOrClose(&#39;forms&#39;)">高级查询 78 onclick="openOrClose(&#39;forms&#39;)">高级查询
@@ -65,13 +89,15 @@ @@ -65,13 +89,15 @@
65 <div class="col-md-5" style="padding: 0"> 89 <div class="col-md-5" style="padding: 0">
66 <label for="activity_id" class="control-label cb-toolbar">活动id:</label> 90 <label for="activity_id" class="control-label cb-toolbar">活动id:</label>
67 <div class="col-sm-9" style="padding: 0;"> 91 <div class="col-sm-9" style="padding: 0;">
68 - <input class="form-control" name="activity_id" type="text" id="activity_id" th:value="${param.activity_id}"> 92 + <input class="form-control" name="activity_id" type="text"
  93 + id="activity_id" th:value="${param.activity_id}">
69 </div> 94 </div>
70 </div> 95 </div>
71 <div class="col-md-4" style="padding: 0"> 96 <div class="col-md-4" style="padding: 0">
72 <label for="content" class="control-label cb-toolbar">内容:</label> 97 <label for="content" class="control-label cb-toolbar">内容:</label>
73 <div class="col-sm-9" style="padding: 0;"> 98 <div class="col-sm-9" style="padding: 0;">
74 - <input class="form-control" name="content" type="text" id="content" th:value="${param.content}"> 99 + <input class="form-control" name="content" type="text" id="content"
  100 + th:value="${param.content}">
75 </div> 101 </div>
76 </div> 102 </div>
77 <div class="col-md-3" style="padding: 0"> 103 <div class="col-md-3" style="padding: 0">
@@ -86,7 +112,7 @@ @@ -86,7 +112,7 @@
86 </div> 112 </div>
87 <script th:inline="javascript"> 113 <script th:inline="javascript">
88 var isHot = [[${param.is_hot}]]; 114 var isHot = [[${param.is_hot}]];
89 - if(isHot!=null&&isHot[0]!=""){ 115 + if (isHot != null && isHot[0] != "") {
90 $("#is_hot").val(isHot[0]); 116 $("#is_hot").val(isHot[0]);
91 } 117 }
92 </script> 118 </script>
@@ -108,14 +134,16 @@ @@ -108,14 +134,16 @@
108 <div class="col-md-6" style="padding: 0;width: 45%;"> 134 <div class="col-md-6" style="padding: 0;width: 45%;">
109 <label for="start_date" class="control-label cb-toolbar">至</label> 135 <label for="start_date" class="control-label cb-toolbar">至</label>
110 <div class="input-group col-md-9 date"> 136 <div class="input-group col-md-9 date">
111 - <input class="form-control date" name="end_date" type="text" th:value="${param.end_date}"> 137 + <input class="form-control date" name="end_date" type="text"
  138 + th:value="${param.end_date}">
112 <span class="input-group-addon"> 139 <span class="input-group-addon">
113 <span class="glyphicon glyphicon-calendar"></span> 140 <span class="glyphicon glyphicon-calendar"></span>
114 </span> 141 </span>
115 </div> 142 </div>
116 </div> 143 </div>
117 - <div class="col-md-6" style="padding: 0;width: 2%;" >  
118 - <button type="button" class="btn btn-info btn-sm" id="comments_query" onclick="javascript:$('#commentForm').submit();">查 询 144 + <div class="col-md-6" style="padding: 0;width: 2%;">
  145 + <button type="button" class="btn btn-info btn-sm" id="comments_query"
  146 + onclick="javascript:$('#commentForm').submit();">查 询
119 </button> 147 </button>
120 </div> 148 </div>
121 </div> 149 </div>
@@ -138,7 +166,8 @@ @@ -138,7 +166,8 @@
138 <tr> 166 <tr>
139 <th class="bs-checkbox " style="width: 3%; " data-field="state" 167 <th class="bs-checkbox " style="width: 3%; " data-field="state"
140 tabindex="0"> 168 tabindex="0">
141 - <div class="th-inner "><input name="btSelectAll" type="checkbox" id="select_all"> 169 + <div class="th-inner "><input name="btSelectAll" type="checkbox"
  170 + id="select_all">
142 </div> 171 </div>
143 <div class="fht-cell"></div> 172 <div class="fht-cell"></div>
144 </th> 173 </th>
@@ -206,58 +235,89 @@ @@ -206,58 +235,89 @@
206 </tr> 235 </tr>
207 </thead> 236 </thead>
208 <tbody> 237 <tbody>
209 - <tr th:data-index="${commentStat.index}" th:each="comment : ${commentPage.list}"> 238 + <tr th:data-index="${commentStat.index}"
  239 + th:each="comment : ${commentPage.list}">
210 <td class="bs-checkbox "> 240 <td class="bs-checkbox ">
211 - <input data-index="0" name="btSelectItem" type="checkbox" th:value="${comment.id}"></td>  
212 - <td style="text-align: center; width: 5%;" th:text="${session.sessionUser.company}">网加加</td>  
213 - <td style="text-align: center; width: 5%;" th:text="${comment.comment_user_name}">鱼</td> 241 + <input data-index="0" name="btSelectItem" type="checkbox"
  242 + th:value="${comment.id}"></td>
  243 + <td style="text-align: center; width: 5%;"
  244 + th:text="${session.sessionUser.company}">网加加
  245 + </td>
  246 + <td style="text-align: center; width: 5%;"
  247 + th:text="${comment.comment_user_name}">鱼
  248 + </td>
214 <td style="text-align: center; width: 6%;"> 249 <td style="text-align: center; width: 6%;">
215 - <div width="60px" height="60px"><img th:src="@{${comment.comment_user_avatar}}" width="60px" 250 + <div width="60px" height="60px"><img
  251 + th:src="@{${comment.comment_user_avatar}}" width="60px"
216 alt="用户头像"></div> 252 alt="用户头像"></div>
217 </td> 253 </td>
218 - <td style="text-align: center; width: 6%;" th:text="${comment.comment_user_ip}">114.242.177.100</td>  
219 - <td style="text-align: center; width: 22%;"><a th:title="${comment.comment_content}"  
220 - style="font-weight:bold;font-size:16px;"  
221 - data-toggle="tooltip"  
222 - data-placement="right" th:text="${comment.comment_content}">哈哈哈</a> 254 + <td style="text-align: center; width: 6%;"
  255 + th:text="${comment.comment_user_ip}">114.242.177.100
  256 + </td>
  257 + <td style="text-align: center; width: 22%;"><a
  258 + th:title="${comment.comment_content}"
  259 + style="font-weight:bold;font-size:16px;"
  260 + data-toggle="tooltip"
  261 + data-placement="right"
  262 + th:text="${comment.comment_content}">哈哈哈</a>
223 </td> 263 </td>
224 - <td style="text-align: center; width: 15%;" th:text="${comment.comment_title}"> 264 + <td style="text-align: center; width: 15%;"
  265 + th:text="${comment.comment_title}">
225 </td> 266 </td>
226 - <td style="text-align: center; width: 6%;" th:text="${comment.auditor}">发布 267 + <td style="text-align: center; width: 6%;" th:text="${comment.auditor}">
  268 + 发布
227 openadmin9@cnlive.com 269 openadmin9@cnlive.com
228 </td> 270 </td>
229 - <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==1}">否</td>  
230 - <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==2}">是</td>  
231 - <td style="text-align: center; width: 4%;" th:if="${comment.is_hot!=2&&comment.is_hot!=1}">全部</td> 271 + <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==1}">
  272 + 否
  273 + </td>
  274 + <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==2}">
  275 + 是
  276 + </td>
  277 + <td style="text-align: center; width: 4%;"
  278 + th:if="${comment.is_hot!=2&&comment.is_hot!=1}">全部
  279 + </td>
232 <td style="text-align: center; width: 5%;"> 280 <td style="text-align: center; width: 5%;">
233 - <span class="btn btn-sm btn-warning" th:if="${comment.state==0}">待审</span>  
234 - <span class="btn btn-sm btn-success" th:if="${comment.state==1}">已审</span>  
235 - <span class="btn btn-sm btn-danger" th:if="${comment.state==2}">拒绝</span>  
236 - <span class="btn btn-sm btn-danger" th:if="${comment.state==3}">自动审核失败</span> 281 + <span class="btn btn-sm btn-warning"
  282 + th:if="${comment.state==0}">待审</span>
  283 + <span class="btn btn-sm btn-success"
  284 + th:if="${comment.state==1}">已审</span>
  285 + <span class="btn btn-sm btn-danger"
  286 + th:if="${comment.state==2}">拒绝</span>
  287 + <span class="btn btn-sm btn-danger" th:if="${comment.state==3}">自动审核失败</span>
  288 + </td>
  289 + <td style="text-align: center; width: 8%;"
  290 + th:text="${#dates.format(comment.comment_time, 'yyyy-MM-dd HH:mm:ss')}">
  291 + 2018-11-28 16:08:00
237 </td> 292 </td>
238 - <td style="text-align: center; width: 8%;" th:text="${#dates.format(comment.comment_time, 'yyyy-MM-dd HH:mm:ss')}">2018-11-28 16:08:00</td>  
239 <td style="text-align: center; width: 22%;"> 293 <td style="text-align: center; width: 22%;">
240 <a class="detail" th:href="@{'/comments/details/'+${comment.id}}"> 294 <a class="detail" th:href="@{'/comments/details/'+${comment.id}}">
241 <button class="btn btn-info btn-sm">查看</button> 295 <button class="btn btn-info btn-sm">查看</button>
242 </a> 296 </a>
243 297
244 <span th:if="${comment.state==0 and !comment.receive}"> &nbsp;</span> 298 <span th:if="${comment.state==0 and !comment.receive}"> &nbsp;</span>
245 - <a th:href="@{'javascript:applyReceive('+${comment.id}+')'}" th:if="${comment.state==0 and !comment.receive}"> 299 + <a th:href="@{'javascript:applyReceive('+${comment.id}+')'}"
  300 + th:if="${comment.state==0 and !comment.receive}">
246 <button class="btn btn-primary btn-sm">认领</button> 301 <button class="btn btn-primary btn-sm">认领</button>
247 </a> 302 </a>
248 303
249 <span th:if="${comment.state==0 and comment.receive and session.sessionUser.userId==comment.receive_user_id}"> &nbsp;</span> 304 <span th:if="${comment.state==0 and comment.receive and session.sessionUser.userId==comment.receive_user_id}"> &nbsp;</span>
250 - <a th:href="@{'javascript:applyRetReceive('+${comment.id}+')'}" th:if="${comment.state==0 and comment.receive and session.sessionUser.userId==comment.receive_user_id}"> 305 + <a th:href="@{'javascript:applyRetReceive('+${comment.id}+')'}"
  306 + th:if="${comment.state==0 and comment.receive and session.sessionUser.userId==comment.receive_user_id}">
251 <button class="btn btn-warning btn-sm">退领</button> 307 <button class="btn btn-warning btn-sm">退领</button>
252 </a> 308 </a>
253 309
254 <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> &nbsp;</span> 310 <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> &nbsp;</span>
255 - <a class="pass_one" th:href="@{'javascript:comment('+${comment.id}+',1)'}" th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> 311 + <a class="pass_one"
  312 + th:href="@{'javascript:comment('+${comment.id}+',1)'}"
  313 + th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}">
256 <button class="btn btn-success btn-sm">通过</button> 314 <button class="btn btn-success btn-sm">通过</button>
257 </a> 315 </a>
258 316
259 <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> &nbsp;</span> 317 <span th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> &nbsp;</span>
260 - <a class="failed_one" th:href="@{'javascript:comment('+${comment.id}+',2)'}" th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}"> 318 + <a class="failed_one"
  319 + th:href="@{'javascript:comment('+${comment.id}+',2)'}"
  320 + th:if="${comment.receive and session.sessionUser.userId==comment.receive_user_id}">
261 <button class="btn btn-danger btn-sm">拒绝</button> 321 <button class="btn btn-danger btn-sm">拒绝</button>
262 </a> 322 </a>
263 </td> 323 </td>
@@ -276,21 +336,44 @@ @@ -276,21 +336,44 @@
276 <div class="pull-left pagination-detail"> 336 <div class="pull-left pagination-detail">
277 <span class="pagination-info" th:text="'共 '+${commentPage.total}+' 条记录'">总共 0 条记录</span> 337 <span class="pagination-info" th:text="'共 '+${commentPage.total}+' 条记录'">总共 0 条记录</span>
278 </div> 338 </div>
279 - <div class="pull-right pagination" > 339 + <div class="pull-right pagination">
280 <ul class="pagination" th:if="${commentPage.pages>1}" id="pageUl"> 340 <ul class="pagination" th:if="${commentPage.pages>1}" id="pageUl">
281 <li class="page-pre"><a th:href="@{'/comments/page'}">‹‹</a></li> 341 <li class="page-pre"><a th:href="@{'/comments/page'}">‹‹</a></li>
282 - <li class="page-pre" th:if="${!commentPage.isFirstPage}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-1}}">‹</a></li>  
283 -  
284 - <li class="page-number" th:if="${commentPage.pageNum-3>=1}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-3}}" th:text="${commentPage.pageNum-3}">2</a></li>  
285 - <li class="page-number" th:if="${commentPage.pageNum-2>=1}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-2}}" th:text="${commentPage.pageNum-2}">2</a></li>  
286 - <li class="page-number" th:if="${commentPage.pageNum-1>=1}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-1}}" th:text="${commentPage.pageNum-1}">2</a></li>  
287 - <li class="page-number active"><a href="javaScript:void(0);" th:text="${commentPage.pageNum}">2</a></li>  
288 - <li class="page-number" th:if="${commentPage.pageNum+1<=commentPage.pages}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+1}}" th:text="${commentPage.pageNum+1}">2</a></li>  
289 - <li class="page-number" th:if="${commentPage.pageNum+2<=commentPage.pages}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+2}}" th:text="${commentPage.pageNum+2}">2</a></li>  
290 - <li class="page-number" th:if="${commentPage.pageNum+3<=commentPage.pages}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+3}}" th:text="${commentPage.pageNum+3}">2</a></li>  
291 -  
292 - <li class="page-next" th:if="${!commentPage.isLastPage}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+1}}">›</a></li>  
293 - <li class="page-next"><a th:href="@{'/comments/page?page='+${commentPage.pages}}">››</a></li> 342 + <li class="page-pre" th:if="${!commentPage.isFirstPage}"><a
  343 + th:href="@{'/comments/page?page='+${commentPage.pageNum-1}}">‹</a>
  344 + </li>
  345 +
  346 + <li class="page-number" th:if="${commentPage.pageNum-3>=1}"><a
  347 + th:href="@{'/comments/page?page='+${commentPage.pageNum-3}}"
  348 + th:text="${commentPage.pageNum-3}">2</a></li>
  349 + <li class="page-number" th:if="${commentPage.pageNum-2>=1}"><a
  350 + th:href="@{'/comments/page?page='+${commentPage.pageNum-2}}"
  351 + th:text="${commentPage.pageNum-2}">2</a></li>
  352 + <li class="page-number" th:if="${commentPage.pageNum-1>=1}"><a
  353 + th:href="@{'/comments/page?page='+${commentPage.pageNum-1}}"
  354 + th:text="${commentPage.pageNum-1}">2</a></li>
  355 + <li class="page-number active"><a href="javaScript:void(0);"
  356 + th:text="${commentPage.pageNum}">2</a>
  357 + </li>
  358 + <li class="page-number"
  359 + th:if="${commentPage.pageNum+1<=commentPage.pages}"><a
  360 + th:href="@{'/comments/page?page='+${commentPage.pageNum+1}}"
  361 + th:text="${commentPage.pageNum+1}">2</a></li>
  362 + <li class="page-number"
  363 + th:if="${commentPage.pageNum+2<=commentPage.pages}"><a
  364 + th:href="@{'/comments/page?page='+${commentPage.pageNum+2}}"
  365 + th:text="${commentPage.pageNum+2}">2</a></li>
  366 + <li class="page-number"
  367 + th:if="${commentPage.pageNum+3<=commentPage.pages}"><a
  368 + th:href="@{'/comments/page?page='+${commentPage.pageNum+3}}"
  369 + th:text="${commentPage.pageNum+3}">2</a></li>
  370 +
  371 + <li class="page-next" th:if="${!commentPage.isLastPage}"><a
  372 + th:href="@{'/comments/page?page='+${commentPage.pageNum+1}}">›</a>
  373 + </li>
  374 + <li class="page-next"><a
  375 + th:href="@{'/comments/page?page='+${commentPage.pages}}">››</a>
  376 + </li>
294 </ul> 377 </ul>
295 </div> 378 </div>
296 </div> 379 </div>
@@ -304,35 +387,56 @@ @@ -304,35 +387,56 @@
304 </div> 387 </div>
305 388
306 389
307 -  
308 </section><!-- /.content --> 390 </section><!-- /.content -->
309 </div> 391 </div>
310 <!-- /.content-wrapper --> 392 <!-- /.content-wrapper -->
311 - 393 + <!-- 模态框(Modal) -->
  394 + <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  395 + <div class="modal-dialog">
  396 + <div class="modal-content" style="margin-top: 30%;">
  397 + <div class="modal-header">
  398 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  399 + <h4 class="modal-title" id="myModalLabel">审核意见</h4>
  400 + </div>
  401 + <div class="modal-body">
  402 + <div class="form-group" style="margin-bottom: 0;">
  403 + <textarea id="reviewMsg" style="width: 100%;height: 80px;"></textarea>
  404 + </div>
  405 + <div class="form-group">
  406 + </div>
  407 + </div>
  408 + <div class="modal-footer">
  409 + <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
  410 + <button type="button" class="btn btn-primary" onclick="javascript:repulseSubmit();">提交</button>
  411 + </div>
  412 + </div><!-- /.modal-content -->
  413 + </div><!-- /.modal-dialog -->
  414 + </div>
  415 + <!-- /.modal -->
312 <script th:inline="javascript"> 416 <script th:inline="javascript">
313 var pages = [[${param.page}]]; 417 var pages = [[${param.page}]];
314 var pageNum = 1; 418 var pageNum = 1;
315 var sea = location.search; 419 var sea = location.search;
316 $(function () { 420 $(function () {
317 //判断除页数参数外是否还有其他参数 421 //判断除页数参数外是否还有其他参数
318 - if(sea!=""){  
319 - if(pages!=null){ 422 + if (sea != "") {
  423 + if (pages != null) {
320 pageNum = pages[0]; 424 pageNum = pages[0];
321 } 425 }
322 //有其他参数,页脚链接加上参数 426 //有其他参数,页脚链接加上参数
323 - if(sea!="?page="+pageNum){  
324 - sea = sea.replace("page="+pageNum,"");//去掉page参数  
325 - $("#pageUl li a").each(function(i,e){ 427 + if (sea != "?page=" + pageNum) {
  428 + sea = sea.replace("page=" + pageNum, "");//去掉page参数
  429 + $("#pageUl li a").each(function (i, e) {
326 var h = $(e).attr("href"); 430 var h = $(e).attr("href");
327 - if(h.indexOf("page=")>=0){  
328 - sea = sea.replace("?","");//去掉问号  
329 - if(!sea.startsWith("&"))sea = "&" + sea;  
330 - h = h+sea;  
331 - $(e).attr("href",h);  
332 - }else if(h.endsWith("page")){  
333 - sea = sea.replace("?&","?");  
334 - h = h+sea;  
335 - $(e).attr("href",h); 431 + if (h.indexOf("page=") >= 0) {
  432 + sea = sea.replace("?", "");//去掉问号
  433 + if (!sea.startsWith("&")) sea = "&" + sea;
  434 + h = h + sea;
  435 + $(e).attr("href", h);
  436 + } else if (h.endsWith("page")) {
  437 + sea = sea.replace("?&", "?");
  438 + h = h + sea;
  439 + $(e).attr("href", h);
336 } 440 }
337 }) 441 })
338 } 442 }
@@ -340,75 +444,76 @@ @@ -340,75 +444,76 @@
340 444
341 445
342 //按钮颜色显示 446 //按钮颜色显示
343 - var state = [[${param.state}]]?[[${param.state}]][0]:null;  
344 - var receive = [[${param.receive}]]?[[${param.receive}]][0]:null;  
345 - var stateIsNull = $.trim(state)=="";  
346 - var receiveIsNull = $.trim(receive)=="";  
347 - if(stateIsNull&&receiveIsNull){ 447 + var state = [[${param.state}]] ? [[${param.state}]][0] : null;
  448 + var receive = [[${param.receive}]] ? [[${param.receive}]][0] : null;
  449 + var stateIsNull = $.trim(state) == "";
  450 + var receiveIsNull = $.trim(receive) == "";
  451 + if (stateIsNull && receiveIsNull) {
348 $("#all_button").addClass("btn-info"); 452 $("#all_button").addClass("btn-info");
349 - }else if(state=='0'&&receive=='false'){ 453 + } else if (state == '0' && receive == 'false') {
350 $("#before_button").addClass("btn-warning"); 454 $("#before_button").addClass("btn-warning");
351 - }else if(!stateIsNull&&state!='0'&&receive=='true'){ 455 + } else if (!stateIsNull && state != '0' && receive == 'true') {
352 $("#my_after_button").addClass("btn-success"); 456 $("#my_after_button").addClass("btn-success");
353 - }else if(state=='0'&&receive=='true'){ 457 + } else if (state == '0' && receive == 'true') {
354 $("#my_brfore_button").addClass("btn-danger"); 458 $("#my_brfore_button").addClass("btn-danger");
355 } 459 }
356 460
357 }) 461 })
  462 +
358 //已审、未审、全部,状态切换 463 //已审、未审、全部,状态切换
359 - function searchStatus(commentStatus,receive){ 464 + function searchStatus(commentStatus, receive) {
360 var href = location.href; 465 var href = location.href;
361 - if(sea==""){//没有参数  
362 - if(href.endsWith("?"))href = href.substring(0,href.length-1);  
363 - if($.trim(commentStatus)!='')href = href+"?state="+commentStatus;  
364 - }else if(sea.indexOf("state=")<0){//没有参数state  
365 - var se = sea.replace("?","");//去掉问号,防止问号和要去掉的参数相连  
366 - if(sea.indexOf("page=")>=0){//有参数page,去掉 466 + if (sea == "") {//没有参数
  467 + if (href.endsWith("?")) href = href.substring(0, href.length - 1);
  468 + if ($.trim(commentStatus) != '') href = href + "?state=" + commentStatus;
  469 + } else if (sea.indexOf("state=") < 0) {//没有参数state
  470 + var se = sea.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  471 + if (sea.indexOf("page=") >= 0) {//有参数page,去掉
367 var split = se.split("&"); 472 var split = se.split("&");
368 var h = ""; 473 var h = "";
369 for (var i = 0; i < split.length; i++) { 474 for (var i = 0; i < split.length; i++) {
370 var s = split[i]; 475 var s = split[i];
371 - if(s.indexOf("page=")<0) h = h+"&"+split[i]; 476 + if (s.indexOf("page=") < 0) h = h + "&" + split[i];
372 } 477 }
373 se = h.substring(1); 478 se = h.substring(1);
374 } 479 }
375 - if($.trim(commentStatus)!='')href = location.origin+location.pathname+"?"+se+"&state="+commentStatus;  
376 - }else{//有参数state  
377 - if(href.indexOf("&")>=0){//有其他参数,去掉page和旧的state  
378 - var se = sea.replace("?","");//去掉问号 480 + if ($.trim(commentStatus) != '') href = location.origin + location.pathname + "?" + se + "&state=" + commentStatus;
  481 + } else {//有参数state
  482 + if (href.indexOf("&") >= 0) {//有其他参数,去掉page和旧的state
  483 + var se = sea.replace("?", "");//去掉问号
379 var split = se.split("&"); 484 var split = se.split("&");
380 var h = ""; 485 var h = "";
381 for (var i = 0; i < split.length; i++) { 486 for (var i = 0; i < split.length; i++) {
382 var s = split[i]; 487 var s = split[i];
383 - if(s.indexOf("state=")<0&&s.indexOf("page=")<0) h = h+"&"+split[i]; 488 + if (s.indexOf("state=") < 0 && s.indexOf("page=") < 0) h = h + "&" + split[i];
384 } 489 }
385 - if($.trim(commentStatus)!=''){  
386 - href =location.origin+location.pathname+"?state="+commentStatus+"&"+ h.substring(1);  
387 - }else{  
388 - href =location.origin+location.pathname+"?"+ h.substring(1); 490 + if ($.trim(commentStatus) != '') {
  491 + href = location.origin + location.pathname + "?state=" + commentStatus + "&" + h.substring(1);
  492 + } else {
  493 + href = location.origin + location.pathname + "?" + h.substring(1);
389 } 494 }
390 - }else{//只有state参数,直接拼接链接  
391 - if($.trim(commentStatus)!=''){  
392 - href = location.origin+location.pathname+"?state="+commentStatus;  
393 - }else{  
394 - href = location.origin+location.pathname; 495 + } else {//只有state参数,直接拼接链接
  496 + if ($.trim(commentStatus) != '') {
  497 + href = location.origin + location.pathname + "?state=" + commentStatus;
  498 + } else {
  499 + href = location.origin + location.pathname;
395 } 500 }
396 } 501 }
397 } 502 }
398 //去掉领取参数 503 //去掉领取参数
399 - if(href.indexOf("receive")>=0){  
400 - href = href.replace("receive=true","");  
401 - href = href.replace("receive=false",""); 504 + if (href.indexOf("receive") >= 0) {
  505 + href = href.replace("receive=true", "");
  506 + href = href.replace("receive=false", "");
402 } 507 }
403 - href = href.replace("&&","&");  
404 - href = href.replace("?&","?");  
405 - if(href.endsWith("&"))href = href.substring(0,href.length-1);  
406 - if(href.endsWith("?"))href = href.substring(0,href.length-1);  
407 - if($.trim(receive)!=""){  
408 - if(href.indexOf("=")>0){//有其他参数  
409 - href+="&receive="+receive;  
410 - }else{  
411 - href+="?receive="+receive; 508 + href = href.replace("&&", "&");
  509 + href = href.replace("?&", "?");
  510 + if (href.endsWith("&")) href = href.substring(0, href.length - 1);
  511 + if (href.endsWith("?")) href = href.substring(0, href.length - 1);
  512 + if ($.trim(receive) != "") {
  513 + if (href.indexOf("=") > 0) {//有其他参数
  514 + href += "&receive=" + receive;
  515 + } else {
  516 + href += "?receive=" + receive;
412 } 517 }
413 } 518 }
414 location.href = href; 519 location.href = href;
@@ -416,14 +521,14 @@ @@ -416,14 +521,14 @@
416 521
417 /*全选的操作*/ 522 /*全选的操作*/
418 $('#select_all').click(function () { 523 $('#select_all').click(function () {
419 - if($("[name=btSelectItem]:checkbox:not(:checked)").length>0){  
420 - $("#select_all").prop('checked', true);  
421 - $("[name=btSelectItem]:checkbox").each(function () { 524 + if ($("[name=btSelectItem]:checkbox:not(:checked)").length > 0) {
  525 + $("#select_all").prop('checked', true);
  526 + $("[name=btSelectItem]:checkbox").each(function () {
422 $(this).prop('checked', true); 527 $(this).prop('checked', true);
423 }); 528 });
424 - }else{  
425 - $("#select_all").prop('checked', false);  
426 - $("[name=btSelectItem]:checkbox").each(function () { 529 + } else {
  530 + $("#select_all").prop('checked', false);
  531 + $("[name=btSelectItem]:checkbox").each(function () {
427 $(this).prop('checked', false); 532 $(this).prop('checked', false);
428 }); 533 });
429 } 534 }
@@ -433,17 +538,17 @@ @@ -433,17 +538,17 @@
433 $('#more_pass').click(function () { 538 $('#more_pass').click(function () {
434 var rows = $("[name=btSelectItem]:checkbox:checked"); 539 var rows = $("[name=btSelectItem]:checkbox:checked");
435 if (rows.length > 0) { 540 if (rows.length > 0) {
436 - var r=confirm("您确定通过选中的"+rows.length+"条评论吗?");  
437 - if(r==true){ 541 + var r = confirm("您确定通过选中的" + rows.length + "条评论吗?");
  542 + if (r == true) {
438 var ids = ""; 543 var ids = "";
439 - rows.each(function(i,e){ 544 + rows.each(function (i, e) {
440 ids = ids + "," + e.value; 545 ids = ids + "," + e.value;
441 }) 546 })
442 ids = ids.substring(1); 547 ids = ids.substring(1);
443 - comment(ids,1); 548 + comment(ids, 1);
444 } 549 }
445 } else { 550 } else {
446 - alert("没有选中的数据!"); 551 + alert("没有选中的数据!");
447 } 552 }
448 553
449 }); 554 });
@@ -451,14 +556,14 @@ @@ -451,14 +556,14 @@
451 $('#more_reject').click(function () { 556 $('#more_reject').click(function () {
452 var rows = $("[name=btSelectItem]:checkbox:checked"); 557 var rows = $("[name=btSelectItem]:checkbox:checked");
453 if (rows.length > 0) { 558 if (rows.length > 0) {
454 - var r=confirm("您确定拒绝选中的"+rows.length+"条评论吗?");  
455 - if(r == true){ 559 + var r = confirm("您确定拒绝选中的" + rows.length + "条评论吗?");
  560 + if (r == true) {
456 var ids = ""; 561 var ids = "";
457 - rows.each(function(i,e){ 562 + rows.each(function (i, e) {
458 ids = ids + "," + e.value; 563 ids = ids + "," + e.value;
459 }) 564 })
460 ids = ids.substring(1); 565 ids = ids.substring(1);
461 - comment(ids,2); 566 + comment(ids, 2);
462 } 567 }
463 } else { 568 } else {
464 alert("没有选中的数据!"); 569 alert("没有选中的数据!");
@@ -466,28 +571,29 @@ @@ -466,28 +571,29 @@
466 }); 571 });
467 572
468 //审核操作,status=1为通过 573 //审核操作,status=1为通过
469 - function comment(ids,status){  
470 - if(status==1){  
471 - $.post("/comments/pass?ids="+ids,function (data) {  
472 - if (data.errorCode==0){ 574 + function comment(ids, status) {
  575 + if (status == 1) {
  576 + $.post("/comments/pass?ids=" + ids, function (data) {
  577 + if (data.errorCode == 0) {
473 alert(data.errorMessage); 578 alert(data.errorMessage);
474 location.href = location.href; 579 location.href = location.href;
475 - } else{ 580 + } else {
476 alert(data.errorMessage); 581 alert(data.errorMessage);
477 } 582 }
478 }) 583 })
479 - }else{  
480 - $.post("/comments/refuse?ids="+ids,function (data) {  
481 - if (data.errorCode==0){ 584 + } else {
  585 + $.post("/comments/refuse?ids=" + ids, function (data) {
  586 + if (data.errorCode == 0) {
482 alert(data.errorMessage); 587 alert(data.errorMessage);
483 location.href = location.href; 588 location.href = location.href;
484 - } else{ 589 + } else {
485 alert(data.errorMessage); 590 alert(data.errorMessage);
486 } 591 }
487 }) 592 })
488 } 593 }
489 594
490 } 595 }
  596 +
491 /*查询*/ 597 /*查询*/
492 function openOrClose(id_name_str) { 598 function openOrClose(id_name_str) {
493 var id_name = '#' + id_name_str; 599 var id_name = '#' + id_name_str;
@@ -506,54 +612,55 @@ @@ -506,54 +612,55 @@
506 * 认领 612 * 认领
507 */ 613 */
508 function receive(n) { 614 function receive(n) {
509 - if(n>0){  
510 - applyReceiveNum(n);  
511 - } else{  
512 - var rows = $("[name=btSelectItem]:checkbox:checked");  
513 - if (rows.length > 0) {  
514 - var ids = "";  
515 - rows.each(function(i,e){  
516 - ids = ids + "," + e.value;  
517 - })  
518 - ids = ids.substring(1);  
519 - applyReceive(ids);  
520 - }else{  
521 - alert("请选择要认领的内容!");  
522 - }  
523 - } 615 + if (n > 0) {
  616 + applyReceiveNum(n);
  617 + } else {
  618 + var rows = $("[name=btSelectItem]:checkbox:checked");
  619 + if (rows.length > 0) {
  620 + var ids = "";
  621 + rows.each(function (i, e) {
  622 + ids = ids + "," + e.value;
  623 + })
  624 + ids = ids.substring(1);
  625 + applyReceive(ids);
  626 + } else {
  627 + alert("请选择要认领的内容!");
  628 + }
  629 + }
524 } 630 }
525 631
526 //认领选中请求 632 //认领选中请求
527 - function applyReceive(ids){  
528 - $.post("/comments/receive?ids="+ids,function (data) {  
529 - if (data.errorCode==0){ 633 + function applyReceive(ids) {
  634 + $.post("/comments/receive?ids=" + ids, function (data) {
  635 + if (data.errorCode == 0) {
530 alert(data.errorMessage); 636 alert(data.errorMessage);
531 location.href = location.href; 637 location.href = location.href;
532 - } else{ 638 + } else {
533 alert(data.errorMessage); 639 alert(data.errorMessage);
534 } 640 }
535 }) 641 })
536 } 642 }
  643 +
537 //认领多条请求 644 //认领多条请求
538 - function applyReceiveNum(num){  
539 - $.post("/comments/receive?num="+num,function (data) {  
540 - if (data.errorCode==0){ 645 + function applyReceiveNum(num) {
  646 + $.post("/comments/receive?num=" + num, function (data) {
  647 + if (data.errorCode == 0) {
541 alert(data.errorMessage); 648 alert(data.errorMessage);
542 location.href = location.href; 649 location.href = location.href;
543 - } else{ 650 + } else {
544 alert(data.errorMessage); 651 alert(data.errorMessage);
545 } 652 }
546 }) 653 })
547 } 654 }
548 655
549 //退领选中内容 656 //退领选中内容
550 - function retReceive(){ 657 + function retReceive() {
551 var rows = $("[name=btSelectItem]:checkbox:checked"); 658 var rows = $("[name=btSelectItem]:checkbox:checked");
552 if (rows.length > 0) { 659 if (rows.length > 0) {
553 - var r=confirm("您确定退领选中的"+rows.length+"条评论吗?");  
554 - if(r == true){ 660 + var r = confirm("您确定退领选中的" + rows.length + "条评论吗?");
  661 + if (r == true) {
555 var ids = ""; 662 var ids = "";
556 - rows.each(function(i,e){ 663 + rows.each(function (i, e) {
557 ids = ids + "," + e.value; 664 ids = ids + "," + e.value;
558 }) 665 })
559 ids = ids.substring(1); 666 ids = ids.substring(1);
@@ -565,12 +672,44 @@ @@ -565,12 +672,44 @@
565 } 672 }
566 673
567 //退领 674 //退领
568 - function applyRetReceive(ids){  
569 - $.post("/comments/retReceive?ids="+ids,function (data) {  
570 - if (data.errorCode==0){ 675 + function applyRetReceive(ids) {
  676 + $.post("/comments/retReceive?ids=" + ids, function (data) {
  677 + if (data.errorCode == 0) {
  678 + alert(data.errorMessage);
  679 + location.href = location.href;
  680 + } else {
  681 + alert(data.errorMessage);
  682 + }
  683 + })
  684 + }
  685 +
  686 + //拒绝(打回)
  687 + function repulse() {
  688 + var rows = $("[name=btSelectItem]:checkbox:checked");
  689 + if (rows.length > 0) {
  690 + var r = confirm("您确定拒绝选中的" + rows.length + "条内容吗?");
  691 + if (r == true) {
  692 + $('#msgModal').modal('show');
  693 + }
  694 + } else {
  695 + alert("没有选中的数据!");
  696 + }
  697 + }
  698 +
  699 + //提交打回
  700 + function repulseSubmit() {
  701 + var rows = $("[name=btSelectItem]:checkbox:checked");
  702 + var ids = "";
  703 + rows.each(function (i, e) {
  704 + ids = ids + "," + e.value;
  705 + })
  706 + ids = ids.substring(1);
  707 + var msg = $("#reviewMsg").val();
  708 + $.post("/comments/repulse?ids=" + ids + "&msg=" + msg, function (data) {
  709 + if (data.errorCode == 0) {
571 alert(data.errorMessage); 710 alert(data.errorMessage);
572 location.href = location.href; 711 location.href = location.href;
573 - } else{ 712 + } else {
574 alert(data.errorMessage); 713 alert(data.errorMessage);
575 } 714 }
576 }) 715 })
src/main/resources/templates/page/commentDetail.html
@@ -33,14 +33,17 @@ @@ -33,14 +33,17 @@
33 <div class="form-group"> 33 <div class="form-group">
34 <label for="comment_title" class="control-label col-sm-2">评论标题:</label> 34 <label for="comment_title" class="control-label col-sm-2">评论标题:</label>
35 <div class="col-sm-10"> 35 <div class="col-sm-10">
36 - <h5 style="font-size:1.5em; font-weight: bold;" th:text="${comment.comment_title}"></h5> 36 + <h5 style="font-size:1.5em; font-weight: bold;"
  37 + th:text="${comment.comment_title}"></h5>
37 </div> 38 </div>
38 </div> 39 </div>
39 <div class="form-group"> 40 <div class="form-group">
40 41
41 <label for="content" class="control-label col-sm-2">评论内容:</label> 42 <label for="content" class="control-label col-sm-2">评论内容:</label>
42 <div class="col-sm-8"> 43 <div class="col-sm-8">
43 - <textarea class="form-control" name="content" cols="50" rows="10" id="content" th:text="${comment.comment_content}">哈哈哈</textarea> 44 + <textarea class="form-control" name="content" cols="50" rows="10"
  45 + id="content"
  46 + th:text="${comment.comment_content}">哈哈哈</textarea>
44 </div> 47 </div>
45 48
46 </div> 49 </div>
@@ -55,19 +58,20 @@ @@ -55,19 +58,20 @@
55 </div> 58 </div>
56 <hr> 59 <hr>
57 60
58 - <!-- <div class="form-group">  
59 - <label class="control-label col-sm-2" for="attr_tags">常用审核意见:</label>  
60 - <div class="col-sm-8">  
61 - <select class="form-control select2 select2-hidden-accessible" multiple="" data-placeholder="选择常用审核意见,可多选" name="attr_tags[]" id="attr_tags" style="width: 100%;" tabindex="-1" aria-hidden="true">  
62 - </select><span class="select2 select2-container select2-container&#45;&#45;default" dir="ltr" style="width: 100%;"><span class="selection"><span class="select2-selection select2-selection&#45;&#45;multiple" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false" tabindex="0"><ul class="select2-selection__rendered"><li class="select2-search select2-search&#45;&#45;inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" placeholder="选择常用审核意见,可多选" style="width: 509px;"></li></ul></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>  
63 - </div>  
64 - </div>--> 61 + <!-- <div class="form-group">
  62 + <label class="control-label col-sm-2" for="attr_tags">常用审核意见:</label>
  63 + <div class="col-sm-8">
  64 + <select class="form-control select2 select2-hidden-accessible" multiple="" data-placeholder="选择常用审核意见,可多选" name="attr_tags[]" id="attr_tags" style="width: 100%;" tabindex="-1" aria-hidden="true">
  65 + </select><span class="select2 select2-container select2-container&#45;&#45;default" dir="ltr" style="width: 100%;"><span class="selection"><span class="select2-selection select2-selection&#45;&#45;multiple" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false" tabindex="0"><ul class="select2-selection__rendered"><li class="select2-search select2-search&#45;&#45;inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" placeholder="选择常用审核意见,可多选" style="width: 509px;"></li></ul></span></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>
  66 + </div>
  67 + </div>-->
65 68
66 69
67 <div class="form-group"> 70 <div class="form-group">
68 <label for="msg" class="control-label col-sm-2">审核备注:</label> 71 <label for="msg" class="control-label col-sm-2">审核备注:</label>
69 <div class="col-sm-8"> 72 <div class="col-sm-8">
70 - <textarea class="form-control" name="msg" cols="50" rows="10" id="msg"></textarea> 73 + <textarea class="form-control" name="msg" cols="50" rows="10"
  74 + id="msg" th:text="${comment.msg}">审核备注</textarea>
71 </div> 75 </div>
72 </div> 76 </div>
73 </div> 77 </div>
@@ -89,7 +93,8 @@ @@ -89,7 +93,8 @@
89 <div class="form-group"> 93 <div class="form-group">
90 <label for="activity_id" class="control-label col-sm-2">评论活动id:</label> 94 <label for="activity_id" class="control-label col-sm-2">评论活动id:</label>
91 <div class="col-sm-10"> 95 <div class="col-sm-10">
92 - <h5 th:text="${comment.activity_id}">769:video:comets:604_902dce9848ac482eb433f15c2cb0c401#3025</h5> 96 + <h5 th:text="${comment.activity_id}">
  97 + 769:video:comets:604_902dce9848ac482eb433f15c2cb0c401#3025</h5>
93 </div> 98 </div>
94 </div> 99 </div>
95 100
@@ -101,15 +106,18 @@ @@ -101,15 +106,18 @@
101 </div> 106 </div>
102 107
103 <div class="form-group"> 108 <div class="form-group">
104 - <label for="comment_user_avatar" class="control-label col-sm-2">用户头像:</label> 109 + <label for="comment_user_avatar"
  110 + class="control-label col-sm-2">用户头像:</label>
105 <div class="col-sm-10"> 111 <div class="col-sm-10">
106 - <h5><img width="160px" th:src="@{${comment.comment_user_avatar}}" alt="用户头像"></h5> 112 + <h5><img width="160px" th:src="@{${comment.comment_user_avatar}}"
  113 + alt="用户头像"></h5>
107 114
108 </div> 115 </div>
109 </div> 116 </div>
110 117
111 <div class="form-group"> 118 <div class="form-group">
112 - <label for="comment_user_ip" class="control-label col-sm-2">用户来源IP地址:</label> 119 + <label for="comment_user_ip"
  120 + class="control-label col-sm-2">用户来源IP地址:</label>
113 <div class="col-sm-10"> 121 <div class="col-sm-10">
114 <h5 th:text="${comment.comment_user_ip}">114.242.177.100</h5> 122 <h5 th:text="${comment.comment_user_ip}">114.242.177.100</h5>
115 </div> 123 </div>
@@ -142,7 +150,8 @@ @@ -142,7 +150,8 @@
142 <div class="form-group" th:if="${comment.state!=0}"> 150 <div class="form-group" th:if="${comment.state!=0}">
143 <label for="claimed_at" class="control-label col-sm-2">审核时间:</label> 151 <label for="claimed_at" class="control-label col-sm-2">审核时间:</label>
144 <div class="col-sm-10"> 152 <div class="col-sm-10">
145 - <h5 th:text="${#dates.format(comment.comment_time, 'yyyy-MM-dd HH:mm:ss')}">2018-11-29 10:04:35</h5> 153 + <h5 th:text="${#dates.format(comment.comment_time, 'yyyy-MM-dd HH:mm:ss')}">
  154 + 2018-11-29 10:04:35</h5>
146 </div> 155 </div>
147 </div> 156 </div>
148 </div> 157 </div>
@@ -158,37 +167,41 @@ @@ -158,37 +167,41 @@
158 167
159 <div class="box-footer"> 168 <div class="box-footer">
160 <div class="col-sm-5"> 169 <div class="col-sm-5">
161 - <button type="button" class="btn btn-danger pull-right" onclick="comment(2);">拒 绝</button> 170 + <button type="button" class="btn btn-danger pull-right" onclick="comment(2);">拒 绝
  171 + </button>
162 </div> 172 </div>
163 173
164 <div class="col-sm-1" style="margin-right:26px;"> 174 <div class="col-sm-1" style="margin-right:26px;">
165 - <button type="button" class="btn btn-primary pull-right" onclick="comment(1);">通 过</button> 175 + <button type="button" class="btn btn-primary pull-right" onclick="comment(1);">通 过
  176 + </button>
166 </div> 177 </div>
167 178
168 <div class="col-sm-1"> 179 <div class="col-sm-1">
169 - <button type="button" class="btn btn-info pull-right" onclick="self.location=document.referrer;">返回列表</button> 180 + <button type="button" class="btn btn-info pull-right"
  181 + onclick="self.location=document.referrer;">返回列表
  182 + </button>
170 </div> 183 </div>
171 </div> 184 </div>
172 <script th:inline="javascript"> 185 <script th:inline="javascript">
173 var commentId = [[${comment.id}]]; 186 var commentId = [[${comment.id}]];
174 187
175 //审核操作,status=1为通过 188 //审核操作,status=1为通过
176 - function comment(status){  
177 - if(status==1){  
178 - $.post("/comments/pass?ids="+commentId,function (data) {  
179 - if (data.errorCode==0){ 189 + function comment(status) {
  190 + if (status == 1) {
  191 + $.post("/comments/pass?ids=" + commentId, function (data) {
  192 + if (data.errorCode == 0) {
180 //location.href = history.back(); 193 //location.href = history.back();
181 - self.location=document.referrer;  
182 - } else{ 194 + self.location = document.referrer;
  195 + } else {
183 alert(data.errorMessage); 196 alert(data.errorMessage);
184 } 197 }
185 }) 198 })
186 - }else{  
187 - $.post("/comments/refuse?ids="+commentId,function (data) {  
188 - if (data.errorCode==0){ 199 + } else {
  200 + $.post("/comments/refuse?ids=" + commentId, function (data) {
  201 + if (data.errorCode == 0) {
189 //location.href = history.back(); 202 //location.href = history.back();
190 - self.location=document.referrer;  
191 - } else{ 203 + self.location = document.referrer;
  204 + } else {
192 alert(data.errorMessage); 205 alert(data.errorMessage);
193 } 206 }
194 }) 207 })
@@ -210,8 +223,7 @@ @@ -210,8 +223,7 @@
210 </div> 223 </div>
211 224
212 225
213 -  
214 - <footer th:replace="../templates/common/foot::foot" ></footer> 226 + <footer th:replace="../templates/common/foot::foot"></footer>
215 227
216 <!-- Add the sidebar's background. This div must be placed 228 <!-- Add the sidebar's background. This div must be placed
217 immediately after the control sidebar --> 229 immediately after the control sidebar -->
@@ -230,4 +242,5 @@ @@ -230,4 +242,5 @@
230 <script src="../../static/js/sidebar.js"></script> 242 <script src="../../static/js/sidebar.js"></script>
231 243
232 244
233 -</body></html>  
234 \ No newline at end of file 245 \ No newline at end of file
  246 +</body>
  247 +</html>
235 \ No newline at end of file 248 \ No newline at end of file