Commit 307f4b692530b43b7f89d3250e9bb4530d036d31
1 parent
6a164ab1
视频列表按钮颜色设置
Showing
5 changed files
with
34 additions
and
39 deletions
src/main/java/com/cnlive/shenhe/controller/UsersController.java
| ... | ... | @@ -53,7 +53,7 @@ public class UsersController { |
| 53 | 53 | sessionUser.setLogo(user.getUser_logo()); |
| 54 | 54 | sessionUser.setMaster(user.getMaster()); |
| 55 | 55 | request.getSession().setAttribute(SessionUser.SESSION_KEY, sessionUser); |
| 56 | - return "redirect:http://test.shen.cnlive.com/videos/page?state=0&receive=true"; | |
| 56 | + return "redirect:http://test.shen.cnlive.com/videos/page?state=0&receive=false"; | |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | return "page/error.html"; | ... | ... |
src/main/resources/templates/common/frame.html
| ... | ... | @@ -60,8 +60,8 @@ line-height: 2em; margin: 0 auto;font-size: 2em" th:text="${session.sessionUser. |
| 60 | 60 | <span class="menu-item-top">审核云</span> |
| 61 | 61 | </a> |
| 62 | 62 | <ul class="treeview-menu"> |
| 63 | - <li class="active"><a href="/videos/page?state=0"></i> 点播审核</a></li> | |
| 64 | - <li><a href="/comments/page"> 评论审核</a></li> | |
| 63 | + <li class="active"><a href="/videos/page?state=0&receive=false"></i> 点播审核</a></li> | |
| 64 | + <li><a href="/comments/page?state=0&receive=false"> 评论审核</a></li> | |
| 65 | 65 | </ul> |
| 66 | 66 | </li> |
| 67 | 67 | <li class="treeview" th:if="${session.sessionUser.spid==0 or session.sessionUser.master}"> | ... | ... |
src/main/resources/templates/page/comment.html
| ... | ... | @@ -46,7 +46,7 @@ |
| 46 | 46 | <div class="btn-group margin-bottom pull-right"> |
| 47 | 47 | <div class="btn-group margin-bottom"> |
| 48 | 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','')">全部待审</button> | |
| 49 | + <button type="button" id="before_button" class="btn btn-sm margin-r-5 action_bottom" onclick="searchStatus('0',false)">全部待领</button> | |
| 50 | 50 | <button type="button" id="my_after_button" class="btn btn-sm margin-r-5 action_bottom" onclick="searchStatus('1,2',true)">我的已审</button> |
| 51 | 51 | <button type="button" id="my_brfore_button" class="btn btn-sm margin-r-5 action_bottom" onclick="searchStatus('0',true)">我的未审</button> |
| 52 | 52 | </div> |
| ... | ... | @@ -233,6 +233,7 @@ |
| 233 | 233 | <span class="btn btn-sm btn-warning" th:if="${comment.state==0}">待审</span> |
| 234 | 234 | <span class="btn btn-sm btn-success" th:if="${comment.state==1}">已审</span> |
| 235 | 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> | |
| 236 | 237 | </td> |
| 237 | 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> |
| 238 | 239 | <td style="text-align: center; width: 22%;"> |
| ... | ... | @@ -345,7 +346,7 @@ |
| 345 | 346 | var receiveIsNull = $.trim(receive)==""; |
| 346 | 347 | if(stateIsNull&&receiveIsNull){ |
| 347 | 348 | $("#all_button").addClass("btn-info"); |
| 348 | - }else if(state=='0'&&receiveIsNull){ | |
| 349 | + }else if(state=='0'&&receive=='false'){ | |
| 349 | 350 | $("#before_button").addClass("btn-warning"); |
| 350 | 351 | }else if(!stateIsNull&&state!='0'&&receive=='true'){ |
| 351 | 352 | $("#my_after_button").addClass("btn-success"); |
| ... | ... | @@ -397,16 +398,17 @@ |
| 397 | 398 | //去掉领取参数 |
| 398 | 399 | if(href.indexOf("receive")>=0){ |
| 399 | 400 | href = href.replace("receive=true",""); |
| 401 | + href = href.replace("receive=false",""); | |
| 400 | 402 | } |
| 401 | 403 | href = href.replace("&&","&"); |
| 402 | 404 | href = href.replace("?&","?"); |
| 403 | 405 | if(href.endsWith("&"))href = href.substring(0,href.length-1); |
| 404 | 406 | if(href.endsWith("?"))href = href.substring(0,href.length-1); |
| 405 | - if(receive==true){ | |
| 407 | + if($.trim(receive)!=""){ | |
| 406 | 408 | if(href.indexOf("=")>0){//有其他参数 |
| 407 | - href+="&receive=true"; | |
| 409 | + href+="&receive="+receive; | |
| 408 | 410 | }else{ |
| 409 | - href+="?receive=true"; | |
| 411 | + href+="?receive="+receive; | |
| 410 | 412 | } |
| 411 | 413 | } |
| 412 | 414 | location.href = href; | ... | ... |
src/main/resources/templates/page/commentDetail.html
| ... | ... | @@ -50,6 +50,7 @@ |
| 50 | 50 | <h5 class="status" th:if="${comment.state==0}">待审</h5> |
| 51 | 51 | <h5 class="status" th:if="${comment.state==1}">审核通过</h5> |
| 52 | 52 | <h5 class="status" th:if="${comment.state==2}">审核拒绝</h5> |
| 53 | + <h5 class="status" th:if="${comment.state==3}">自动审核失败</h5> | |
| 53 | 54 | </div> |
| 54 | 55 | </div> |
| 55 | 56 | <hr> | ... | ... |
src/main/resources/templates/page/video.html
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | |
| 50 | 50 | <div class="btn-group margin-bottom pull-right"> |
| 51 | 51 | <button type="button" class="btn btn-sm margin-r-5 filter " |
| 52 | - th:onclick="'javascript:quanbu()'" value=""> | |
| 52 | + th:onclick="'javascript:quanbu()'" value="" id="quanbu"> | |
| 53 | 53 | 全部 |
| 54 | 54 | </button> |
| 55 | 55 | </button> |
| ... | ... | @@ -193,6 +193,7 @@ |
| 193 | 193 | <span class="btn btn-sm btn-warning" th:if="${video.state==0}">待审</span> |
| 194 | 194 | <span class="btn btn-sm btn-success" th:if="${video.state==1}">通过</span> |
| 195 | 195 | <span class="btn btn-sm btn-danger" th:if="${video.state==2}">拒绝</span> |
| 196 | + <span class="btn btn-sm btn-danger" th:if="${video.state==3}">自动审核失败</span> | |
| 196 | 197 | </td> |
| 197 | 198 | <td style="text-align: center; width: 10%;" |
| 198 | 199 | th:text="${#dates.format(video.video_upload_time, 'yyyy-MM-dd HH:mm:ss')}"> |
| ... | ... | @@ -270,6 +271,24 @@ |
| 270 | 271 | </section> |
| 271 | 272 | </div> |
| 272 | 273 | <script th:inline="javascript"> |
| 274 | + $(function () { | |
| 275 | + //按钮颜色设置 | |
| 276 | + var state = [[${param.state}]]?[[${param.state}]][0]:null; | |
| 277 | + var receive = [[${param.receive}]]?[[${param.receive}]][0]:null; | |
| 278 | + var stateIsNull = $.trim(state)==""; | |
| 279 | + var receiveIsNull = $.trim(receive)==""; | |
| 280 | + if(stateIsNull&&receiveIsNull){ | |
| 281 | + $("#quanbu").addClass("btn-info"); | |
| 282 | + }else if(state=='0'&&receive=='false'){ | |
| 283 | + $("#daishen").addClass("btn-warning"); | |
| 284 | + }else if(state=='0'&&receive=='true'){ | |
| 285 | + $("#Mydaishen").addClass("btn-success"); | |
| 286 | + }else if(!stateIsNull&&state!='0'&&receive=='true'){ | |
| 287 | + $("#yishen").addClass("btn-danger"); | |
| 288 | + } | |
| 289 | + | |
| 290 | + }) | |
| 291 | + | |
| 273 | 292 | //翻页函数 |
| 274 | 293 | function fanye(page) { |
| 275 | 294 | var param = location.search; |
| ... | ... | @@ -295,7 +314,7 @@ |
| 295 | 314 | window.location.href = "page"; |
| 296 | 315 | } |
| 297 | 316 | |
| 298 | - //全部待审核/我的待审核 | |
| 317 | + //全部待领 | |
| 299 | 318 | $('#daishen').click(function () { |
| 300 | 319 | var state = 0; |
| 301 | 320 | var receive = false; |
| ... | ... | @@ -318,11 +337,12 @@ |
| 318 | 337 | //我的已审核 |
| 319 | 338 | $('#yishen').click(function () { |
| 320 | 339 | var state = 1; |
| 340 | + var receive = true; | |
| 321 | 341 | var video_priority = $("#video_priority").val(); |
| 322 | 342 | var video_title = $("#video_titleID").val(); |
| 323 | 343 | var start_date = $("#start_date").val(); |
| 324 | 344 | var end_date = $("#end_date").val(); |
| 325 | - window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&video_priority=" + video_priority; | |
| 345 | + window.location.href = "page?video_title=" + video_title + "&start_date=" + start_date + "&end_date=" + end_date + "&state=" + state + "&receive=" + receive + "&video_priority=" + video_priority; | |
| 326 | 346 | }); |
| 327 | 347 | |
| 328 | 348 | |
| ... | ... | @@ -426,35 +446,7 @@ |
| 426 | 446 | </script> |
| 427 | 447 | <!--保留之前的样式代码--> |
| 428 | 448 | <script> |
| 429 | - /* 筛选 状态 按钮之间的切换 todo */ | |
| 430 | - $('.filter').click(function () { | |
| 431 | - var object = $('#forms input').serializeObject(); | |
| 432 | - object['state'] = $(this).val(); | |
| 433 | - switch ($(this).val()) { | |
| 434 | - case "0": | |
| 435 | - $(this).addClass('btn-info'); | |
| 436 | - $(this).siblings().removeClass('btn-info'); | |
| 437 | - $('#hide_select_area_2').hide(); | |
| 438 | - form_state = 0; //待审 | |
| 439 | - break; | |
| 440 | - case "1": | |
| 441 | - $(this).addClass('btn-info'); | |
| 442 | - $(this).siblings().removeClass('btn-info'); | |
| 443 | - $('#hide_select_area_2').hide(); | |
| 444 | - form_state = 1; //我的已审 | |
| 445 | - break; | |
| 446 | - default: | |
| 447 | - $(this).addClass('btn-info'); | |
| 448 | - $(this).siblings().removeClass('btn-info'); | |
| 449 | - $('#hide_select_area_2').hide(); | |
| 450 | - form_state = 0; //全部 | |
| 451 | - break; | |
| 452 | - } | |
| 453 | - object['_token'] = 'MCgqTuvq2fL01T4VhkXj0shCeGYJU4l0X3loXu40'; | |
| 454 | - $('#state').val(object['state']); | |
| 455 | - }); | |
| 456 | 449 | $('#a_down').hide(); |
| 457 | - | |
| 458 | 450 | /*查询样式*/ |
| 459 | 451 | function openOrClose(id_name_str) { |
| 460 | 452 | var id_name = '#' + id_name_str; | ... | ... |