Commit e041b6a3f1517e16dd7a0107d97f4277e1c62af5

Authored by 周伟鹏
2 parents f74bcbc9 f2bb9199
src/main/resources/templates/page/video.html
... ... @@ -42,6 +42,7 @@
42 42 <label for="video_title" class="control-label cb-toolbar">热点:</label>
43 43 <div class="col-sm-9" style="padding: 0;">
44 44 <select class="form-control" id="video_priority" name="video_priority" >
  45 + <option value ="">全部</option>
45 46 <option value ="1">是</option>
46 47 <option value ="0">否</option>
47 48 </select>
... ... @@ -131,18 +132,18 @@
131 132 <div class="pull-right pagination">
132 133 <ul class="pagination" th:if="${videoPage.pages>1}">
133 134 <li class="page-pre"><a th:href="@{'/videos/page'}">‹‹</a></li>
134   - <li class="page-pre" th:if="${!videoPage.isFirstPage}"><a th:href="@{'/videos/page?page='+${videoPage.pageNum-1}}">‹</a></li>
  135 + <li class="page-pre" th:if="${!videoPage.isFirstPage}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum-1}+'\');'">‹</a></li>
135 136  
136   - <li class="page-number" th:if="${videoPage.pageNum-3>1}"><a th:href="@{'/videos/page?page='+${videoPage.pageNum-3}}" th:text="${videoPage.pageNum-3}">2</a></li>
137   - <li class="page-number" th:if="${videoPage.pageNum-2>1}"><a th:href="@{'/videos/page?page='+${videoPage.pageNum-2}}" th:text="${videoPage.pageNum-2}">2</a></li>
138   - <li class="page-number" th:if="${videoPage.pageNum-1>1}"><a th:href="@{'/videos/page?page='+${videoPage.pageNum-1}}" th:text="${videoPage.pageNum-1}">2</a></li>
  137 + <li class="page-number" th:if="${videoPage.pageNum-3>1}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum-3}+'\');'" th:text="${videoPage.pageNum-3}">2</a></li>
  138 + <li class="page-number" th:if="${videoPage.pageNum-2>1}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum-2}+'\');'" th:text="${videoPage.pageNum-2}">2</a></li>
  139 + <li class="page-number" th:if="${videoPage.pageNum-1>1}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum-1}+'\');'" th:text="${videoPage.pageNum-1}">2</a></li>
139 140 <li class="page-number active"><a href="javaScript:void(0);" th:text="${videoPage.pageNum}">2</a></li>
140   - <li class="page-number" th:if="${videoPage.pageNum+1<videoPage.pages}"><a th:href="@{'/videos/page?page='+${videoPage.pageNum+1}}" th:text="${videoPage.pageNum+1}">2</a></li>
141   - <li class="page-number" th:if="${videoPage.pageNum+2<videoPage.pages}"><a th:href="@{'/videos/page?page='+${videoPage.pageNum+2}}" th:text="${videoPage.pageNum+2}">2</a></li>
142   - <li class="page-number" th:if="${videoPage.pageNum+3<videoPage.pages}"><a th:href="@{'/videos/page?page='+${videoPage.pageNum+3}}" th:text="${videoPage.pageNum+3}">2</a></li>
  141 + <li class="page-number" th:if="${videoPage.pageNum+1<videoPage.pages}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum+1}+'\');'" th:text="${videoPage.pageNum+1}">2</a></li>
  142 + <li class="page-number" th:if="${videoPage.pageNum+2<videoPage.pages}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum+2}+'\');'" th:text="${videoPage.pageNum+2}">2</a></li>
  143 + <li class="page-number" th:if="${videoPage.pageNum+3<videoPage.pages}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum+3}+'\');'" th:text="${videoPage.pageNum+3}">2</a></li>
143 144  
144   - <li class="page-next" th:if="${!videoPage.isLastPage}"><a th:href="@{'/videos/page?page='+${videoPage.pageNum+1}}">›</a></li>
145   - <li class="page-next"><a th:href="@{'/videos/page?page='+${videoPage.pages}}">››</a></li>
  145 + <li class="page-next" th:if="${!videoPage.isLastPage}"><a th:onclick="'javascript:fanye(\''+${videoPage.pageNum+1}+'\');'">›</a></li>
  146 + <li class="page-next"><a th:onclick="'javascript:fanye(\''+${videoPage.pages}+'\');'">››</a></li>
