123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- $(function(){
- // $("#guna_xiung").scrollFix({startTop:"#startTop",distanceTop:0,endPos:".y_footmzsm"});
-
- // 搜索
- $('.seek_input input[type="button"]').on('click',function(){
- var txt = $('.seek_input input[type="text"]').val();
- // if(txt != ''){
- // fn_ajax({data:txt});
- // }
- if (txt != '') {
- window.location.href = '/house/search?name='+ txt;
- };
-
- })
- $(document).keydown(function(event){
- if(event.keyCode==13){
- $('.seek_input input[type="button"]').click();
- }
- });
- // fn_ajax();
- // function fn_ajax(seek_txt){
- // $.ajax({
- // type: "post",
- // url: "./js/search.json",
- // data:seek_txt,
- // dataType: "json",
- // success: function(data){
- // if(data.code == 200){
- // $('.sum i').html(data.amount);
- // var data = fn_each(data.data);
- // $('.m_lp_list').html("");
- // $('.m_lp_list').append(data);
- // }
- // }
- // });
- // }
- // function fn_each(data){
- // var _li ='';
- // $.each(data,function(k,v){
- // _li += '<li class="c">';
- // _li += '<a href="" class="m_lp_list_img">';
- // _li += '<img src="'+v.imgUrl+'" alt="">';
- // _li += '</a>';
- // _li += '<div class="m_lp_list_r">';
- // _li += '<div class="m_list_title">';
- // _li += '<a href="">'+v.lpname+'</a>';
- // _li += '</div>';
- // _li += '<div class="m_label">';
- // _li += '<img src="./image/lp_eye.png" alt="">';
- // _li += '<i>'+v.reside+'</i>';
- // _li += '<i>建筑面积'+v.area+'</i>';
- // _li += '<i>'+v.time+'</i>';
- // _li += '<i>'+v.finish+'</i>';
- // _li += '<i>'+v.equities+'</i>';
- // _li += '</div>';
- // _li += '<div class="m_list_hx"><img src="./image/lp_site.png" alt="">'+v.describe+'</div>';
- // _li += '<div class="m_list_dz c"><img src="./image/lp_house.png" alt="">'+v.lptype+'</div>';
- // _li += '<div class="m_list_ts c">';
- // _li += '<i>'+v.district+'</i>';
- // _li += '<i>'+v.gross+'</i>';
- // _li += '<i>'+v.stall+'</i>';
- // _li += '</div>';
- // _li += '<div class="about">';
- // _li += '<span>¥<i>'+v.price+'</i> '+v.unit+'</span><br>';
- // _li += '<i>'+v.convert+'</i>';
- // _li += '</div>';
- // _li += '</div>';
- // _li += '</li>';
- // })
- // return _li;
- //
- // }
- // 排序列
- $('.m_sort ul li').on('click',function(){
- $(this).addClass('m_sortspan').siblings().removeClass('m_sortspan');
- var oid = $(this).attr("data-id");
- // console.log(oid);
- fn_ajax({id:oid});
- })
- // 筛选
- // var deposit = {area:"0",type:"0",feature:"0",budget:"0",room:"0"};
- // $('.m_nav_qy').on('click','a',function(){
- // var oid = $(this).attr('data-id');
- // var type = $(this).parents('.m_nav_qy').attr('data-type');
- // $(this).parents('.m_nav_qy').find('a').removeClass('s_on');
- // $(this).addClass('s_on');
- //
- // switch(type)
- // {
- // case 'area':
- // deposit.area = oid;
- // break;
- // case 'type':
- // deposit.type =oid;
- // break;
- // case 'feature':
- // deposit.feature =oid;
- // break;
- // case 'budget':
- // deposit.budget =oid;
- // break;
- // case 'room':
- // deposit.room =oid;
- // break;
- // }
- //
- // fn_ajax(deposit);
- // })
- // 国家显示城市
- // $('.m_nav_qy').on('click','a[name="city"]',function(){
- // var pid = $(this).attr('data-id');
- // if(pid == 0){
- // $('.m_nav_qy_list_City p').html("");
- // $('.m_nav_qy_list_City p').hide();
- // }else{
- // $('.m_nav_qy_list_City p').show();
- // $.ajax({
- // type: "post",
- // url: "./js/city.json",
- // data:{id:pid},
- // dataType: "json",
- // success: function(data){
- // if(data.code == 200){
- // var _a = "";
- // $.each(data.data,function(k,v){
- // _a +='<a href="javascript:void(0);" data-id="'+v.id+'">'+v.name+'</a>';
- // })
- // $('.m_nav_qy_list_City p').html(_a);
- // }
- // }
- // });
- // }
- //
- // })
- /*-------------------- 获取地址栏地址并拆分 --------------------------------*/
- function getParams(url) {
- var theRequest = new Object();
- if (!url)
- url = location.href;
- if (url.indexOf("?") !== -1)
- {
- var str = url.substr(url.indexOf("?") + 1) + "&";
- var strs = str.split("&");
- for (var i = 0; i < strs.length - 1; i++)
- {
- var key = strs[i].substring(0, strs[i].indexOf("="));
- var val = strs[i].substring(strs[i].indexOf("=") + 1);
- theRequest[key] = val;
- }
- }
- return theRequest;
- }
- var objUrl = {}; //获取get参数
- var url = window.location.href;
- var params = getParams(url);
- if(!$.isEmptyObject(params)){
- $.each(params,function(key,val){
- objUrl[key] = val;
- })
- }
- /*区域 价格 户型 特效 筛选*/
- $('.feng_search_click').on('click','a',function () {
- var ParamsArr = ['city','y','sub','p','l','py'];
- var _this = $(this);
- var atrName = _this.attr('name');
- var _val = _this.attr('data-id');
- var urlParams = '';
- if(atrName == 'city'){
- objUrl['py'] = _this.attr('pinyin');
- }
- for (var k in ParamsArr){
- if(ParamsArr[k] == atrName){
- objUrl[atrName] = _val;
- delete objUrl.page;
- delete objUrl.name;
- delete objUrl.did;
- }
- }
- $.each(objUrl,function(key,val){
- if(key == 'py') return true; //跳出当前循环
- urlParams += key+'='+val+'&';
- })
- var cityUrl = '';
- urlParams = urlParams.substring(0,urlParams.length - 1);
- if(typeof objUrl.py == 'string'){
- cityUrl = 'py='+objUrl.py+'&';
- }
- if(urlParams == '' && cityUrl != '')
- {
- cityUrl = cityUrl.substring(0,cityUrl.length - 1);
- }
- window.location.href = '/house/search?'+ cityUrl+urlParams;
- // var ParamsArr = ['city','y','sub','p','l'];
- //
- // var _this = $(this);
- // var atrName = _this.attr('name');
- // var _val = _this.attr('data-id');
- // var urlParams = '';
- // for (var k in ParamsArr){
- // if(ParamsArr[k] == atrName){
- // objUrl[atrName] = _val;
- // delete objUrl.page;
- // delete objUrl.name;
- // }
- // }
- //
- // $.each(objUrl,function(key,val){
- // urlParams += key+'='+val+'&';
- // })
- //
- // urlParams = urlParams.substring(0,urlParams.length - 1);
- // window.location.href = '/house/search?'+ urlParams;
- })
- /*区域 价格 户型 特效 筛选 选中状态*/
- $.each($('.feng_search_click').find('a'),function(){
- var each_name = $(this).attr('name');
- var each_val = $(this).attr('data-id');
- if(each_val == objUrl[each_name]){
- $('a[name='+each_name+'][data-id="0"]').attr('class','');
- $(this).attr('class','s_on');
- }
- })
- //报名验证提交的调用
- PublicAction.AjaxSend({CORID:'app_buttom'/*操作ID*/});
- $('.advbox_apply').on('click',function(){
- // var hid=$(this).attr('data-hid');
- // $('.applekf_form input[name="hid"]').val(hid)
- group();
- })
- $('.applbox_gb').on('click',function(){
- delbox();
- })
- $('.submit_area .apply_submit').on('click',function(){
- setTimeout(function(){
- var _html = $('.alert-container .alert-content').html();
- if(_html == '提交成功'){
- delbox();
- $('.ipnt_box').val('');
- }
- console.log(_html);
- },300)
-
- })
- })
- function group(){
- iBoxWidth = $(".applbox").width();
- iBoxHeight = $(".applbox").height();
- iWinWidth = $(window).width();
- iWinHeight = $(window).height();
- $(".applbox").css("left", (iWinWidth / 2 - iBoxWidth / 2) + "px");
- $(".applbox").animate({"top":((iWinHeight / 2 - iBoxHeight / 2)-50) + "px"},500);
- $(".applbox_bg").height(document.body.offsetHeight);
- $(".applbox_bg").show();
- }
- function delbox(){
- $(".applbox").css({"top":"-100%"});
- $(".applbox_bg").hide();
- }
|