审查视图

public/themes/simpleboot3/portal/region/get_more_video.html 14.9 KB
景龙 authored
1 2 3 4 5 6 7
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
景龙 authored
8
    <title>星球影院更多</title>
景龙 authored
9
    <link rel="stylesheet" href="__TMPL__/public/assets/css/show.css">
景龙 authored
10
    <link rel="stylesheet" href="__TMPL__/public/assets/css/mask.css">
11 12 13 14
    <style>
        video::-internal-media-controls-download-button {
            display: none;
        }
景龙 authored
15
16 17 18
        video::-webkit-media-controls-enclosure {
            overflow: hidden;
        }
景龙 authored
19
20 21 22
        video::-webkit-media-controls-panel {
            width: calc(100% + 30px);
        }
景龙 authored
23
zhangwei authored
24 25 26 27
        #collections {
            width: 30px;
            height: 30px;
        }
景龙 authored
28
zhangwei authored
29 30 31 32
        #likes {
            width: 32px;
            height: 32px;
        }
33
    </style>
景龙 authored
34 35
</head>
36
<body ondragstart="window.event.returnValue=false" oncontextmenu="window.event.returnValue=false" onselectstart="event.returnValue=false">
景龙 authored
37 38 39 40 41 42 43 44 45 46 47 48
<include file="public@header" />

<!-- 弹出框 -->
<div class="mask">
</div>
<div class="show_9 clearfix">
    <!-- 视频 -->
    <div class="show_9_video">
        <img class="video_poster iop" src="" alt="">
        <video id="video" width="100%" height="426" src="" controlsList="nodownload"></video>
        <img class="play_button" onclick="bofang()" src="__TMPL__/public/assets/starImg/aicon_30.png" alt="">
        <div class="video_box"></div>
49
景龙 authored
50
    </div>
景龙 authored
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
    <!-- 视频侧边选择 -->
    <div class="show_9_video_aside">
        <!-- 顶部 -->
        <div class="show_9_video_asideTie clearfix">
            <p>专辑</p>
            <input type="hidden" value="{$cityName}" id="cityName">
            <form method="GET" action="/portal/region/getMoreVideo">
                <div class="select">
                    <input type="text" class="show_city" value="所有" readonly="readonly">
                    <img src="__TMPL__/public/assets/starImg/down.png" alt="">
                    <ul style="min-height:98px;max-height:300px;overflow-y: scroll;width:145px;">
                        <li>所有</li>
                        <volist name="city_name" id="vo">
                            <li value="{$vo.id}">{$vo.name}</li>
                        </volist>
                    </ul>
                    <input type="hidden" value="0" name="city_id" id="city_id">
                    <div style="display:none;">
                        <input type="submit" id="city_submit" />
                    </div>
                </div>
            </form>
        </div>
景龙 authored
74
        <!-- 视频 -->
景龙 authored
75 76 77
        <div class="show_9_video_asideCon">
            <ul class="curren">
                <volist name="res['data']" id="vo">
景龙 authored
78
                    <li class="clearfix" id="video_index_{$key}">
景龙 authored
79
                        <img class="li_img" src="{:cmf_get_image_url($vo.thumbnail)}" alt="">
景龙 authored
80 81 82 83 84
                        <p>
                            {$vo.post_title}
                        </p>
                        <!--id-->
                        <input type="hidden" value="{$vo.id}" class="li_id">
景龙 authored
85 86
                        <!--<input type="hidden" value="{:cmf_get_file_download_url($vo.video)}" class="li_video">-->
                        <input type="hidden" value="/portal/index/getVideoById?id={$vo.id}" class="li_video">
景龙 authored
87 88 89 90 91 92 93 94
                        <!--标题-->
                        <input type="hidden" value="{$vo.post_title}" class="li_post_title">
                        <!--国家-->
                        <input type="hidden" value="{$vo.city_name}" class="li_city_name">
                        <!--取景-->
                        <input type="hidden" value="{$vo.framing}" class="li_framing">
                        <!--上映时间-->
                        <input type="hidden" value="{$vo.release_time}" class="li_release_time">
