123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- $(function(){
- // 限时特惠滚动js
- var obj=$('.ztHead_intr');
- var dw=obj.find(".lpjs").width();
- var cw=obj.find(".lpjs span").width();
- var cx=0;
- //宽度超出当前content宽度才滚动
- if(cw>dw){
- var scrollval=null;//滚动事件变量
- obj.find(".lpjs span").append(obj.find(".lpjs i").eq(0).html());
- function move(){
- obj.find(".lpjs span").css({
- "left":"-"+cx+"px"
- })
- if(cx>(cw-dw)+dw)
- cx=0;
- cx++;
- }
- scrollval = setInterval(move,35);
- obj.mouseover(function(){
- clearInterval(scrollval);
- });
- obj.mouseout(function(){
- scrollval = setInterval(move,35);
- })
- }
- // 调取数据ajax
- var cityId=""
- var cityName=""
- cityId=$('.susp_main ul li').eq(0).attr('data-id');
- $('.susp_main ul li').eq(0).addClass('on');
- cityName=$('.susp_main ul li').eq(0).find('a').text();
- $('.main_title span').html(cityName+'热卖房产TOP榜');
- chunjiezt();
- $('.value_pulic[data-id="'+cityId+'"]').show();
- $('.susp_main ul li').on('click',function(){
- $(this).addClass('on').siblings().removeClass('on');
- cityId=$(this).attr('data-id');
- cityName=$(this).find('a').text();
- $('.main_title span').html(cityName+'热卖房产TOP榜')
- $('.cityValue_m p.title_text').html('带你读懂'+cityName+'置业优势');
- $('body input[name="intention_city"]').val(cityName);
- chunjiezt();
- $('.value_pulic').hide();
- $('.value_pulic[data-id="'+cityId+'"]').show();
- })
-
- function chunjiezt(){
- $('.lplist_mainbox').html('')
- // $('.value_pulic').html('')
- var _html="";
- var _value='';
- $.ajax({
- type:'POST',
- url:'/zt/chunjieztform',
- data:{id:cityId},
- async:false,
- dataType:'json',
- success:function(data){
- if(data.code == 200){
- var _data=data.data;
- _html+='<div class="lplist_main">';
- _html+='<ul class="swiper-wrapper">';
- $.each(_data,function (key,val) {
- _html+='<li class="swiper-slide" data-hid="'+val.id+'" data-source="'+val.id+'">';
- _html+='<div class="topcenter">';
- _html+='<a href="/house/'+val.id+'">';
- _html+='<div class="lpimg">';
- _html+='<img src="'+val.thumb+'" alt="">';
- _html+='</div>';
- _html+='<div class="lptext">';
- _html+='<div class="lptitle c">';
- _html+='<p class="left">';
- _html+='<i><img src="/zt/xinnain2020/image/ico_7.png" alt=""></i>';
- _html+='<span>'+val.name+'</span>';
- _html+='</p>';
- _html+='<p class="right">';
- _html+='<i><img src="/zt/xinnain2020/image/ico_13.png" alt=""></i>';
- _html+='<span>'+val.cityName.city_name+'</span>';
- _html+='</p>';
- _html+='</div>';
- _html+='<div class="lppric">';
- if(val.housedetail.preferential_price =='' || val.housedetail.preferential_price == null){
- _html+='<span>待定</span>';
- }else{
- _html+='<i><img src="/zt/xinnain2020/image/ico_2.png" alt=""></i>';
- _html+= val.housedetail.preferential_price;
- }
- // _html+='<span>1300<em>万</em></span>';
- _html+='<b>'+val.expiration_date+'</b>';
- _html+='</div>';
- _html+='<div class="lpzkou">';
- _html+='<p class="lpzkou_m c">';
- _html+='<em>新春钜惠 :</em>';
- _html+='<span>';
- if(val.housedetail.preferential_zt == '' || val.housedetail.preferential_zt == null){
- _html+='<i>暂无</i>';
- }else{
- _html+='<i>'+val.housedetail.preferential_zt+'</i>';
- }
- _html+='</span>';
- _html+='</p>';
- _html+='</div>';
- _html+='<div class="lptuij">';
- _html+='<p class="t">';
- _html+='<i><img src="/zt/xinnain2020/image/ico_3.png" alt=""></i>';
- _html+='<span>推荐理由</span>';
- _html+='</p>';
- if(val.housedetail.push_reason == '' || val.housedetail.push_reason == null){
- _html+='<p class="b">暂无</p>';
- }else{
- _html+='<p class="b">'+val.housedetail.push_reason+'</p>';
- }
- _html+='</div>';
- _html+='<div class="lptuij">';
- _html+='<p class="t">';
- _html+='<i><img src="/zt/xinnain2020/image/ico_6.png" alt=""></i>';
- _html+='<span>楼盘地址</span>';
- _html+='</p>';
- _html+='<p class="b">'+val.housedetail.address+'</p>';
- _html+='</div>';
- _html+='</div>';
- _html+='</a>';
- _html+='</div>';
- _html+='</li>';
- })
- _html+='</ul>';
- _html+='</div>';
-
- // $.each(_data,function (key,val) {
- // var _key=key+1
- // _value+='<div class="pul_mo c">';
- // if ( _key%2 ==0) {
- // _value+='<div class="pule_ico pule_right fr">';
- // }else{
- // _value+='<div class="pule_ico fl">';
- // }
- // _value+='<p><img src="/zt/xinnain2020/image/ico_18.png" alt=""></p>';
- // _value+='<i></i>';
- // _value+='</div>';
- // if ( _key%2 ==0) {
- // _value+='<div class="pule_text fl">';
- // }else{
- // _value+='<div class="pule_text fr">';
- // }
- // _value+='<p class="Ii">'+_key+'. 宜居环境</p>';
- // _value+='<p class="It">海南四季温暖且森林覆盖率高,负氧离子充足。海南以优美的热带滨海风光为主要特色,是国内居住旅游的优选之地。</p>';
- // _value+='</div>';
- // _value+='</div>';
- // if ( _key%2 ==0) {
- // _value+='<div class="Dividing"><img src="/zt/xinnain2020/image/ico_24.png" alt=""></div>';
- // }else{
- // _value+='<div class="Dividing"><img src="/zt/xinnain2020/image/ico_23.png" alt=""></div>';
- // }
- // })
- $('.lplist_mainbox').html(_html);
- // $('.value_pulic').html(_value);
- // 轮播图
- var mySwiper1 = new Swiper('.lplist_main',{
- autoplay:false, //自动切换
- loop : true, //循环
- pagination: '.swiper-pagination', // 如果需要分页器
- onSlideChangeEnd: function(swiper){
- var lphid=$('.lplist_main .swiper-slide-duplicate-active').attr('data-hid');
- $('.lpfoot_but a.in_but').attr('data-hid',lphid);
- },
- })
- }
- }
- })
- }
-
- // 豪礼报名js
- $("body").on('click','.luxury_buttom',function(){
- var bmhid=$(this).attr('data-hid');
- var bmsource=$(this).attr('data-source');
- $('.luxuryMain form input[name="hid"]').val(bmhid)
- $('.luxuryMain form input[name="source"]').val(bmsource)
- $('.luxuryBox').show(30);
- $('.luxuryBg').show();
- })
- $('.luxuryBg,.ico_bg').on('click',function(){
- $('.luxuryBox').hide();
- $('.luxuryBg').hide();
- $('body input[type="text"]').val('');
- })
- // 豪礼报名js
- $("body").on('click','.purchase_buttom',function(){
- $('.purchaseBox').show(30);
- $('.purchaseBg').show();
- })
- $('.purchaseBg,.pu_gb').on('click',function(){
- $('.purchaseBox').hide();
- $('.purchaseBg').hide();
- $('body input[type="text"]').val('');
- })
- // 右边悬挂
- $(window).scroll(function (){
- var st = $(this).scrollTop();
- // console.log(st);
- if(st >170){
- $('.suspBox').show();
- }else{
- $('.suspBox').hide();
- }
- });
- $('.Pgup').on('click',function(){
- $('html,body').animate({scrollTop: '0px'}, 500);
- })
- // 报名提交事件
- PublicAction.AjaxSend(
- {
- CORID:'buttom_tj', /*操作ID*/
- }
- );
- $('.submit_area .buttom_tj').on('click',function(){
- setTimeout(function(){
- var _html = $('.alert-container .alert-content').html();
- if(_html == '提交成功'){
-
- $('.purchaseBox').hide();
- $('.purchaseBg').hide();
- $('.luxuryBox').hide();
- $('.luxuryBg').hide();
- $('body input[type="text"]').val('');
- }
-
- },300)
-
- })
- })
|