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

测试视频定位

... ... @@ -237,9 +237,13 @@
}
});
var video_index = getUrlParam('video_index');
console.log(1111);
console.log(video_index);
//默认第一个视频
switch_video(video_index);
switch_video(video_index);
//更换视频路径index
video_index_url(video_index);
//点击切换
$('.curren li').click(function() {
var index = $(this).index();
... ... @@ -247,6 +251,8 @@
$('.curren').children('li').find('.txt-cut').css('color', 'rgba(153, 153, 153, 1)');
switch_video(index);
$('.video_index').val(index);
//更换视频路径index
video_index_url(index);
});
// $(".select ul li").click(function() {
... ... @@ -280,6 +286,16 @@
$('.video_poster').css('visibility', 'visible!important');
});
});
function video_index_url(index){
var city_id = getUrlParam('city_id');
if(city_id == ''){
$('.video_index_url').val(window.location.href+'?video_index='+index);
}else{
$('.video_index_url').val(window.location.href+'&video_index='+index);
}
}
//切换视频
function switch_video(index) {
//视频路径
... ...
... ... @@ -3,15 +3,14 @@
<script>
$(function () {
var pathname = window.location.pathname;
var video_index = $('.video_index').val();
var city_id = getUrlParam('city_id');
// 分享链接
var url;
if(pathname == '/portal/region/getMoreVideo'){
if(city_id == ''){
url = window.location.href+'?video_index='+video_index;
url = $('.video_index_url').val();
}else{
url = window.location.href+'&video_index='+video_index;
url = $('.video_index_url').val();
}
}else{
... ...