public.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. $('.bdsharebuttonbox a.bds_more').on('click',function(){
  2. setInterval(function(){
  3. $('.bdshare_dialog_box').hide();
  4. },5);
  5. })
  6. $('.bdsharebuttonbox a.bds_weixin').on('click',function(){
  7. setInterval(function(){
  8. $('.bd_weixin_popup').css({'width':'250px','height':'295px'});
  9. },5);
  10. })
  11. $(function(){
  12. // 导航区域显示 隐藏
  13. function navMouseleave (id,id1){
  14. $(id).on({
  15. mouseover: function() {
  16. $(id1).show();
  17. },
  18. mouseleave: function() {
  19. $(id1).hide();
  20. }
  21. });
  22. }
  23. // 选项卡
  24. function tab (name1,name2,name3){;
  25. $(name1).on('click',function(){
  26. $(name2).hide();
  27. var Idoption = $(this).attr(name3);
  28. $(name2+'['+name3+''+'='+ Idoption +']').show();
  29. $(this).addClass('on').siblings().removeClass('on');
  30. })
  31. $(name1).eq(0).addClass('on');
  32. $(name2).eq(0).show();
  33. }
  34. navMouseleave('.y_dhqy','.y_dhqynone');//导航区域显示 隐藏
  35. tab('#y_lpdtpc_nav1 ul li','ul.y_lpdtpc_pc1','data-id');//楼盘首页楼盘动态
  36. tab('.countR_box ul li','.bus_tab_box','data-id');//楼盘首页 计算结果
  37. });
  38. // 国内外切换
  39. var txt = $('.y_dhqytpo').find('span').text();
  40. // 选中效果
  41. $.each($('.y_dhqynone a'),function(k,v){
  42. var that = $(this);
  43. var title = that.text();
  44. if(title == txt){
  45. that.addClass('on');
  46. }
  47. })
  48. // 点击事件
  49. $('.aera_btn dl dd').on('click',function(){
  50. var that = $(this);
  51. var oid = that.attr('data-id')
  52. that.addClass('on').siblings().removeClass('on');
  53. $('.inl').hide();
  54. $('#'+oid).show();
  55. })
  56. $('.aera_btn dl dd').eq(0).click();
  57. // 搜索页面 单独加载效果
  58. //创建一个弹出层,width 宽度,height 高度,url
  59. function CreatePopLayerDiv(width,height,url){
  60. var Iheight=$(window).height();
  61. var Iwidth =$(window).width();
  62. var heights = height || 300;
  63. var widths = width || 500;
  64. var Oheight= (Iheight -heights) / 2;
  65. var Owidth = (Iwidth - widths) /2;
  66. var div ='<div id="InDiv">';
  67. div+='<div id="offDiv">';
  68. div+='<div id="Content"></div>';
  69. div+='</div>';
  70. div+='</div>';
  71. $(document.body).append(div);
  72. if(url != ""){
  73. $("#Content").load(url);
  74. }
  75. }
  76. //移除弹出层
  77. function RemoveDiv(){
  78. $("#AClose").remove();
  79. $("#HTitle").remove();
  80. $("#offDiv").remove();
  81. $("#InDiv").remove();
  82. }
  83. function btnCloses(){
  84. RemoveDiv();
  85. }
  86. $(function(){
  87. // 报名 获取弹窗
  88. var puicBm_title,puicBm_hid,puicBm_source,puicBm_text,puicBm_buttom; //为了这些变量在其它地方用;
  89. $('body').on('click','.pic_jjtz',function(){
  90. var urlstr = window.location.href;
  91. var searchurl = urlstr.substring(0,urlstr.indexOf('?')+1);
  92. // var matchdata = urlstr.match(/\.com(\/\w+)/)[1];
  93. var $that = $(this);
  94. CreatePopLayerDiv(560,362,"/public/reduced"); //添加加载页面
  95. parent.puicBm_title = $that.attr('data-title');//报名弹窗标题
  96. parent.puicBm_hid = $that.attr('data-hid');//报名楼盘id
  97. parent.puicBm_source = $that.attr('data-source');//报名来源ID
  98. parent.puicBm_text = $that.attr('data-text');//报名弹窗text
  99. parent.puicBm_buttom = $that.attr('data-buttom');//报名弹窗-buttom -text
  100. });
  101. //楼盘首页 楼盘列表 >> 查看地图
  102. $('a.y_idckdt').on('click',function(){
  103. var lpjwd=$(this).attr('data-jwd');
  104. var lptitle=$(this).attr('data-title');
  105. var _pointx = lpjwd.split(',')[0];
  106. var _pointy = lpjwd.split(',')[1];
  107. if (lpjwd !=='') {
  108. window.open('/map/details#lat='+_pointy+'&lng='+_pointx+'&zoom=13&title='+lptitle+'');
  109. }else{
  110. /*调用方法*/
  111. var M = {};
  112. if(M.dialog1){
  113. return M.dialog1.show();
  114. }
  115. M.dialog1 = jqueryAlert({
  116. 'content' : '暂无相关经纬度数据',
  117. 'closeTime' : 2000,
  118. })
  119. $than.removeAttr('disabled');
  120. ControlSwitch = false; //开关为false
  121. return false;
  122. };
  123. })
  124. // 侧边栏
  125. $(window).scroll(function (){
  126. var st = $(this).scrollTop();
  127. if(st >450){
  128. $('.js_yv2_rightXg').fadeIn();
  129. }else{
  130. $('.js_yv2_rightXg').fadeOut();
  131. }
  132. });
  133. // 返顶
  134. $(".js_returnTop").on('click',function(){
  135. $("html,body").animate({scrollTop:0},300);
  136. })
  137. })
  138. // 处理资讯详情页面的底部一个月的有效日期
  139. var myDate = new Date;
  140. var year = myDate.getFullYear(); //获取当前时间年份
  141. var yue = myDate.getMonth()+1;//获取当前时间月份
  142. if (yue<10) {
  143. yue= '0' + yue;
  144. }else if(yue == 13){
  145. yue = '01';
  146. };
  147. // 返回下个月有多少天数
  148. function mGetDate(yue){     
  149. var date = new Date();     
  150. var year = date.getFullYear();     
  151. var d = new Date(year,parseInt(yue), 0);
  152. return d.getDate();
  153. }
  154. var htmltime = year + '/'+ yue + '/' +'01'+'-'+ year + '/'+ yue + '/' + mGetDate(yue);
  155. var lpTime = year + '/'+ yue + '/' + mGetDate(yue);
  156. var v3Time = year + '.'+ yue + '.' + mGetDate(yue);
  157. $('.w-commonality').html('(有效期至:'+htmltime+')'); //有效期 调用方法在public.js
  158. $('.w-attention').html('有效期至:'+htmltime); //有效期 2019-10-6 新页面调用方法在public.js
  159. $('body').find('.w-commonality').html('(有效期至:'+lpTime+')'); //有效期 调用方法在public.js
  160. $('body').find('.yv2_puicTime').html('有效期至:'+v3Time); //有效期 调用方法在public.js