// 头部搜索 ---------------------------------------- $('.seekinput_search span').on('mousemove', function () { //显示切换框 $('.seekinput_option').show(); }) $('.seek_box').on('mouseleave', function () { //隐藏切换框 $('.seekinput_option').hide(); }) $('.seekinput_option span').eq(1).attr('class', 'on'); //默认 $('.seekinput_search input[qhid="2"]').show(); //默认 $('.seekinput_option span').on('click', function () { $('.seekinput_search input[type="text"]').hide(); var _html = $(this).html(); $('.seekinput_search span i').html(_html); $('.seekinput_option').hide(); $(this).attr('class', 'on').siblings().attr('class', ''); var _qhid = $(this).attr('qhid'); $('.seekinput_search input[qhid="' + _qhid + '"]').show(); //选中的搜索输入框 $('.seek_input input[type="button"]').attr('buttonid', _qhid); //选中的 类型 1为 楼盘列表 2为 视频列表 $('.seekinput_search input[type="text"]').val(""); //清空input 内容 }) $('.seek_input input[type="button"]').on('click', function () { //搜索跳转操作 var _buttonid = $(this).attr('buttonid'); var txt = $('.seek_input input[qhid="' + _buttonid + '"]').val(); console.log(_buttonid); console.log(txt); if (txt != '') { switch (_buttonid) { case '1': window.open('/house/search?name=' + txt); break; case '2': window.open('/video/videosearch?name=' + txt); break; } } ; }) $(document).keydown(function (event) { if (event.keyCode == 13) { $('.seek_input input[type="button"]').click(); } }); // 头部搜索 ---------------------------------------- // 视频看房 ------------------------------------------------------ var videoid = $('.m_videolist_dh .videoclick').eq(0).attr('videoid'); $('.m_videolist_dh .videoclick').eq(0).addClass('on'); ajax_qy(); var being = true; $('.m_videolist_dh .videoclick').on('mouseover', function () { if (videoid != $(this).attr('videoid')) { being = true; } videoid = $(this).attr('videoid'); if (being == true) { ajax_qy(); being = false; } $(this).addClass('on').siblings().removeClass('on'); $('.videolist_option p').removeClass('on'); }) $('.videolist_option p').on('mouseover', function () { if (videoid != $(this).attr('videoid')) { being = true; } videoid = $(this).attr('videoid'); if (being == true) { ajax_qy(); being = false; } $(this).addClass('on').siblings().removeClass('on'); $('.m_videolist_dh .videoclick').removeClass('on'); }) $('.gdclick').on('mousemove', function () { $('.videolist_option').show(); }) $('.gdclick').on('mouseleave', function () { $('.videolist_option').hide(); }) function ajax_qy() { var html = ''; $.ajax({ url: "/video/videolisthouse", // 索取 data: {city: videoid}, //传ID type: "GET", dataType: "json", success: function (data) {//请求成功完成后要执行的方法 var style = $('.m_videolistdata').attr('style'); if (data.code == 200) { $.each(data.data, function (i, data) { html += '
  • '; html += ''; html += '
    '; html += ''; html += '' + data.type + ''; html += ''; html += '
    '; html += '
    '; html += '

    约¥' + data.price + '' + data.price_nuit + '

    '; html += '

    ' + '(有效期:' + data.time + ')' + '

    '; html += '' + data.city_name + ''; html += '
    '; html += '
    '; html += '
    '; html += '
    '; html += '' + data.name + ''; html += '

    '; html += '' + data.main_units + ''; html += '|'; html += '参考收益 ' + data.rent.proportion + ''; html += '

    '; html += '
    '; html += '
    '; html += '
  • '; }); } $('.m_videolist ul').html(html); var _length = data.data.length; if (_length > 6) { $('.m_videolist').addClass('on'); } else { $('.m_videolist').removeClass('on'); } } }); }// 视频看房 ------------------------------------------------------ // 玩转海外 ------------------------------------------------------ var _overseasid = $('.m_overseasdh .overseasdhclick').eq(0).attr('overseasid'); $('.m_overseasdh .overseasdhclick').eq(0).addClass('on'); ajax_overseas(); var mbeing = true; $('.m_overseasdh .overseasdhclick').on('mouseover', function () { if (_overseasid != $(this).attr('overseasid')) { mbeing = true; } _overseasid = $(this).attr('overseasid'); if (mbeing == true) { ajax_overseas(); mbeing = false; } $(this).addClass('on').siblings().removeClass('on'); $('.overseasdh_option p').removeClass('on'); }) $('.overseasdh_option p').on('mouseover', function () { if (_overseasid != $(this).attr('overseasid')) { mbeing = true; } _overseasid = $(this).attr('overseasid'); if (mbeing == true) { ajax_overseas(); mbeing = false; } $(this).addClass('on').siblings().removeClass('on'); $('.m_overseasdh .overseasdhclick').removeClass('on'); }) $('.overseasdgj').on('mousemove', function () { $('.overseasdh_option').show(); }) $('.overseasdgj').on('mouseleave', function () { $('.overseasdh_option').hide(); }) function ajax_overseas() { var html = ''; $.ajax({ url: "/video/videolistbottom", // 索取 data: {city: _overseasid}, //传ID type: "GET", dataType: "json", success: function (data) {//请求成功完成后要执行的方法 if (data.code == 200) { $.each(data.data, function (i, data) { html += '
  • '; html += ''; html += ''; html += '

    '; html += '' + data.title + ''; html += '

    '; html += '
    '; html += '
  • '; }); } $('.m_overseas ul').html(html); } }); }// 玩转海外 ------------------------------------------------------ // 直播看房 ------------------------------------------------------- $(function () { var daId = $('.live_nav span').eq(0).attr('data-id') var daName = $('.live_nav span').eq(0).attr('data-name') $('.live_nav span').eq(0).addClass('on'); liveajax(daId); $('.live_nav').on('click', 'span', function () { $(this).addClass('on').siblings().removeClass('on'); daId = $(this).attr('data-id'); daName = $(this).attr('data-name'); liveajax(daId); }) function liveajax(id) { var html = ''; $.ajax({ url: "/video/livelist", // 索取 data: {name: id}, //传ID type: "GET", dataType: "json", success: function (data) {//请求成功完成后要执行的方法 if (data.code == 200) { $('.main_li ul').html(''); $.each(data.data, function (i, data) { switch (data.type) { case 'all': // if(id){ // html+= '
  • '; // html+= '
    '; // html+= ''; // html+= '
    '; // html+= '
    '; // html+= ''; // html+= '直播中'; // html+= '20:36'; // html+= '
    '; // html+= '

    '; // html+= '
    '; // html+= '
    '; // html+= '

    1帕丁顿商业广场——马尼拉价丁顿商业广场

    '; // html+= '

    '; // html+= '海南 文昌'; // html+= '156万'; // html+= '

    '; // html+= '
    '; // html+= '
    '; // html+= '
    '; // html+= '
  • '; // }else if (data.livestate === '回放') { html += '
  • '; html += '
    '; html += ''; html += '
    '; html += '
    '; html += ''; html += '回放'; html += ''; html += '
    '; html += '

    '; html += '

    '; html += '
    '; html += '
    '; html += '

    ' + data.title + '

    '; html += '

    '; html += '' + data.parentCity + ' ' + data.city_name + ''; // html+= '156万'; html += '

    '; html += '
    '; html += '
    '; html += '
    '; html += '
  • '; } else if (data.livestate === '预告') { html += '
  • '; html += '
    '; html += ''; html += '
    '; html += '

    ' + data.title + '

    '; html += '

    '; html += '' + data.parentCity + ' ' + data.city_name + ''; // html+= '156万'; html += '

    '; html += '
    '; html += '
    '; html += '
  • '; } break; case 'advance': html += '
  • '; html += '
    '; html += ''; html += '
    '; html += '

    ' + data.title + '

    '; html += '

    '; html += '' + data.parentCity + ' ' + data.city_name + ''; // html+= '156万'; html += '

    '; html += '
    '; html += '
    '; html += '
  • '; break; } }); } $('.main_li ul').html(html); if (data.data.length > 4) { var mySwiper1 = new Swiper('.main_li', { autoplay: 6000, //自动切换 loop: false, //循环 slidesPerView: 4, observer: true, spaceBetween: 23, prevButton: '.swiper-button-prev', nextButton: '.swiper-button-next', }) } else { var mySwiper1 = new Swiper('.main_li', { autoplay: false, //自动切换 loop: false, //循环 observer: true, slidesPerView: 4, spaceBetween: 23, }) } } }); } // 报名 $('body').on('click', '.live_buttom', function () { var _hid=$(this).attr('data-hid'); $('.liveBm_box input[name="hid"]').val(_hid) $('.liveBm').show(30); $('.liveBm_bg').show(); }) $('.liveBm_bg,.liveBm_gb a').on('click', function () { $('.liveBm').hide(); $('.liveBm_bg').hide(); $('.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) }) })