$(function (){ var mySwiper1= new Swiper(".swiper-container1",{ // loop : true, loopedSlides:4, autoplay:5500, autoplayDisableOnInteraction : false, // 如果需要分页器 pagination : '.swiper-pagination', paginationType : 'custom', paginationCustomRender: function (swiper, current, total) { return current + ' / ' + total; }, }); var mySwiper1= new Swiper("#swiper1",{ loop : true, loopedSlides:4, autoplay:5500, autoplayDisableOnInteraction : false, // 如果需要分页器 // pagination: '.swiper-pagination', slidesPerView :"auto" }); var mySwiper = new Swiper ('.y_lphomepc_cent_list .swiper-container2', { loop : true, loopedSlides:4, autoplay:5500, // 如果需要分页器 pagination: '.swiper-pagination', // 如果需要前进后退按钮 prevButton:'.swiper-button-prev', nextButton:'.swiper-button-next', slidesPerView :"auto" }) }) // 报名切换 var mySwiper = new Swiper('#wcon',{ // loop : true, // spaceBetween: 20, // centeredSlides: true, slidesPerView: 'auto', touchRatio: 0.5, slideToClickedSlide: true }) // var m_Huxing_lunbo = new Swiper('.m_zx_lunbo', { // loop : true, // spaceBetween: 10, // centeredSlides: true, // slidesPerView: 'auto', // touchRatio: 0.5, // slideToClickedSlide: true // }); // $('.m_lunbo_box ul li').on('click',function(){ // var _value = $(this).attr('value'); // var _hid = $(this).attr('hid'); // var _mindex = $(this).attr('mindex'); // window.location='/house/pvimage/'+_hid+'?album_id='+_value+'&mindex='+_mindex+'&hid='+_hid+''; // }) // 楼盘首页地图 $(function(){ //获取周边配套 $('.y_lpdt_list ul li a').on('click',function(){ $('.y_lpdt_list ul li a').removeClass('on'); $(this).addClass('on'); var _data = $(this).find('p.y_text').text(); //选择中的内容 var _longitude =$('#y_lpmap').attr('data-jwd'); //获取经纬度 var pintx = _longitude.split(',')[0]; var pinty = _longitude.split(',')[1]; _longitude = new BMap.Point(pintx,pinty); doSearch(_data,_longitude);//调用地图弹窗 }) }); // 百度地图API功能 var map = new BMap.Map("y_lpmap"); var _lTude =$('#y_lpmap').attr('data-jwd'); //获取经纬度 var _lJg =$('#y_lpmap').attr('data-jg'); //获取楼盘价格 var _lTitle =$('#y_lpmap').attr('data-title'); //获取楼盘标题 var pintx = _lTude.split(',')[0]; var pinty = _lTude.split(',')[1]; _lTude = new BMap.Point(pintx,pinty); map.centerAndZoom(_lTude, 15); map.enableScrollWheelZoom(); //启用滚轮放大缩小,默认禁用 // 复杂的自定义覆盖物 function ComplexCustomOverlay(_lTude, text, mouseoverText){ this._point = _lTude; this._text = text; this._overText = mouseoverText; } ComplexCustomOverlay.prototype = new BMap.Overlay(); ComplexCustomOverlay.prototype.initialize = function(map){ this._map = map; var div = this._div = document.createElement("div"); div.style.position = "absolute"; div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat); div.style.backgroundColor = "#fff"; div.style.border = "1px solid #e1e1e1"; div.style.color = "666"; // div.style.height = "18px"; div.style.padding = "5px 10px"; // div.style.lineHeight = "10px"; div.style.whiteSpace = "nowrap"; // div.style.MozUserSelect = "none"; div.style.fontSize = "14px" var span = this._span = document.createElement("span"); div.appendChild(span); span.appendChild(document.createTextNode(this._text)); var that = this; var arrow = this._arrow = document.createElement("div"); arrow.style.background = "url(../../image/ico_map1.png) no-repeat center"; arrow.style.backgroundSize = "100%"; arrow.style.position = "absolute"; arrow.style.width = "20px"; arrow.style.height = "28px"; arrow.style.top = "30px"; arrow.style.left = "25px"; arrow.style.overflow = "hidden"; div.appendChild(arrow); div.onmouseover = function(){ this.style.backgroundColor = "#6BADCA"; this.style.borderColor = "#3487ab"; this.getElementsByTagName("span")[0].innerHTML = that._overText; arrow.style.backgroundPosition = "0px -20px"; } div.onmouseout = function(){ this.style.backgroundColor = "#EE5D5B"; this.style.borderColor = "#BC3B3A"; this.getElementsByTagName("span")[0].innerHTML = that._text; arrow.style.backgroundPosition = "0px 0px"; } map.getPanes().labelPane.appendChild(div); return div; } ComplexCustomOverlay.prototype.draw = function(){ var map = this._map; var pixel = map.pointToOverlayPixel(this._point); this._div.style.left = pixel.x - parseInt(this._arrow.style.left) -13 + "px"; this._div.style.top = pixel.y - 45 + "px"; } var txt = _lTitle, mouseoverTxt = txt + " " + _lJg ; var myCompOverlay = new ComplexCustomOverlay(_lTude, _lTitle ,mouseoverTxt); map.addOverlay(myCompOverlay); //map展现结果的地图实例 //autoViewport检索结束后是否自动调整地图视野,false 不调整地图视野 var local = new BMap.LocalSearch(map,{renderOptions:{map:map,autoViewport:true}}); //地址检索 function doSearch(Odata,Opoint){ var address = Odata; local.searchNearby(address,Opoint); } $(function(){ $('.y_centerpc').find('img').each(function(){ var $that = $(this); var _alt = $that.attr('alt'); if(_alt != 'code'){ $that.removeAttr('width'); $that.removeAttr('height'); $that.css({'display':'block','width':'100%','height':'auto'}); } }) $('.y_lphomejg p.y_yxq span').text(yxqtime); }) /* * 楼盘预售许可证弹窗 * */ $(function(){ var lic_id; //为了这些变量在其它地方用; $('.y_ckysz').on('click',function(){ var $that = $(this); var height = $('.y_licence').outerHeight(); var width = $('.y_licence').outerWidth(); CreatePopLayerDiv2(width,width,'/public/licence'); $('#offDiv1').css({'top':height+'px'}).animate({top:'20%'}) // 向弹窗传数据 parent.lic_id = $that.attr('data-id'); //把楼盘名称传向父级 }) // 看房定制数量修改 var random = Math.floor(Math.random()*150+101); // console.log(random) $('.y_lpkfdz_dzrs span em').html(random) // 房贷计算户型面积处理 $('.info_xllist li').each(function(){ var acreage = $(this).attr("size"); if(acreage.indexOf('m') != -1){ var akx = acreage.split("m"); $(this).attr("size",parseInt(akx[0])); if(akx[0].indexOf('-') != -1){ var ak = acreage.split("-"); $(this).attr("size",parseInt(ak[0])); } } if(acreage.indexOf('-') != -1){ var ak = acreage.split("-"); $(this).attr("size",parseInt(ak[0])); } }) //房贷参考 var _listhtml = $('.info_xllist li').eq(0).html(); $('.info_xl span').html(_listhtml); //默认第一个 var doughnutData; var _jiage = $('.jiage').html(); //楼盘价格 var unit = $('.unit').html() //价格单位 var _Size = $('.info_xllist li').eq(0).attr('Size'); //默认面积 // 当面积内容出来 “约” 时的处理 _Size = (_Size.indexOf('约') != -1) ? _Size.slice(_Size.indexOf('约')+1) : _Size; var price = (unit.indexOf('万') != -1) ? _jiage : Math.ceil((_jiage * _Size) /10000); //计算总价 if(!(unit.indexOf('万') != -1)){ $('body').on('click','.info_xl',function(){ $('.info_xllist').toggle(); }) }else{ $('.info_xl').css({"background":"#fff"}); $('.info_xl').html('主力户型'); } Calculation(); $('.info_xllist li').on('click',function(){ _Size = $(this).attr('Size'); //面积 _Size = (_Size.indexOf('约') != -1) ? _Size.slice(_Size.indexOf('约')+1) : _Size; // 当面积内容出来 “约” 时的处理 _listhtml = $(this).html(); $('.info_xl span').html(_listhtml); price = Math.ceil((_jiage * _Size) /10000) // console.log(price); $('.info_xllist').hide(); Calculation(); }) function Calculation(){ var cal = new Calculator(); var firstPay=Math.round(price * 0.3 * 100) / 100; var biz=Math.round((price - firstPay) * 100) / 100; var data1 = cal.loanResult({ type: 2, //商贷 total:price,firstPay: firstPay,acc:0,biz:biz,rate:0,year: 20,calType:2 }, 2); //本金 $(".perMonth").text(Math.round(data1.perMonthPay*10000*100)/100); $("#totalPay").text(price); $("#firstPay").text(firstPay); $("#loanPrice").text(biz); $("#interset").text(data1.interestPay); doughnutData = [{ value: firstPay, color: "#007AF5" },{ value: biz, color: "#FFA245" },{ value: Math.round(data1.interestPay * 100) / 100, color: "#62BE4B" }]; } var myDoughnut = new Chart(document.getElementById("canvas_fdck").getContext("2d")).Doughnut(doughnutData, { animation: true, animationEasing : "easeOutQuart", height:145, width:145, }); }) //创建一个弹出层,width 宽度,height 高度,url function CreatePopLayerDiv2(width,height,url){ var Iheight=$(window).outerHeight(); var Iwidth =$(window).outerWidth(); var heights = height || 300; var widths = width || 500; var Oheight= (Iheight -heights) / 2; var Owidth = (Iwidth - widths) /2; var div ='