// 公共js $(function(){ //地区设置初始化 del_childs_region(1); set_childs_info(3,3); $('#add_hotel_region select.region').live('change',function(event){ //alert('kkk22'); //删除子菜单 var level = parseInt($(this).attr('level') ); level++; del_childs_region( level); level--; //添加下一级菜单 if( $(this).val() > 0 ){ set_childs_info($(this).val() , level); } }); }); // -地区设置----删除子菜单 function del_childs_region(plevel){ if ( typeof( $('#add_hotel_region select.region[level="'+plevel+'"]').html() ) != 'undefined') { $('#add_hotel_region select.region[level="'+plevel+'"]').remove(); plevel++ ; del_childs_region ( plevel); }else{ return null; } } // -地区设置----加下一级菜单 function set_childs_info(parentId , plevel){ //如果已经存在就不加 plevel++; if( typeof( $('#add_hotel_region select.region[level="'+plevel+'"]').html() ) != 'undefined' ){ return false; } var url='web/index.php?s=home/region/getchilds'; $.post(url,{'parentId':parentId},function(data){ if(data.boolean){ var res= eval(data.data); var level=0; for( var k in res){ level= res[k]['regionType']; break; } //如果已经存在就不加 if( typeof( $('#add_hotel_region select.region[level="'+level+'"]').html() ) != 'undefined' ){ return false; } var select_str=''; if(level == 3){//省 select_str+='  省  '; }else if(level == 4){//市 $('#add_hotel_region span.level_4').remove(); select_str+='  市'; } $('#add_hotel_region') .append(select_str); }else{ plevel--; var regionId =$('#add_hotel_region select.region[level="'+plevel+'"]').val(); $('#add_hotel_region input[name="addressId"]').val(regionId); //alert(data.msg); } }); } function apply(){ $.ajax({ type:'post', url:"web/index.php?s=home/apply/apply", dataType:"json", data: $("#liuyan").serialize(), success:function(data){ if(data.statu=="success"){ alert(data.content); window.location.reload(true); }else{ alert(data.content); } } }); } function supplier(){ $.ajax({ type:'post', url:"web/index.php?s=home/supplier/index", dataType:"json", data: $("#liuyan").serialize(), success:function(data){ if(data.statu=="success"){ alert(data.content); window.location.reload(true); }else{ alert(data.content); } } }); } function support(){ $.ajax({ type:'post', url:"web/index.php?s=home/support/index", dataType:"json", data: $("#liuyan").serialize(), success:function(data){ if(data.statu=="success"){ alert(data.content); window.location.reload(true); }else{ alert(data.content); } } }); } function resource(){ $.ajax({ type:'post', url:"web/index.php?s=home/cooperate/index", dataType:"json", data: $("#liuyan").serialize(), success:function(data){ if(data.statu=="success"){ alert(data.content); window.location.reload(true); }else{ alert(data.content); } } }); } function customized(){ $.ajax({ type:'post', url:"web/index.php?s=home/project/index", dataType:"json", data: $("#liuyan").serialize(), success:function(data){ if(data.statu=="success"){ alert(data.content); window.location.reload(true); }else{ alert(data.content); } } }); } function job(){ $.ajax({ type:'post', url:"web/index.php?s=home/job/index", dataType:"json", data: $("#liuyan").serialize(), success:function(data){ if(data.statu=="success"){ alert(data.content); window.location.reload(true); }else{ alert(data.content); } } }); } function about(){ $.ajax({ type:'post', url:"web/index.php?s=home/introduce/index", dataType:"json", data: $("#liuyan").serialize(), success:function(data){ if(data.statu=="success"){ // alert(data); alert(data.content); window.location.reload(true); }else{ alert(data.content); } } }); } function tour(){ $.ajax({ type:'post', url:"web/index.php?s=home/tour/index", dataType:"json", data: $("#liuyan").serialize(), success:function(data){ if(data.statu=="success"){ // alert(data); alert(data.content); window.location.reload(true); }else{ alert(data.content); } } }); }