146 147 </ul>
147 148 </div>
148 149 </div>
... ... @@ -154,6 +155,29 @@
154 155 </section>
155 156 </div>
156 157 <script th:inline="javascript">
  158 + //翻页函数
  159 + function fanye(page) {
  160 + var param = location.search;
  161 + if (param.indexOf("page=")!= -1) {
  162 + if(page < 10){
  163 + alert(param)
  164 + param = param.substring(1,param.length-7);
  165 + alert(param)
  166 + }else if (page < 100){
  167 + param = param.substring(1,param.length-8);
  168 + }else if (page < 1000){
  169 + param = param.substring(1,param.length-9);
  170 + }else if (page < 10000) {
  171 + param = param.substring(1,param.length-10);
  172 + }
  173 + window.location.href = "http://shenhe.cnlive.com/videos/page?"+param+"&page="+page;
  174 + }else {
  175 + alert(param)
  176 + param = param.substring(1,param.length);
  177 + alert(param)
  178 + window.location.href = "http://shenhe.cnlive.com/videos/page?"+param+"&page="+page;
  179 + }
  180 + }
157 181 //待审核
158 182 $('#daishen').click(function () {
159 183 var state = 0;
... ...
src/main/resources/templates/page/videoDetail.html
... ... @@ -246,20 +246,17 @@
246 246 $("#action_note").hide();//隐藏弹出框
247 247 var action_note_type = $("#action_note_type").val();
248 248 if (action_note_type == 'reject') {
249   - $.ajax({
250   - type: 'post',
251   - data: {'id':id,'activity_id': activity_id, 'state': state, 'attr_tags': msg,'msg':msg,'callback':callback},
252   - url: '/videos/shenheVideo',
253   - success: function (data) {
254   - window.location.href = '/videos/page?state=0'
  249 + $.post("/videos/shenheVideo",{
  250 + id:id, activity_id:activity_id, state: state, attr_tags: msg,msg:msg,callback:callback[0]
255 251 },
256   - error: function (XMLHttpRequest,textStatus,errorThrown){
257   - alert("拒绝失败,请重试!")
258   - }
259   - });
260   - //方式二
261   - // window.location.href = '/videos/shenheVideo?id='+id+&activity_id=' + activity_id+'&state='+state+'&attr_tags='+msg+'&msg='+msg
262   - // window.location.href = '/videos/page?state=0'
  252 + function (data) {
  253 + if (data.errorCode==0){
  254 + alert("操作成功");
  255 + location.href = location.href;
  256 + } else{
  257 + alert("操作失败");
  258 + }
  259 + })
263 260 }
264 261 });
265 262  
... ... @@ -274,24 +271,24 @@
274 271 if (typeof(activity_id) == "undefined") {
275 272 return false;
276 273 }
277   - $.ajax({
278   - type: 'post',
279   - data: {'id':id,'activity_id': activity_id, 'state': state, 'attr_tags': msg,'msg':msg,'callback':callback},
280   - url: '/videos/shenheVideo',
281   - success: function (data) {
282   - window.location.href = '/videos/page?state=0'
  274 + $.post("/videos/shenheVideo",{
  275 + id:id, activity_id:activity_id, state: state, attr_tags: msg,msg:msg,callback:callback[0]
283 276 },
284   - error: function (XMLHttpRequest,textStatus,errorThrown){
285   - alert("通过失败,请重试!")
  277 + function (data) {
  278 + if (data.errorCode==0){
  279 + alert("操作成功");
  280 + location.href = location.href;
  281 + } else{
  282 + alert("操作失败");
286 283 }
287   - });
  284 + })
288 285 });
289 286  
290 287 /*返回列表 */
291 288  
292 289 $("#back").click(function () {
293   - //获取来源-
294   - window.location.href = '/videos/page';
  290 + // window.location.href = '/videos/page';
  291 + window.history.go(-1);
295 292 });
296 293  
297 294 </script>
... ...