123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- $(document).keydown(function (event) {
- if (event.keyCode == 13) {
- var txt = $('.y_lplist_inp').val();
- if (txt != '') {
- window.location.href = '/video/home?name=' + txt;
- }
- ;
- }
- });
- //获取url中的参数
- function getUrlParam(name) {
- //构造一个含有目标参数的正则表达式对象
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
- //匹配目标参数
- var r = window.location.search.substr(1).match(reg);
- //alert(r);
- //返回参数值
- if (r != null) return decodeURI(r[2]);
- return null;
- }
- var _name = getUrlParam('name');
- if (_name) {
- $('.m_videohead_box').hide();
- } else {
- $('.m_videohead_box').show();
- }
- // 直播看房报名
- $(function () {
- $('body').on('click', '.advance', function () {
- $('.liveBm').show(30)
- $('.liveBm_bg').show(0)
- })
- $('.liveBm_bg,.liveBm_gb a').on('click', function () {
- $('.liveBm').hide()
- $('.liveBm_bg').hide(0)
- $('.liveBm_box input[type="text"]').val('')
- })
- //报名验证提交的调用 底下报名
- PublicAction.AjaxSend({CORID: 'ybm_buttom'/*操作ID*/});
- $('.submit_area .ybm_buttom').on('click', function () {
- setTimeout(function () {
- var _html = $('.alert-container .alert-content').html();
- if (_html == '提交成功') {
- $('.liveBm').hide();
- $('.liveBm_bg').hide();
- $('.liveBm_box input[type="text"]').val('');
- }
- }, 1500)
- })
- var daId = $('.liveNav_box a').eq(0).attr('data-id')
- var daName = $('.liveNav_box a').eq(0).attr('data-name')
- $('.liveNav_box a').eq(0).addClass('on');
- liveajax(daId);
- $('.liveNav_box').on('click', 'a', function () {
- $(this).addClass('on').siblings().removeClass('on');
- daId = $(this).attr('data-id');
- daName = $(this).attr('data-name');
- // console.log(daId);
- liveajax(daId);
- })
- function liveajax(id, name) {
- var html = '';
- $.ajax({
- url: "/video/livelist", // 索取
- data: {name: id}, //传ID
- type: "GET",
- dataType: "json",
- success: function (data) {//请求成功完成后要执行的方法
- if (data.code == 200) {
- $('.m_video_box ul').html('');
- $.each(data.data, function (i, data) {
- switch (data.type) {
- case 'all':
- // if(id){
- // html+= '<li>';
- // html+= '<a href="/video/videodetails/">';
- // html+= '<div class="img">';
- // html+= '<img class="imgbj" src="/video/image/video1.png" alt="">';
- // html+= '<i><em>直播中</em><span>20:33</span></i>';
- // html+= '<div class="imgtext">';
- // html+= '<p>';
- // html+= '<span><img src="/video/image/video13.png" alt="">海南 文昌</span>';
- // html+= '<span><img src="/video/image/video14.png" alt=""><em>5525</em></span>';
- // html+= '</p>';
- // html+= '</div>';
- // html+= '</div>';
- // html+= '</a>';
- // html+= '<p class="text">金边白天与黑夜,带你领略一个不一样的柬埔寨</p>';
- // html+= '</li>';
- // }else
- if (data.livestate === '回放') {
- html += '<li>';
- html += '<a href="/video/videodetails/' + data.hid + '?type=live&liveid=' + data.id + '&city=' + data.city + '">';
- html += '<div class="img playback">';
- html += '<img class="imgbj" src="' + data.img + '" alt="">';
- html += '<img class="imgtb" src="/video/image/video2.png" alt="">';
- html += '<i><em>回放</em><span></span></i>';
- html += '<div class="imgtext">';
- html += '<p>';
- html += '<span><img src="/video/image/video13.png" alt="">' + data.parentCity + ' ' + data.city_name + '</span>';
- // html+= '<span><img src="/video/image/video14.png" alt=""><em>5525</em></span>';
- html += '</p>';
- html += '</div>';
- html += '</div> ';
- html += '</a>';
- html += '<p class="text"><p class="text">' + data.title + '</p></p>';
- html += '</li>';
- } else if (data.livestate === '预告') {
- html += '<li>';
- html += '<a href="javascript:;">';
- html += '<div class="img advance">';
- html += '<img class="imgbj" src="' + data.img + '" alt="">';
- html += '<i><em></em><span>预告 ' + data.time + '开播</span></i>';
- html += '<p class="text_m">预约</p>';
- html += '<div class="imgtext">';
- html += '<p>';
- html += '<span><img src="/video/image/video13.png" alt="">' + data.parentCity + ' ' + data.city_name + '</span>';
- // html+= '<span><img src="/video/image/video14.png" alt=""><em>5525</em></span>';
- html += '</p>';
- html += '</div>';
- html += '</div> ';
- html += '</a>';
- html += '<p class="text">' + data.title + '</p>';
- html += '</li>';
- }
- break;
- case 'advance':
- html += '<li>';
- html += '<a href="javascript:;">';
- html += '<div class="img advance">';
- html += '<img class="imgbj" src="' + data.img + '" alt="">';
- html += '<i><em></em><span>预告 ' + data.time + '开播</span></i>';
- html += '<p class="text_m">预约</p>';
- html += '<div class="imgtext">';
- html += '<p>';
- html += '<span><img src="/video/image/video13.png" alt="">' + data.parentCity + ' ' + data.city_name + '</span>';
- // html+= '<span><img src="/video/image/video14.png" alt=""><em>5525</em></span>';
- html += '</p>';
- html += '</div>';
- html += '</div> ';
- html += '</a>';
- html += '<p class="text">' + data.title + '</p>';
- html += '</li>';
- break;
- }
- });
- }
- $('.m_video_box ul').html(html);
- }
- });
- }
- })
|