95 96
                        <!--city_id-->
                        <input type="hidden" value="{$vo.city_id}" class="li_city_video_id">
景龙 authored
97 98 99
                    </li>
                </volist>
            </ul>
景龙 authored
100
        </div>
景龙 authored
101 102 103 104 105 106 107 108 109 110 111
    </div>
    <!-- 底部 -->
    <div class="show_9_video_asideTxt clearfix">
        <!-- 标题 -->
        <h1 class="post_title"></h1>
        <!-- 国家 -->
        <div class="show_9_video_asideTxt2">
            <!--<p>国家:<span class="city_name"></span></p>-->
            <input type="hidden" value="" id="li_id">
            <p>取景:<span class="framing"></span></p>
            <p>上映时间:<span class="release_time"></span></p>
112 113
            <!--city_id-->
            <input type="hidden" value="0" class="city_video_id">
景龙 authored
114 115 116 117
            <!--视频索引-->
            <input type="hidden" value="0" class="video_index">
            <!--视频url-->
            <input type="hidden" value="0" class="video_index_url">
景龙 authored
118
        </div>
景龙 authored
119 120 121 122 123 124 125 126 127
        <!-- 分享 -->
        <div class="show_9_video_asideTxt3 clearfix">
            <p>分享:</p>
            <input type="hidden" class="collection" value="">
            <input type="hidden" class="like" value="">
            <img src="__TMPL__/public/assets/starImg/aicon_89.png" alt="" onclick="wxShow()">
            <img src="__TMPL__/public/assets/starImg/aicon_90.png" alt="" class="wb_share_video">
            <img id="collections" src="__TMPL__/public/assets/starImg/bicon_02.png" alt="">
            <img id="likes" src="__TMPL__/public/assets/starImg/bicon_031.png" alt="">
景龙 authored
128 129
        </div>
    </div>
景龙 authored
130 131 132
</div>
<!--微信分享-->
<!-- 二维码弹出层 -->
景龙 authored
133
<div class="wx-qrcode-wrapper" style="display:none;">
景龙 authored
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
    <!-- 遮罩层 -->
    <div class="mask"></div>
    <div class="wx-qrcode" style="width:230px;">
        <div class="share">
            <span style="font-size: 14px;text-align: center;">分享到微信朋友圈</span>
            <!-- 关闭图标 -->
            <a href="javascript:;" class="icon-close2" onclick="wxHide()">×</a>
        </div>

        <!-- 生成的二维码容器 -->
        <div id="qrcode"></div>
        <input type="hidden" id="code1" value="0">
        <div class="bd_weixin_popup_foot">
            打开微信,使用“扫一扫”<br>
            点击右上角,即可将网页分享至朋友圈。
景龙 authored
149 150
        </div>
    </div>
景龙 authored
151 152 153 154 155 156 157 158 159
</div>
<include file="public@footer" />
<script src="__TMPL__/public/assets/js/jquery-3.2.1.min.js"></script>
<script src="__TMPL__/public/assets/js/public.js"></script>
<script src="https://cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<script>
    /* 点微信图标,触发二维码弹出层显示 */
    function wxShow() {
        if($('#code1').val() == 0){
景龙 authored
160 161 162
            $('.wx-qrcode-wrapper').show();
            qrcode();
        }
景龙 authored
163 164
        $('#code1').val(1);
    }
景龙 authored
165
景龙 authored
166 167 168 169 170 171
    /* 关闭二维码弹出层 */
    function wxHide() {
        $('.wx-qrcode-wrapper').hide();
        $('#qrcode').children().remove();
        $('#code1').val(0);
    }
景龙 authored
172
景龙 authored
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
    function qrcode(){
        /* 生成二维码 */
        var url = $('.video_index_url').val();
        $("#qrcode").qrcode({
            text: url, //设置二维码内容
            render: "canvas", //设置渲染方式
            width: 220, //设置宽度,默认生成的二维码大小是 256×256
            height: 220, //设置高度
            typeNumber: -1, //计算模式
            background: "#ffffff", //背景颜色
            foreground: "#000000" //前景颜色
        });
    }

