$(function () { var HcityId=$('.hotlist_nav a').eq(0).attr('data-city') $('.hotlist_nav a').eq(0).addClass('on'); hotList(HcityId); $('.hotlist_nav').on('click','a',function(){ $(this).addClass('on').siblings().removeClass('on') HcityId=$(this).attr('data-city') hotList(HcityId); }) var WcityId=$('.hotwanquBox_nav a').eq(0).attr('data-city') $('.hotwanquBox_nav a').eq(0).addClass('on'); hotwanqu(WcityId); $('.hotwanquBox_nav').on('click','a',function(){ $(this).addClass('on').siblings().removeClass('on') WcityId=$(this).attr('data-city') hotwanqu(WcityId); }) function hotList(id){ var _list=""; $.ajax({ url:"/zt/getprovince", type:"POST", dataType:"json", data:{city:id}, success:function(data){ if(data.code == 200){ $('.hotlist_main ul').html('') $.each(data.data,function(key,val){ // console.log(val) if (key<8) { _list+='
  • '; _list+='
    '; _list+=''; _list+='

    '; _list+='

    TOP'+(key+1)+'

    '; _list+='
    '; _list+='

    '+val['name']+'

    '; _list+='有效期 '+v3Time+''; _list+='
    '; _list+='
    '; _list+='
    '; _list+='
    '; if (val.sale_price!='' && val.sale_price!=null) { _list+='

    均价'+val['sale_price']+''+val['price_unit']+'

    '; }else{ _list+='

    均价待定

    '; } if (val.preferential!='' && val.preferential!=null) { _list+='

    '+val.preferential+'

    '; }else{ _list+='

    暂无优惠

    '; } _list+='
    '; _list+='
    '; _list+='获取底价'; _list+='领取折扣'; _list+='
    '; _list+='
  • '; } }) $('.hotlist_main ul').html(_list) } }, error:function(request){ console.log('加载失败!'); } }) }; function hotwanqu(id){ var _list=""; $.ajax({ url:"/zt/getgulfcitygl", type:"POST", dataType:"json", data:{id:id}, success:function(data){ if(data.code == 200){ $('.hotwanquBox_l ul').html('') $.each(data.data,function(key,val){ if (key<6) { _list+='
  • '; _list+='
    '; _list+=''; _list+='

    '; _list+='有效期 '+v3Time+''; _list+='
    '; _list+='
    '; _list+='
    '; _list+='

    '+val['name']+'

    '; if (val.sale_price!='' && val.sale_price!=null) { _list+='

    均价'+val['sale_price']+''+val['price_unit']+'

    '; }else{ _list+='

    均价待定

    '; } _list+='

    在线咨询

    '; _list+='
    '; _list+='
  • '; }; }) $('.hotwanquBox_l ul').html(_list) } }, error:function(request){ console.log('加载失败!'); } }) }; $('.myscroll').myScroll({ speed: 40, //数值越大,速度越慢 rowHeight: 30 //li的高度 }); $('.js_myscroll').myScroll({ speed: 40, //数值越大,速度越慢 rowHeight: 30 //li的高度 }); var c=1; $('.js_city_main').on('click',function(){ if (c==1) { $('.js_city_main_list').show(20) c=2; }else if (c==2) { $('.js_city_main_list').hide() c=1; } }) $('.js_city_main_list').on('click','a',function(){ $(this).addClass('on').siblings().removeClass('on') var cityName=$(this).text(); $('.js_city_main').find('span').text(cityName) $('.r_form_city input[name="intention_city"]').val(cityName); // console.log(cityName); $('.js_city_main_list').hide() c=1; }) //调用方法二(传对象函数) var fun = { "error" : function(){ PublicAction.hint("提交末成功!"); //编写需要操作的方法 }, "success" : function(){ PublicAction.hint("提交成功!"); //编写需要操作的方法 $('.js_city_main').find('span').text('请选择意向城市') $('.r_form_city input[name="intention_city"]').val(''); $('.r_form input[type="text"]').val(''); } } PublicAction.AjaxSend({CORID:'js_button_bnzf'},fun); var n=1; $('.js_pric_in_text').on('click',function(){ if (n==1) { $('.js_pric_in_list').show(20) n=2; }else if (n==2) { $('.js_pric_in_list').hide() n=1; } }) $('.js_pric_in_list').on('click','a',function(){ $(this).addClass('on').siblings().removeClass('on') var cityName=$(this).text(); $('.js_pric_in_text').find('span').text(cityName) $('.pric_in input[name="budget"]').val(cityName); // console.log(cityName); $('.js_pric_in_list').hide() n=1; }) //调用方法二(传对象函数) var fun = { "error" : function(){ PublicAction.hint("提交末成功!"); //编写需要操作的方法 }, "success" : function(){ PublicAction.hint("提交成功!"); //编写需要操作的方法 $('.js_pric_in_text').find('span').text('请选择意向城市') $('.pric_in input[name="intention_city"]').val(''); $('.adv_bottom_form_t input[type="text"]').val(''); } } PublicAction.AjaxSend({CORID:'js_button_pric'},fun); //调用方法二(传对象函数) var fun = { "error" : function(){ PublicAction.hint("提交末成功!"); //编写需要操作的方法 $('.body input[type="text"]').val(''); }, "success" : function(){ PublicAction.hint("提交成功!"); //编写需要操作的方法 $('.body input[type="text"]').val(''); } } PublicAction.AjaxSend({CORID:'js_pulice_button'},fun); tab ('.js_adv_left a','.js_adv_right ul','data-id') // 选项卡 function tab (name1,name2,name3){; $(name1).on('click',function(){ $(name2).hide(); var Idoption = $(this).attr(name3); $(name2+'['+name3+''+'='+ Idoption +']').show(); $(this).addClass('on').siblings().removeClass('on'); }) $(name1).eq(0).addClass('on'); $(name2).eq(0).show(); } }) $(function(){ $('body').on('click','.js_buttonHn',function(){ var $that = $(this); //添加加载页面 var _type = $that.attr('data-type'); //把报名窗口 类型传向父级 var _hid = $that.attr('data-id'); //把楼盘ID传向父级 var _text = $that.attr('data-text'); //把报名 text文本传向父级 var _module = $that.attr('data-module'); //来源模块ID var _title = $that.attr('data-name'); //报名标题 var _button = $that.attr('data-button'); //提交按钮文案 $('.applekf_title span').html(_type) $('.applekf_title .freehead p.text').html(_text) $('.applekf_form input[name="hid"]').val(_hid) $('.applekf_form input[name="source"]').val(_module) $('.applekf_form a.app_buttom').html(_button) $('.applekf').show(20); $('.applekfBG').show(); }); $('.applekfBG,.applekf_gb a').on('click',function(){ $('.applekf').hide(); $('.applekfBG').hide(); }) //调用方法二(传对象函数) var fun = { "error" : function(){ PublicAction.hint("提交失败"); //编写需要操作的方法 $('.applekfBG').click(); }, "success" : function(){ PublicAction.hint("提交成功!"); //编写需要操作的方法 $('.applekfBG').click(); } } PublicAction.AjaxSend({CORID:'m_app_buttom'},fun); })