$(function() { var _width = $(window).width(); //通用终端代码开始 //边栏自助下载点击效果 $(".side .side_down .label_down").on("click" , "font" ,function(){ $(this).toggleClass("hover"); }); //边栏订阅实时动态点击效果 $(".side .dingdongtai .result p").each(function(){ $(this).click(function(){ $(this).toggleClass("hover"); }); }); //楼盘动态分页下订阅实时动态点击效果 $(".dingdongtaixinxi .xz span").each(function(){ $(this).click(function(){ $(this).toggleClass("hover"); if($(this).attr("class")=="hover"){ $(this).find("input").val($(this).text()); }else{ $(this).find("input").val(""); } }); }); //2022-01-09 //评论点赞点赞 $(".praise_link").click(function(){ var renke = $(this); $.getJSON( '/praises/submit/' + renke.attr('data-id'), function(result){ layer.msg( result.message, { skin: 'layui-layer-lan', icon: (result.status == true) ? 1 : 5, time: 3000, end : function(){} } ); if(result.status == true){ //修改点赞数量 renke.html('认可(' + result.number + ')'); renke.css({'background-position-y': '-14px'}); } }); }); //更多评论展开:gt(1) $(".loupandianping .left ul .more").click(function(){ if($(this).text()=="更多评论"){ $(".loupandianping .left ul li.more").html("折叠评论"); }else{ $(".loupandianping .left ul li.more").html("更多评论"); } $(".loupandianping .left ul li.none").toggle(); }); //百度地图切换代码 $(".category_bar li").each(function(e){ $(this).on("click" , function(){ $("#sec_list ul:eq("+e+")").addClass("block").siblings("ul").removeClass("block"); }); }); //同区位楼盘选项标签切换 $(".loupanquwei ul li").each(function(e){ $(this).hover(function(){ $(this).addClass("hover").siblings().removeClass("hover"); $(".loupanquwei ol:eq("+e+")").show().siblings(".loupanquwei ol").hide(); }); }); //点评发布页样式代码 //匿名选择代码 //2022-01-08 //修改了选择器,防止误触发匿名选项 $(".xiedianping .form").on("click", '.btn .right span', function(){ var nm = $(this).attr("class"); if(nm == "hover"){ $(this).removeClass("hover"); $(this).find('input').val("false"); }else{ $(this).addClass("hover"); $(this).find('input').val("true"); } }); //购房目的选择代码 $(".xiedianping .form .choice").on("click" , "a" , function(){ $(this).toggleClass("hover"); if( $(this).attr("class") == "hover"){ //2022-01-22 改为获取data-id $(this).find('input').val($(this).attr("data-id")); }else{ $(this).find('input').val(""); } }); //点评分数选择 $(".xiedianping .form .score a").on('mouseenter', function() { //需求1:鼠标移入后,当前的a标签和前面的a标签显示实心,后面的a标签显示空心 $(this).addClass("hover").prevAll().addClass("hover").end().nextAll().removeClass("hover"); $(this).siblings("span").hide().siblings(".temp").show().text($(this).attr("title")); }).on('mouseleave', function() { $(".xiedianping .form .score a").removeClass("hover"); //找到索引的a,给这个a和它前面的a设置实心 $('a[index="dianji"]').addClass("hover").prevAll().addClass("hover"); $(this).siblings(".temp").hide().siblings(".result").show(); }).on('click', function() { //给点击的a添加索引,其余的去除索引 var v = $(this).attr("data-hint"); var t = $(this).attr("title"); $(this).attr('index', 'dianji').siblings().removeAttr('index'); $(this).siblings("input").attr('value', v); $(this).siblings("span").text(t); }) //判断点评内容文字长度 $("#area").on("keydown", function(){ var count = $("#area").val().length; if( count <= 200 ){ $("#textCount").html(" 还能输入" + (200 - count) + "个字"); }else{ $("#textCount").html(" 已超出" + (count - 200) + "个字"); } }); $(".xiedianping .form .score").on("click",".right a",function(){ var num = parseInt($(".xiedianping .form .score input[id='score_1001']").val())+parseInt($(".xiedianping .form .score input[id='score_1002']").val())+parseInt($(".xiedianping .form .score input[id='score_1003']").val())+parseInt($(".xiedianping .form .score input[id='score_1004']").val())+parseInt($(".xiedianping .form .score input[id='score_1005']").val()); var pf = num/5; $(".xiedianping .form .count span b").text(pf.toFixed(1)); }); //通用终端代码结束 if (_width > 960) { //导航下拉菜单 $(".menu li").each(function(){ $(this).hover(function(){ $(this).find("ol").show(); },function(){ $(this).find("ol").hide(); }); }); //楼盘详情页 //获取定位 var navHeight = $(".nav").offset().top; //获取到当前内容块具体页面顶部的距离 //var sideHeight = $(".side").offset().top; //获取到当前内容块具体页面顶部的距离 //var teseHeight = $(".xuanfuhide").offset().top; //获取项目特色到页面顶部的距离 //var sHeight = $(".side").height(); //获取容器的高度 //滚动判断代码开始 $(window).scroll(function() { //滚动切换导航样式 var scrollTop = $(this).scrollTop(); // winodw滚动的高度 //楼盘详情首页主导航悬停 if (scrollTop > navHeight) { $(".nav").addClass("nav_fixed"); } else { $(".nav").removeClass("nav_fixed"); } //边栏悬浮 // if (scrollTop > (sideHeight-70)) { // $(".side").addClass("side_fixed"); // } else { // $(".side").removeClass("side_fixed"); // } //隐藏边栏 // if (scrollTop > (teseHeight - sHeight - 180)) { // $(".side").removeClass("side_fixed"); // } }); //滚动判断代码结束 //楼盘首页轮播缩略图 var galleryThumbs = new Swiper('.focus .gallery-thumbs', { spaceBetween: 10, slidesPerView: 5, loop: true, freeMode: true, loopedSlides: 5, watchSlidesVisibility: true, watchSlidesProgress: true, }); //楼盘首页轮播大图 var galleryTop = new Swiper('.focus .gallery-top', { loop: true, autoplay: true, navigation: { nextEl: '.focus .gallery-top .swiper-button-next', prevEl: '.focus .gallery-top .swiper-button-prev', }, autoHeight: true, thumbs: { swiper: galleryThumbs, }, }); //楼盘首页轮播效果鼠标移入暂停 $('.focus .gallery-top').hover(function() { galleryTop.autoplay.stop(); }, function() { galleryTop.autoplay.start(); }); //楼盘相册页轮播缩略图 var xcgalleryThumbs = new Swiper('.xiangce_focus .gallery-thumbs', { spaceBetween: 10, slidesPerView:8, loop: true, freeMode: true, loopedSlides: 8, watchSlidesVisibility: true, watchSlidesProgress: true, }); //楼盘相册页轮播大图 var xcgalleryTop = new Swiper('.xiangce_focus .gallery-top', { loop: true, autoplay: true, navigation: { nextEl: '.xiangce_focus .gallery-top .swiper-button-next', prevEl: '.xiangce_focus .gallery-top .swiper-button-prev', }, autoHeight: true, thumbs: { swiper: xcgalleryThumbs, }, }); //楼盘相册轮播效果鼠标移入暂停 $('.focus .gallery-top').hover(function() { galleryTop.autoplay.stop(); }, function() { galleryTop.autoplay.start(); }); //楼盘户型左右滚动代码 var huxingswiper = new Swiper('.huxing-container', { slidesPerView: 2, autoplay: { delay: 2000,//1秒切换一次 }, //loop: true, spaceBetween: 20, navigation: { nextEl: '.huxing-container .swiper-button-next', prevEl: '.huxing-container .swiper-button-prev', }, pagination: { el: '.huxing-pagination', clickable: true, }, }); //鼠标移入暂停 $('.huxing-container').hover(function() { huxingswiper.autoplay.stop(); }, function() { huxingswiper.autoplay.start(); }); //电脑端底部滚动报名人数 var bmswiper = new Swiper('.baoming-container', { direction: 'vertical', loop: true, height: 17, autoplay: true, speed: 400, }); bmswiper.autoplay.start(); //鼠标移入暂停 $('.baoming-container').hover(function() { bmswiper.autoplay.stop(); }, function() { bmswiper.autoplay.start(); }); //底部预约 $(".yuyue .pp").click(function() { var css=$(".yuyue .bg").height(); if(css==80){ $(".yuyue .bg").animate({"height":"0px"}); $(".foot").animate({"padding-bottom":"25px"}); }else{ $(".yuyue .bg").animate({"height":"80px"}); $(".foot").animate({"padding-bottom":"105px"}); } }); } else { //顶部主菜单样式 $(".m-menu").click(function(event){ event.stopPropagation(); $(".menu").slideToggle(300); return false; }); $(document).click(function(event){ var _con = $('.menu'); // 设置目标区域 if(!_con.is(event.target) && _con.has(event.target).length === 0){ $('.menu').fadeOut(300); } }); //移动端首屏图下面自助下载点击效果 $(".banside .side_down .label_down").on("click" , "font" ,function(){ $(this).toggleClass("hover"); }); //楼盘详情页轮播图移动端 var galleryTop = new Swiper('.focus .gallery-top', { loop: true, autoplay: true, loopedSlides: 5, navigation: { nextEl: '.focus .swiper-button-next', prevEl: '.focus .swiper-button-prev', }, autoHeight: true, }); //楼盘相册页轮播大图 var xcgalleryTop = new Swiper('.xiangce_focus .gallery-top', { loop: true, autoplay: true, navigation: { nextEl: '.xiangce_focus .gallery-top .swiper-button-next', prevEl: '.xiangce_focus .gallery-top .swiper-button-prev', }, pagination: { el: '.xiangce_focus-pagination', clickable: true, }, autoHeight: true, }); //楼盘详情页户型图 var huxingswiper = new Swiper('.huxing-container', { autoplay: { delay: 2000,//1秒切换一次 }, loop: true, pagination: { el: '.huxing-pagination', clickable: true, }, }); //基本信息点击展开 $(".loupan_jibenxinxi .left ul .more").click(function(){ $(this).toggleClass("fold"); $(".loupan_jibenxinxi .dingziliaobao").slideToggle(200); }); } //点击图片弹出遮罩层显示大图 var $list_focus = $('.list_focus'); //var $list_photos = $('.list_photos'); var $list_huxing = $('.list_huxing'); var viewoptions = { url: 'data-original', navbar: true, zoomRatio: 0.4, button: true, title: true, navbar: true, keyboard: true, fullscreen: true }; $list_focus.viewer(viewoptions); //$list_photos.viewer(viewoptions); $list_huxing.viewer(viewoptions); //预约看房 $('.btn_kanfang').on('click', function() { laydate = layui.laydate; layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, skin: 'box_popup', content: '

预约看房

\
\
\
\
\
', success: function(){ laydate.render({ elem: '#yydate', type: 'datetime', min: 0, max: 7 }); } }); }); //降价提醒 $('.btn_tx').on('click', function() { layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, skin: 'box_popup', content: '

订阅降价提醒

已有 502 人设置提醒
价格变动马上提醒,降价早知道
' }); }); //查看房源 $('.btn_fy').on('click', function() { layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, skin: 'box_popup', content: '

查看剩余房源

获取剩余户型信息及价格单
短信自动免费发送

' }); }); //停车场 $('.btn_parking').on('click', function() { layer.open({ type: 1, title: false, closeBtn: 2, isOutAnim: true, shadeClose: true, skin: 'box_popup', content: '

停车场位置

售楼处有免费停车场,可发送精准定位
看房省时省力,避免路边交警贴条

' }); }); //额外优惠 $('.btn_youhui').on('click', function() { layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, skin: 'box_popup', content: '

申请额外优惠

已有502人领取优惠
折扣优惠将与您的手机号绑定
' }); }); //右侧约专车 $('.btn_zhuanche').on('click', function() { layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, skin: 'box_popup', content: '

专车接送看房

售楼处免费专车接送看房
时间、地点由您来定
' }); }); //百度地图中约专车 $('#container').on('click' , '.btn_map_zhuanche' , function() { layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, skin: 'box_zhuanche', content: '

专车接送看房

售楼处免费专车接送看房

时间、地点由您来定

看房高效不受累!

' }); }); //限时特价房源 $('.btn_tejiafang').on('click', function() { layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, //skin: 'box_popup', //content: '

恭喜您获得

已有176人参加组团砍价优惠
参加组团砍价优惠
部分房源可直接减房款
折扣优惠可叠加
' skin: 'box_tejiafang', content: '

# 人多更优惠176人已参与 #

—线上预约样板间可享到访礼—
2025年03月14日
' }); }); //组团砍价 $('.btn_kj').on('click', function() { layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, skin: 'box_popup', content: '

恭喜您获得

已有 176 人参加组团砍价优惠
参加组团砍价优惠
部分房源可直接减房款
折扣优惠可叠加
' }); }); //查看价格单 $('.btn_jiagedan').on('click', function() { layer.open({ type: 1, title: false, closeBtn: 1, shadeClose: true, skin: 'box_jiagedan', content: '

获取详细的价格单信息,系统通过短信自动发送!

' }); }); });