</script>
<script>
    // 星域秀场视频
    $(function() {
        //禁止下载
        $('video').bind('contextmenu', function() {
            return false;
        });
195 196 197 198 199 200 201 202 203 204 205 206 207 208

        var video_index = getUrlParam('video_index');
        //默认第一个视频
        if(video_index == ''){
            //默认第一个视频
            switch_video(0);
            //更换视频路径index
            video_index_url(0);
        }else{
            switch_video(video_index);
            //更换视频路径index
            video_index_url(video_index);
        }
景龙 authored
209 210
        //登录
        var users = $('#users').val();
211
        //未登录
景龙 authored
212 213
        if (users == 0) {
            //监听播放时间
景龙 authored
214
            var v_city_id = getUrlParam('city_id');
215
216 217
            //解决从定位视频进入
            var city_id_video = $('.city_video_id').val();
218
            //非独角星球视频模块
景龙 authored
219
            if(v_city_id != 68){
220 221 222
                if(city_id_video != 68){
                    video_mask('您还不是会员,可试看20秒');
                }
223
            }
景龙 authored
224
            var video = document.getElementById('video');
景龙 authored
225
景龙 authored
226 227
            //使用事件监听方式捕捉事件
            video.addEventListener("timeupdate", function() {
228 229 230
                //获取当前点击播放视频的city_id
                var city_video_id = $('.city_video_id').val();
景龙 authored
231 232 233 234 235 236 237
                var timeDisplay;
                //用秒数来显示当前播放进度
                timeDisplay = Math.floor(video.currentTime);
                console.log(Math.floor(video.currentTime));
                video.addEventListener('play', function() {
                    video.currentTime = 0;
                });
238 239

                //非独角星球视频模块
景龙 authored
240
                if(v_city_id != 68){
241 242 243 244 245 246 247 248 249 250
                    //当视频播放到 15s的时候做处理
                    if(city_video_id != 68){
                        if (timeDisplay >= 20) {
                            video.addEventListener('play', function() {
                                video.currentTime = 0;
                            }),
                                video_mask('会员可观看完整视频');
                            video.pause();
                        }
                    }
景龙 authored
251 252 253
                }
            }, false);
        }
景龙 authored
254
景龙 authored
255 256 257 258 259 260 261 262 263 264
        var value = $('#cityName').val();
        if (value != '') {
            $('.show_city').val(value);
        } else {
            $('.show_city').val('所有');
        }

        //点击切换
        $('.curren li').click(function() {
            var index = $(this).index();
265
            $('.curren').children('li').children('.li_img').css('opacity', '0.3');
景龙 authored
266 267 268 269 270 271
            $('.curren').children('li').children('p').css('color', 'rgba(153, 153, 153, 1)');
            switch_video(index);
            $('.video_index').val(index);
            //更换视频路径index
            video_index_url(index);
        });
景龙 authored
272
景龙 authored
273 274 275 276 277 278 279
        //鼠标滑过
        $('.curren li').hover(function() {
            $('.curren').children('li').children('.li_img').css('opacity', '0.3');
            $('.curren').children('li').children('p').css('color', 'rgba(153, 153, 153, 1)');
            $(this).children('.li_img').css('opacity', '1');
            $(this).children('p').css('color', 'rgba(9, 255, 142, 1)');
        });
景龙 authored
280
景龙 authored
281 282 283 284 285 286 287 288 289
        //  点击input下拉
        $('.select input').click(function() {
            if ($(this).next('img').attr('src') == "__TMPL__/public/assets/starImg/down.png") {
                $(this).next('img').attr('src', "__TMPL__/public/assets/starImg/up.png");
                $('.select ul').toggle();
            } else {
                $(this).next('img').attr('src', "__TMPL__/public/assets/starImg/down.png");
                $('.select ul').toggle();
            }
290
景龙 authored
291
        });
292
景龙 authored
293 294 295 296
        //下拉框选择城市
        $('.select ul li').click(function() {
            $('.show_city').val($(this).text());
            $('.select ul').hide();
景龙 authored
297
景龙 authored
298
            $('#city_id').val($(this).val());
景龙 authored
299
景龙 authored
300
            $('form').submit();
景龙 authored
301
        });
302
景龙 authored
303 304 305 306
        // 弹出框
        setInterval(function() {
            $('.video_mask').hide();
        }, 4000);
景龙 authored
307
景龙 authored
308 309
        $('.curren').eq(0).addClass('video_active');
    });
