123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- // --------------头部轮播图--------------------------
- var mySwiper1 = new Swiper(".yw_swiper", {
- autoplay: 5000,//可选选项,自动滑动
- loop: true,
- centeredSlides: true,
- slidesPerView:1.1,
- paginationClickable: true,
- spaceBetween: 10
- });
- // --------------广告图 --------------------------
- if ($('#v3adv_box ul li').length >2) {
- var mySwiper1 = new Swiper('#v3adv_box',{
- autoplay:5000,
- loop : false,
- })
- }else{
- var mySwiper1 = new Swiper('#v3adv_box',{
- autoplay:false,
- loop : false,
- })
- }
- // --------------品房海外精选--------------------------
- //导航移动 demo示例六 通过id调取
- $('#demo06').navbarscroll({
- defaultSelect: 0, //默认选中
- scrollerWidth: 4,
- fingerClick: 1,
- endClickScroll: function (obj) {
- // console.log(obj.text())
- }
- });
- $('.m_click li').on('click', function () {
- var _country = $(this).attr('country');
- var html = '';
- $.ajax({
- url: "/index/gethouse", // 索取
- data: {id: _country}, //传ID
- type: "GET",
- dataType: "json",
- success: function (data) {//请求成功完成后要执行的方法
- $.each(data.data, function (i, data) {
- html += '<li class="c">';
- html += '<a href="/house/' + data.id + '" class="c">';
- html += '<div class="xm_sellimgbox c">';
- html += '<div class="xm_sellimg">';
- html += '<img src="' + data.thumb + '" alt="">';
- html += '<p>';
- if (data.price != null && data.price != '' && data.price != 0) {
- html += '<span><i>' + data.price + '</i> ' + data.price_nuit + '</span>';
- } else {
- html += '<span><i>待定</i></span>';
- }
- html += '</p>';
- html += '<i class="yxq">有效期:' + data.time + '</i>';
- html += '</div>';
- html += '</div>';
- html += '<div class="xm_sellconter_right">';
- html += '<p class="title">' + data.name + '</p>';
- html += '<p class="style">';
- if (data.label) {
- $.each(data.label, function (k, v) {
- html += '<i>' + v + '</i>';
- })
- }
- html += '</p>';
- html += '<div class="xm_shuju c">';
- html += '<p><span>' + data.recent_price + '</span><i>房价涨幅</i></p>';
- html += '<p><span>' + data.down_payment_ratio + '</span><i>首付比例</i></p>';
- html += '<p><span>' + data.rent + '</span><i>租金回报率</i></p>';
- html += '</div>';
- html += '</div>';
- html += '</a>';
- html += '</li>';
- });
- $('.xm_sell_conter ul').html(html);
- }
- });
- })
- $('.m_click li').eq(0).click();
- // --------------视频看房--------------------------
- var mySwiper1 = new Swiper(".xm_swiper", {
- loop: true,
- centeredSlides: true,
- slidesPerView:1.2,
- paginationClickable: true,
- spaceBetween: 10
- })
- // --------------房产资讯--------------------------
- $('.xm_zixundaohang span').on('click', function () { // 房产资讯切换
- var qhid = $(this).attr('qhid');
- $('.xm_zixun .xm_zixunnr').hide();
- $('.xm_zixun .xm_zixunnr[qhid="' + qhid + '"]').show();
- $(this).attr('class', 'on').siblings().attr('class', '');
- })
- $('.xm_zixundaohang span').eq(0).click();
- var _top = '';
- var ster = 0;
- // 头部导航
- $(window).scroll(function () {
- ster = $(this).scrollTop();
- });
- $('.xm_zixunnr .xm_wenda').on('click', function () { // 点击问答显示弹窗
- $('.xm_wenda_tcbox').show();
- _top = $(window).scrollTop(); // 弹窗开启 遮罩层以外的东西不移动
- $('body').css("top", -ster + "px");
- $('body').addClass('add');
- var _title = $(this).find('.xm_wenda_r em').html();
- var _text = $(this).find('.xm_wenda_r span').html();
- $('.xm_wenda_tcr em').html(_title);
- $('.xm_wenda_tcr .text').html(_text);
- })
- $('.xm_wenda_tcbox .title i').on('click', function () { // 关闭问答
- $('.xm_wenda_tcbox').hide();
- $('body').removeClass('add');//去掉给body的类
- $(window).scrollTop(_top);//设置页面滚动的高度,如果不设置,关闭弹出层时页面会回到顶部。
- })
- $('.xm_wenda_tcbj').on('click', function () { // 关闭问答
- $('.xm_wenda_tcbox').hide();
- $('body').removeClass('add');//去掉给body的类
- $(window).scrollTop(_top);//设置页面滚动的高度,如果不设置,关闭弹出层时页面会回到顶部。
- })
- /*-----------------------------------视频播放--------------------------------------------*/
- PublicAction.AjaxSend({CORID:'ybm_buttom'/*操作ID*/});
- $('.liveBm_bg,.liveBm_gb a').click(function(){
- $('.liveBm_bg,.liveBm').hide();
- })
-
- // 视频播放
- var lpvideo = document.getElementById("myVideo");
- var btn_vid = document.getElementById("lpvideo");
- var musitime= 0;
- var cubicle = "true";
- if (btn_vid) {
- btn_vid.onclick = function () {
- // cubicle = $('#lpvideo').attr('data-boole');
- // console.log(cubicle)
- if (lpvideo.paused) { //判断当前的状态是否为暂停,若是则点击播放,否则暂停
- $('#myVideo').attr('controls','controls'); //点击 显示默认的控件
- $('.xm_video_img').hide();
- if(musitime >= 1000 && cubicle == "true"){
- AudioWind_video(); //视频报名窗口
- return false;
- }
- lpvideo.play();
- watchMusicTime_vid()
- }else{
- lpvideo.pause();
- }
- var getCookie=cookie.get("authorization");
- // 判断一下COOKIE 是否存在了,存在就不弹出报名窗口,直接播放
- if(getCookie){
- $('body #lpvideo').attr('data-boole','false');
- }
- }
- };
- // 视频报名窗口
- function AudioWind_video(){
- // var getCookie=cookie.get("authorization");
- // // 判断一下COOKIE 是否存在了,存在就不弹出报名窗口,直接播放
- // if(getCookie){
- // $('body #lpvideo').attr('data-boole','false');
- // return false;
- // }
- // console.log(15)
- if($('body .liveBm').is(':hidden')){
- $('body .liveBm').show(10);
- $('body .liveBm_bg').show();
- parent.w_id = $("#lpvideo").attr('value'); //把楼盘ID传向父级
- $('body .liveBm').find('.liveBm_box input[name="hid"]').val($("#lpvideo").attr('value'))
- }
- }
- //监听音乐实时播放的时间
- function watchMusicTime_vid(){
- let _this = this;
- //监听播放时间
- // let musicDom = document.getElementsByTagName('audio')[0];//获取Audio的DOM节点
- let musicDom =lpvideo;//获取Audio的DOM节点
- //使用事件监听方式捕捉事件
- musicDom.addEventListener("timeupdate",function(){//监听音频播放的实时时间事件
- cubicle = $('#lpvideo').attr('data-boole'); //2019-11-20 把获取报名成功后,可以继续播放的状态放置这里
-
- // console.log(musicDom.duration)//播放时间
- let timeDisplay;
- //用秒数来显示当前播放进度
- timeDisplay = Math.floor(musicDom.currentTime);//获取实时时间
- musitime = timeDisplay;
- // console.log(timeDisplay)
- // 处理 10秒内试听
- // console.log(cubicle)
- if(timeDisplay >= 1000 && cubicle == "true"){
- lpvideo.pause();
- AudioWind_video(); //视频报名窗口
- }
- //处理时间
- //分钟
- let minute = timeDisplay / 60;
- let minutes = parseInt(minute);
- if (minutes < 10) {
- minutes = "0" + minutes;
- }
- //秒
- let second = timeDisplay % 60;
- let seconds = Math.round(second);
- if (seconds < 10) {
- seconds = "0" + seconds;
- }
- let shun= minutes+":"+seconds;//将实时时间存储到vuex中
- // console.log(shun)
- // console.log(_this.$store.state.realMusicTime);
- },false);
- }
|