作者 景龙
1 个管道 的构建 通过 耗费 3 秒

测试视频定位

@@ -237,9 +237,13 @@ @@ -237,9 +237,13 @@
237 } 237 }
238 }); 238 });
239 var video_index = getUrlParam('video_index'); 239 var video_index = getUrlParam('video_index');
  240 + console.log(1111);
  241 + console.log(video_index);
240 //默认第一个视频 242 //默认第一个视频
241 - switch_video(video_index);  
242 243
  244 + switch_video(video_index);
  245 + //更换视频路径index
  246 + video_index_url(video_index);
243 //点击切换 247 //点击切换
244 $('.curren li').click(function() { 248 $('.curren li').click(function() {
245 var index = $(this).index(); 249 var index = $(this).index();
@@ -247,6 +251,8 @@ @@ -247,6 +251,8 @@
247 $('.curren').children('li').find('.txt-cut').css('color', 'rgba(153, 153, 153, 1)'); 251 $('.curren').children('li').find('.txt-cut').css('color', 'rgba(153, 153, 153, 1)');
248 switch_video(index); 252 switch_video(index);
249 $('.video_index').val(index); 253 $('.video_index').val(index);
  254 + //更换视频路径index
  255 + video_index_url(index);
250 }); 256 });
251 257
252 // $(".select ul li").click(function() { 258 // $(".select ul li").click(function() {
@@ -280,6 +286,16 @@ @@ -280,6 +286,16 @@
280 $('.video_poster').css('visibility', 'visible!important'); 286 $('.video_poster').css('visibility', 'visible!important');
281 }); 287 });
282 }); 288 });
  289 +
  290 + function video_index_url(index){
  291 + var city_id = getUrlParam('city_id');
  292 + if(city_id == ''){
  293 + $('.video_index_url').val(window.location.href+'?video_index='+index);
  294 + }else{
  295 + $('.video_index_url').val(window.location.href+'&video_index='+index);
  296 + }
  297 + }
  298 +
283 //切换视频 299 //切换视频
284 function switch_video(index) { 300 function switch_video(index) {
285 //视频路径 301 //视频路径
@@ -3,15 +3,14 @@ @@ -3,15 +3,14 @@
3 <script> 3 <script>
4 $(function () { 4 $(function () {
5 var pathname = window.location.pathname; 5 var pathname = window.location.pathname;
6 - var video_index = $('.video_index').val();  
7 var city_id = getUrlParam('city_id'); 6 var city_id = getUrlParam('city_id');
8 // 分享链接 7 // 分享链接
9 var url; 8 var url;
10 if(pathname == '/portal/region/getMoreVideo'){ 9 if(pathname == '/portal/region/getMoreVideo'){
11 if(city_id == ''){ 10 if(city_id == ''){
12 - url = window.location.href+'?video_index='+video_index; 11 + url = $('.video_index_url').val();
13 }else{ 12 }else{
14 - url = window.location.href+'&video_index='+video_index; 13 + url = $('.video_index_url').val();
15 } 14 }
16 15
17 }else{ 16 }else{