310
景龙 authored
311 312 313
    function video_index_url(index){
        var city_id = getUrlParam('city_id');
        if(city_id == ''){
景龙 authored
314
            $('.video_index_url').val('http://'+window.location.host+'/portal/region/getMoreVideo?city_id=0&video_index='+index+'&#video_index_'+index);
景龙 authored
315
        }else{
景龙 authored
316
            $('.video_index_url').val('http://'+window.location.host+'/portal/region/getMoreVideo?city_id='+city_id+'&video_index='+index+'&#video_index_'+index);
317
        }
景龙 authored
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
    }

    //切换视频
    function switch_video(index) {
        //视频路径
        var li_index = $('.curren').children('li').eq(index);
        //选中颜色
        li_index.children('.li_img').css('opacity', '1');
        li_index.children('p').css('color', 'rgba(9, 255, 142, 1)');

        var oneVideo = li_index.children('.li_video').val();
        $('#video').attr('src', oneVideo);
        // 视频封面图
        $('.video_poster').css('z-index', '10');

        var oneCover = li_index.children('.li_img').attr('src');
        $('.video_poster').attr('src', oneCover);
        $('.play_button').css({
            'z-index': "11",
            "display": "block"
        });
        //视频id,标题,国家,取景,上映时间
        var id = li_index.children('.li_id').val();
        var post_title = li_index.children('.li_post_title').val();
        var city_name = li_index.children('.li_city_name').val();
        var framing = li_index.children('.li_framing').val();
        var release_time = li_index.children('.li_release_time').val();
345
        var city_video_id = li_index.children('.li_city_video_id').val();
景龙 authored
346 347 348 349 350
        $('#li_id').val(id);
        $('.post_title').text(post_title);
        $('.city_name').text(city_name);
        $('.framing').text(framing);
        $('.release_time').text(release_time);
351
        $('.city_video_id').val(city_video_id);
352
        //是否收藏
景龙 authored
353
        is_collections(id);
354 355

        //是否点赞
景龙 authored
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383
        is_likes(id);

    }
    // 点击播放
    function bofang() {
        video.play();
        $('#video').attr('controls', 'controls');
        $('.play_button').hide();
        $('.video_poster').css('z-index', '-1');
    }

    //是否收藏
    function is_collections(article_id) {
        var host = 'http://' + window.location.host;
        $.ajax({
            type: 'POST',
            url: '/portal/star/is_collections',
            data: {
                'id': article_id,
            },
            dataType: 'json',
            async: false,
            success: function(data) {
                console.log(data);
                if (data.code == 1) {
                    $('#collections').attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_15.png')
                } else {
                    $('#collections').attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_02.png')
384
                }
景龙 authored
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
            }
        });
    }

    //是否点赞
    function is_likes(article_id) {
        var host = 'http://' + window.location.host;
        $.ajax({
            type: 'POST',
            url: '/portal/star/is_likes',
            data: {
                'id': article_id,
            },
            dataType: 'json',
            async: false,
            success: function(data) {
                if (data.code == 1) {
                    $('#likes').attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_161.png')
                } else {
                    $('#likes').attr('src', host + '/themes/simpleboot3/public/assets/starImg/bicon_031.png')
                }
            }
        });
    }
</script>
景龙 authored
410 411 412
</body>

</html>