index.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. // <!-- 双十一专题 -->
  2. $('.m_jpzpt_gb').on('click',function(){
  3. $('.m_jpzpt_box').hide();
  4. })
  5. $('.m_jpzpt_zhez').on('click',function(){
  6. $('.m_jpzpt_box').hide();
  7. })
  8. // 2020.01.03 添加新年标签 弹窗
  9. $(function(){
  10. // setTimeout(function(){
  11. // xiannian_s()
  12. // setTimeout(function(){
  13. // xiannian_h();
  14. // },7000);
  15. // },2000);
  16. $('.xiannian_ico_gb a,.xiannian_ico_bg').on('click',function(){
  17. xiannian_h();
  18. })
  19. function xiannian_s(){
  20. $('.xiannian_ico').show(10);
  21. $('.xiannian_ico_bg').show();
  22. }
  23. function xiannian_h(){
  24. $('.left_xiannain').show(10)
  25. $('.xiannian_ico_bg').hide();
  26. $('.xiannian_ico').hide();
  27. }
  28. /*
  29. * 调用的方法
  30. * */
  31. PublicAction.AjaxSend(
  32. {
  33. CORID:'m_inlet_submien', /*操作ID*/
  34. }
  35. );
  36. })
  37. // 头部轮播
  38. jQuery(".m_Broadcast").slide({mainCell:".bd ul",effect:"fold",autoPlay:true,trigger:"click",delayTime:1000,interTime:4000});
  39. jQuery(".m_Broadcast .bd").hover(function(){ jQuery(this).find(".prev,.next").stop(true,true).fadeTo("show",1) },function(){ jQuery(this).find(".prev,.next").fadeOut() });
  40. $(function(){
  41. // 精选房源
  42. // var inID=0;
  43. // var length=$('.lp_title_r_maui a').length;
  44. // var i=1;
  45. // var oid=0;
  46. // var widh=$('.lp_title_r_maui a').innerWidth()
  47. // $('.lp_title_r_maui').width(((widh*$('.lp_title_r_maui a').length)+100)+'px')
  48. // if (length>6) {
  49. // $('.lp_title_r a.m_PgDn').show()
  50. // };
  51. // //关键函数:通过控制i ,来显示图片
  52. // function showImg(i){
  53. // $('.lp_title_r_maui a').eq(i).addClass("on").siblings().removeClass("on");
  54. // oid=$('.lp_title_r_maui a').eq(i).attr('data-id')
  55. // fn_ajax(oid)
  56. // }
  57. // function slideNext(){
  58. // if(inID >= 0 && inID < length-1) {
  59. // ++inID;
  60. // showImg(inID);
  61. // $('.lp_title_r a.m_pgUp').show()
  62. // }else{
  63. // showImg(0);
  64. // inID=0;
  65. // aniPx=(length-6)*100+'px';
  66. // $(".lp_title_r_maui").animate({ "left": "+="+aniPx },200);
  67. // $('.lp_title_r a.m_pgUp').hide()
  68. // i=1;
  69. // return false;
  70. // }
  71. // if(i<0 || i>length-6) {return false;}
  72. // $(".lp_title_r_maui").animate({ "left": "-=100px" },200)
  73. // i++;
  74. // }
  75. // function slideFront(){
  76. // if(inID >= 1 ) {
  77. // --inID;
  78. // showImg(inID);
  79. // }
  80. // if (inID==0) {
  81. // $('.lp_title_r a.m_pgUp').hide()
  82. // };
  83. // if(i<2 || i>length+6) {return false;}
  84. // $(".lp_title_r_maui").animate({ "left": "+=100px" },200)
  85. // i--;
  86. // }
  87. // $('.lp_title_r_maui a').eq(0).addClass("on");
  88. // $('.lp_title_r_maui a').click(function(){
  89. // inID = $('.lp_title_r_maui a').index(this);
  90. // showImg(inID);
  91. // });
  92. // $('.lp_title_r a.m_PgDn').click(function(){
  93. // slideNext();
  94. // })
  95. // $('.lp_title_r a.m_pgUp').click(function(){
  96. // slideFront();
  97. // })
  98. $('.lp_title_r_maui a').click(function(){
  99. var oid = $(this).attr('data-id');
  100. $(this).attr('class','on').siblings().attr('class','');
  101. fn_ajax(oid);
  102. });
  103. function fn_ajax(object){
  104. $.ajax({
  105. type: "post",
  106. url: "/index/choicehouse",
  107. data: {id:object,csrf_token_f:csrfToken},
  108. dataType: "json",
  109. success: function(data){
  110. $('.lp_conter').html('');
  111. if(data.code == 200){
  112. var data = fn_each(data.data);
  113. $('.lp_conter').html('<ul>'+data+'</ul>')
  114. }
  115. }
  116. });
  117. }
  118. fn_ajax(0); //默认请求一次数据
  119. function fn_each(data){
  120. var _html="";
  121. $.each(data,function(k,v){
  122. _html += '<li>';
  123. _html += '<div class="lp_conter_img">';
  124. _html += '<a href="/house/'+v.id+'" target="_blank">';
  125. _html += '<img src="'+v.thumb+'" alt="">';
  126. _html += '<p style="display:none;" class="xn_ico"><img src="/image/xn_ico12.png" alt="" /></p>';
  127. _html += '<p style="display:none;" class="pintuan"><img src="/image/pcico1.png" alt="" /><span>拼团购立减¥20000</span><img src="/image/pcico2.png" alt="" /><span>每月20日出团</span></p>';
  128. _html += '<div class="lp_conter_price"><span>约</span>'+v.price+'<span></span><p style="font-size:12px; color:#ccc;margin-top:3px;font-weight: 100;">(有效期:'+time_yxq+')</p></div>';
  129. _html += '</a>';
  130. _html += '</div>';
  131. _html += '<div class="lp_font">';
  132. _html += '<p><a target="_blank" href="/house/'+v.id+'" title="'+v.name+'">'+v.name+'</a></p>';
  133. _html += '<p title="'+v.city_name+' · '+v.main_units+'">'+v.city_name+' · '+v.main_units+'</p>';
  134. _html += '</div>';
  135. _html += '<div class="lp_info">';
  136. _html += '<div class="lp_info_span c">';
  137. _html += '<span>推荐理由:';
  138. if((v.push_reason).length>35){
  139. _html += (v.push_reason).substr(0,35)+'......';
  140. }else{
  141. _html += v.push_reason;
  142. }
  143. _html += '</span>';
  144. _html += '</div>';
  145. _html += '<p class="c" style="'+style+'">';
  146. if(v.recent_price != 0 && v.recent_price != null){
  147. _html += '<i>近一年房价涨幅'+v.recent_price+'</i>';
  148. }else{
  149. _html += '<i>近一年房价涨幅:暂无</i>';
  150. }
  151. if(v.proportion != 0 && v.proportion != null){
  152. _html += '<i>参考收益:'+v.proportion+'</i>';
  153. }else{
  154. _html += '<i>参考收益:暂无</i>';
  155. }
  156. _html += '<a class="applekf-id" data-module="69" data-button="领取优惠" data-text="免费接机+酒店接送+专车看房,领取优惠,更享有购房立减优惠折扣。" data-type="领取优惠" data-id="0" href="javascript:;"><img src="/image/bmyh.gif" alt=""></a>';
  157. _html += '</p>';
  158. _html += '</div>';
  159. _html += '</li>';
  160. })
  161. return _html;
  162. }
  163. var style = $('.lp_conterdata').attr('style');
  164. });
  165. // 搜索页面 单独加载效果 --报名看房
  166. //创建一个弹出层,width 宽度,height 高度,url
  167. // function CreatePopLayerDiv(width,height,url){
  168. // var Iheight=$(window).height();
  169. // var Iwidth =$(window).width();
  170. // var heights = height || 300;
  171. // var widths = width || 500;
  172. // var Oheight= (Iheight -heights) / 2;
  173. // var Owidth = (Iwidth - widths) /2;
  174. // var div ='<div id="InDiv" style="width:'+Iwidth+'px;height:'+Iheight+'px;background:rgba(0,0,0,0.6);position:fixed;z-index:1000;top:0;left:0;">';
  175. // div+='<div id="offDiv" style="width:'+widths+'px;height:'+heights+'px;left:'+Owidth+'px;position:fixed;z-index:32;border-radius:5px;">';
  176. // div+='<a id="AClose" class="y_close" href="javascript:;" onclick="btnCloses()"><img src="/image/ico_close.png" alt="" /></a>';
  177. // div+='<div id="Content"></div>';
  178. // div+='</div>';
  179. // div+='</div>';
  180. // $(document.body).append(div);
  181. // if(url != ""){
  182. // $("#Content").load(url);
  183. // }
  184. // }
  185. // //移除弹出层
  186. // function RemoveDiv(){
  187. // $("#AClose").remove();
  188. // $("#HTitle").remove();
  189. // $("#offDiv").remove();
  190. // $("#InDiv").remove();
  191. // }
  192. // function btnCloses(){
  193. // RemoveDiv();
  194. // }
  195. // $(function(){
  196. // // //降价通知
  197. // var w_type,w_id,w_title,w_module; //为了这些变量在其它地方用;
  198. // $('body').on('click','.applekf-id',function(){
  199. // var $that = $(this);
  200. // CreatePopLayerDiv(440,442,"/public/applekf"); //添加加载页面
  201. // $('#offDiv').css({'margin-top':'-221px'}).animate({top:'50%'},500);
  202. // parent.w_type = $that.attr('data-type'); //把报名窗口 类型传向父级
  203. // parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  204. // parent.w_module = $that.attr('data-module'); //来源模块ID
  205. // parent.w_title = $that.attr('data-name'); //报名标题
  206. // });
  207. // $('#InDiv').on('click',function(){
  208. // btnCloses();
  209. // })
  210. // })
  211. $(function(){
  212. $('em.timew').html(time_yxq);
  213. })
  214. // 改版------------------------------------------------------------------------------------------------------------------
  215. // 头部轮播
  216. jQuery(".m_lunbov2").slide({mainCell:".bd ul",effect:"fold",autoPlay:true,trigger:"click",delayTime:1000,interTime:4000});
  217. // 精彩推荐
  218. jQuery(".m_video_lb").slide({titCell:".hd ul",mainCell:".bd ul",effect:"left",autoPlay:true,autoPage:"<li><a></a></li>",interTime:4000});
  219. // 开发商
  220. if($('.m_Developerslist ul li').length > 6){
  221. jQuery(".m_Developerslist_box").slide({mainCell:".bd ul",autoPlay:true,effect:"leftMarquee",vis:6,interTime:50,trigger:"click"});
  222. $('.m_Developerslist_box .prev').removeClass('on');
  223. $('.m_Developerslist_box .next').removeClass('on');
  224. }
  225. // 筛选区域
  226. $('.m_Country_list ul li').on('mousemove',function(){
  227. $(this).addClass('on').siblings().removeClass('on');
  228. if(!$(this).hasClass('CountryClick')){
  229. $('.m_CountryRegion_box').hide();
  230. }
  231. })
  232. var _region="";
  233. var _abroad="";
  234. var _py = '';
  235. var being = true;
  236. $('.m_Country_list ul .CountryClick').on('mouseover',function(event){
  237. if(_region != $(this).attr('data-region')){
  238. being = true;
  239. }
  240. $('.m_CountryRegion_box').show();
  241. _region = $(this).attr('data-region');
  242. _py = $(this).attr('data-py');
  243. _abroad = $(this).attr('data-abroad');
  244. if(being == true){
  245. ajax_qy();
  246. being = false;
  247. }
  248. })
  249. $('.m_Country_box').on('mouseleave',function(){
  250. $('.m_CountryRegion_box').hide();
  251. $('.m_Country_list ul li').removeClass('on');
  252. })
  253. function ajax_qy(){
  254. var html = '';
  255. $.ajax({
  256. url: "/index/getpushcity", // 索取
  257. data:{hid:_region}, //传ID
  258. type: "GET",
  259. dataType: "json",
  260. success: function(data) {//请求成功完成后要执行的方法
  261. // console.log(data)
  262. if(data.code == 200){
  263. // console.log(data);
  264. $.each(data.data, function (i, data) {
  265. // html+= '<a href="javascript:void(0)" dataid="'+data.href+'">';
  266. if (data.abroad == 2) {
  267. html+='<li><a target="_blank" href="/house/search?py='+data.pinyin+'&city='+data.city_id+'"><img src="'+data.img+'" alt=""><i>'+data.city_name+'</i></a></li>';
  268. } else {
  269. html+='<li><a target="_blank" href="/housech/search?py='+data.pinyin+'&city='+data.city_id+'"><img src="'+data.img+'" alt=""><i>'+data.city_name+'</i></a></li>';
  270. }
  271. });
  272. if (_abroad == 2) {
  273. html+='<li><a target="_blank" href="/house/search?py='+_py+'&city='+_region+'"><i class="on">更多城市</i></a></li>';
  274. } else {
  275. html+='<li><a target="_blank" href="/housech/search?py='+_py+'&city='+_region+'"><i class="on">更多城市</i></a></li>';
  276. }
  277. }
  278. $('.Popular ul').html(html);
  279. }
  280. });
  281. } // 筛选区域结束
  282. // 导航
  283. $('.m_Navigation ul li').on('mousemove',function(){
  284. $('.m_Navigation_list').hide();
  285. })
  286. $('.m_Navigation ul .Navigation_click').on('mousemove',function(){
  287. $(this).find('.m_Navigation_list').show();
  288. })
  289. $('.m_Navigation').on('mouseleave',function(){
  290. $('.m_Navigation_list').hide();
  291. })
  292. // 头部语言切换
  293. $('.m_HeadMenu ul .m_HeadMenuTop').on('mousemove',function(){
  294. $('.m_qh').hide();
  295. $(this).parent().find('.m_qh').show();
  296. })
  297. $('.m_HeadMenu').on('mouseleave',function(){
  298. $('.m_qh').hide();
  299. })
  300. // 搜索
  301. $('.seek_input p').on('click',function(){
  302. var txt = $('.seek_input input[type="text"]').val();
  303. if (txt != '') {
  304. // window.location.href = '/house/search?name='+ txt;
  305. window.open('/house/search?name='+ txt);
  306. };
  307. })