$(function(){ // v2改版 轮播 jQuery(".js_yhn_slide").slide({ mainCell: ".js_yhn_slideBox ul", effect: "left", mouseOverStop:true, autoPlay: true, trigger: "click", delayTime: 500, interTime: 5000 }); // 热销楼盘 var _hotCiry=$('.js_yv2Hotlp_nav a').eq(0).attr('data-city') $('.js_yv2Hotlp_nav a').eq(0).addClass('on').siblings().removeClass('on'); _hotHone(_hotCiry) $('.js_yv2Hotlp_nav a').on('click',function(){ _hotCiry=$(this).attr('data-city'); $(this).addClass('on').siblings().removeClass('on'); _hotHone(_hotCiry) }) // 帮你找房 报名电话轮播 $('.js_yv2_bwzfTell').myScroll({ speed: 40, //数值越大,速度越慢 rowHeight: 26 //li的高度 }); // 房产资讯 var _newsId=$('.js_newsNav a').eq(0).attr('data-id') $('.js_newsNav a').eq(0).addClass('on').siblings().removeClass('on'); _newsHone(_newsId); $('.js_newsNav a').on('click',function(){ _newsId=$(this).attr('data-id'); $(this).addClass('on').siblings().removeClass('on'); _newsHone(_newsId); }) // 团购优惠看房团 报名电话轮播 $('.js_news_right_telle').myScroll({ speed: 40, //数值越大,速度越慢 rowHeight: 26 //li的高度 }); // 帮你找房 $('.js_yv2_bwzfForm_city').on('click','.js_in_mina',function(){ $('.js_yv2_bcity_main').show(); }) $(document).click(function() { $('.js_yv2_bcity_main').hide(); }) $('.js_yv2_bwzfForm_city').on('click',function(e){ e?e.stopPropagation():event.cancelBubble = true; }) $('.js_yv2_bcity_main').on('click','a',function(){ var cityTxt=$(this).text(); $(this).addClass('on').siblings().removeClass('on'); $('.js_in_mina input.in_text').val(cityTxt); $('.js_yv2_bcity_main').hide(); }) //报名验证提交的调用 var fun = { "error" : function(){ PublicAction.hint("提交末成功!"); //编写需要操作的方法 }, "success" : function(){ PublicAction.hint("提交成功!"); //编写需要操作的方法 $('body input[type="text"]').val(''); $('.js_yv2_bcity_main a').removeClass('on'); RemoveDiv(); //数据提交成功后关闭弹出层 } } PublicAction.AjaxSend({CORID:'js_in_button'},fun); }); // 热销楼盘 ajax function _hotHone(id) { $.ajax({ url: "/json/pushcityhouselist", data: {city: id}, type: "POST", dataType: "json", success: function (data) {//请求成功完成后要执行的方法 if (data.code == 200) { $('.js_yv2Hotlp_box_left ul').html(''); var _html = ''; $.each(data.data, function (k, v) { var randomX = 0; var randomY = 14; var randvalue = parseInt(Math.random() * (randomX - randomY + 1) + randomY); _html+='
  • '; _html+='

    '; _html+=''; _html+='

    '; _html+='
    '; _html+='

    '; _html+=''+v.name+''; // _html+='['+v.city_name+']'; _html+='

    '; _html+='
    '; _html+='

    '; if(v.sale_price){ _html+=''+v.sale_price+''+v.price_unit+''; }else{ _html+='待定'; } _html+='有效期至:'+v3Time+''; _html+='

    '; _html+=' 向Ta咨询> '; _html+='
    '; if(v.preferential){ _html+='

    '+v.preferential+'

    '; }else if(v.news_name){ _html+='

    【最新动态】'+v.news_name+'

    '; } _html+='
    '; _html+='
  • '; }) $('.js_yv2Hotlp_box_left ul').html(_html); }; } }); } // 房产资讯 ajax function _newsHone(id) { $.ajax({ url: "/json/pushnewslist", data: {news: id}, type: "POST", dataType: "json", success: function (data) {//请求成功完成后要执行的方法 if (data.code == 200) { $('.js_yv2_news_hd ul,.js_yv2_news_l,.js_news_right_top_l').html(''); var _htmlHd = ''; var _htmlL = ''; var _htmlT = ''; $.each(data.data, function (k, v) { if(k<4){ _htmlHd+='
  • '; _htmlHd+=''; _htmlHd+='

    '; _htmlHd+='

    '+v.subject+'

    '; _htmlHd+='
    '; _htmlHd+='
  • '; }else if(k>3 && k <7){ _htmlL+=''; _htmlL+=''; _htmlL+=''+v.subject+''; _htmlL+=''; }else if(k>6 && k <13){ _htmlT+=''; _htmlT+=''; _htmlT+=''+v.subject+''; _htmlT+=''; } }) $('.js_yv2_news_hd ul').html(_htmlHd) $('.js_yv2_news_l').html(_htmlL) $('.js_news_right_top_l').html(_htmlT); // v2改版 轮播 jQuery(".js_yv2_news_slide").slide({ mainCell: ".js_yv2_news_hd ul", effect: "left", mouseOverStop:true, autoPlay: true, trigger: "click", delayTime: 500, interTime: 5000 }); }; } }); } // 头部导航选项卡 $('.m_nav_left li').eq(0).find('i').attr('id', 'm_nav_left_i'); $('.m_nav_left li').eq(0).find('span').attr('id', 'm_nav_left_span'); function m_rmlp(name1, name2, name3) { $(name2).first().show(); $(name3).first().css('background', 'none') $(name1).on('click', function () { $(name3).css('background', '#FFF') $(name2).hide(); var IDdata = $(this).attr('dataId'); $(name2 + '[dataId=' + IDdata + ']').show(); $(this).find('i').attr('id', 'm_nav_left_i').parent().siblings().find('i').attr('id', ''); $(this).find('.m_nav_left_img').css('background', 'none'); $(this).find('span').attr('id', 'm_nav_left_span').parent().siblings().find('span').attr('id', ''); }) } // 价格走势图 $(document).ready(function () { var chart = document.getElementById('chart'); if (chart == null) return false; var chartData = echarts.init(chart, 'dark'); chartData.setOption({ backgroundColor: '#E9EEF2', //rgba设置透明度0.1 title: { // 标题设置 left: '5', top: '10', text: '价格(元)', textStyle: { //文字颜色 color: '#343434', //字体风格,'normal','italic','oblique' fontStyle: '100', fontWeight: 'bold', //字体大小 fontSize: 12, } }, toolbox: { show: true, right: '5', top: '5', feature: { // mark : {show: true}, // dataView : {show: true, readOnly: false}, magicType: {show: true, type: ['bar']}, // 切换为柱状 restore: {show: true}, // 还原 // saveAsImage : {show: true} } }, grid: { // 移动内容 left: '3%', right: '4%', bottom: '7%', containLabel: true }, tooltip: { // 引导线 trigger: 'axis', backgroundColor: '#6f7a94', // borderColor:'#FFF', borderRadius: 5, //圆角 textStyle: { color: '#FFF', // extraCssText: 'box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);' } }, legend: { //关闭 top: '10', data: [''], //区域数据 textStyle: { color: "#6A6A6A" } }, xAxis: [ //底部 内容 { type: 'category', data: [], //月份数据 axisLabel: { show: true, textStyle: { color: '#343434' } }, axisLine:{ lineStyle:{color:'#343434'} // x轴坐标轴颜色 }, axisTick:{ lineStyle:{color:'#343434'} // x轴刻度的颜色 } } ], yAxis: { //右边 内容 axisLabel: { show: true, textStyle: { color: '#343434' } }, axisLine:{ lineStyle:{color:'#343434'} // x轴坐标轴颜色 }, axisTick:{ lineStyle:{color:'#343434'} // x轴刻度的颜色 } }, series: [{ color: ['#43A6F5'], type: 'line', name: '', // 悬浮区域 data: [] // 价格数据 }] }); function ajax_zs() { var html = ''; $.ajax({ url: "/json/cityprice", data: {id: dataZs}, type: "GET", dataType: "json", success: function (data) {//请求成功完成后要执行的方法 chartData.setOption({ //走势图数据 legend: { data: data.data.region }, xAxis: { data: data.data.categories //单独 }, series: [{ name: data.data.region[0], data: data.data.data }] }); var categoriesCount = data.data.categories.length; var dataCount = data.data.data.length; html += '' + data.data.region[0] + '' + data.data.categories[categoriesCount - 1] + '新房均价'; // '+ data.region + data.categories[5] +' html += '' + data.data.data[dataCount - 1] + '元/m²'; //单独 html += '降价通知'; $('.m_r_average_price').html(html); } }); } var dataZs = $('.m_trend_r ul li').eq(0).attr('data_zs'); ajax_zs(); $('.m_trend_r ul li').on('click', function () { dataZs = $(this).attr('data_zs'); $(this).attr('id', 'trend').siblings().attr('id', ''); ajax_zs(); }) }); // 价格拖动筛选 $(function () { $('.single-slider').jRange({ from: 0, to: 1000, step: 10, scale: [0 + '万', 250 + '万', 500 + '万', 750 + '万', 1000 + '万'], format: '%s' + '万', width: 433, showLabels: true, showScale: true }); }); function Qalert() { var M = {}; if (M.dialog1) { return M.dialog1.show(); } var city = $('#feng_cityall').html(); // if (city != '全国') { // M.dialog1 = jqueryAlert({ // 'content': '当前所在省份为:' + city + '', // 'closeTime': 4000, // }) // } } Qalert(); //获取cookie,参数name指定要获取的cookie的名称 function getCookie(name) { var start = document.cookie.indexOf(name + "="); //得到cookie字符串中的名称 var len = start + name.length + 1; //得到从起始位置到结束cookie位置的长度 //如果起始没有值且name不存在于cookie字符串中,则返回null if ((!start) && (name != document.cookie.substring(0, name.length))) { return null; } if (start == -1) return null; //如果起始位置为-1也为null var end = document.cookie.indexOf(';', len); //获取cookie尾部位置 if (end == -1) end = document.cookie.length; //计算cookie尾部长度 return unescape(document.cookie.substring(len, end)); //获取cookie值 } //设置cookie,name为名称,value为值,expires为过期日,path为路径,domain为域名,secure为加密 function setCookie(name, value, expires, path, domain, secure) { var today = new Date(); today.setTime(today.getTime()); if (expires) { expires = expires * 1000 * 60 * 60 * 24; //计算cookie的过期毫秒数 } //计算cookie的过期日期 var expires_date = new Date(today.getTime() + (expires)); //构造并保存cookie字符串 document.cookie = name + '=' + escape(value) + ((expires) ? ';expires=' + expires_date.toGMTString() : '') + //expires.toGMTString() ((path) ? ';path=' + path : '') + ((domain) ? ';domain=' + domain : '') + ((secure) ? ';secure' : ''); } //删除cookie,必须先获取指定名称的cookie,然后让cookie过期 function Cookie(name, path, domain) { if (getCookie(name)) document.cookie = name + '=' + ((path) ? ';path=' + path : '') + ((domain) ? ';domain=' + domain : '') + ';expires=Thu, 01-Jan-1970 00:00:01 GMT'; }