details.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * 楼盘预售许可证弹窗
  3. *
  4. */
  5. $(function(){
  6. var lic_id; //为了这些变量在其它地方用;
  7. $('.y_ckysz').on('click',function(){
  8. var $that = $(this);
  9. var height = $('.y_licence').outerHeight();
  10. var width = $('.y_licence').outerWidth();
  11. CreatePopLayerDiv2(width,width,'/public/licence');
  12. $('#offDiv1').css({'top':height+'px'}).animate({top:'20%'})
  13. // 向弹窗传数据
  14. parent.lic_id = $that.attr('data-id'); //把楼盘名称传向父级
  15. })
  16. })
  17. //创建一个弹出层,width 宽度,height 高度,url
  18. function CreatePopLayerDiv2(width,height,url){
  19. var Iheight=$(window).outerHeight();
  20. var Iwidth =$(window).outerWidth();
  21. var heights = height || 300;
  22. var widths = width || 500;
  23. var Oheight= (Iheight -heights) / 2;
  24. var Owidth = (Iwidth - widths) /2;
  25. var div ='<div id="InDiv1" style="width:'+Iwidth+'px;height:'+Iheight+'px;background:rgba(0,0,0,0.6);position:fixed;z-index:10000;top:0;left:0;">';
  26. div+='<div id="offDiv1" style=" width:100%; height:100%; left:0px; top:30%; position:fixed;z-index:100003;">';
  27. div+='<div id="Content1"></div>';
  28. div+='</div>';
  29. div+='</div>';
  30. $(document.body).append(div);
  31. if(url != ""){
  32. $("#Content1").load(url);
  33. }
  34. }
  35. //移除弹出层
  36. function RemoveDiv1(){
  37. $("#InDiv1").remove();
  38. $("#offDiv1").remove();
  39. }
  40. function btnCloses1(){
  41. RemoveDiv1();
  42. }
  43. var page=0;
  44. var limit = 6;
  45. lpindexdetails(page,limit);
  46. $('.w_guess .w_ti a').on('click',function(){
  47. if (page < 6) {
  48. page++;
  49. }else{
  50. page=0;
  51. };
  52. lpindexdetails(page,limit);
  53. })
  54. // 猜你喜欢
  55. function lpindexdetails(page,limit){
  56. var city = $('.swiper-container .hot-house').attr('data-city');
  57. var price = '';
  58. var html = '';
  59. $.ajax({
  60. url: "/house/tall",
  61. data:{city:city,price:price,page:page,limit:limit},
  62. type: "POST",
  63. dataType: "json",
  64. success: function(data) {//请求成功完成后要执行的方法
  65. if (data.code == 200) {
  66. $.each(data.data, function (i, data) {
  67. var randomX = 300;
  68. var randomY = 800;
  69. var randvalue = parseInt(Math.random() * (randomX - randomY + 1) + randomY);
  70. html+= '<div class="swiper-slide" data-swiper-autoplay="3300">';
  71. html+= '<a href="/house/'+data.id+'/" alt="">';
  72. html+= '<div class="h_img">';
  73. html+= '<img src="'+ data.thumb +'/same" alt="">';
  74. html+= '</div>';
  75. html+= '<p class="h_name">'+data.name+'</p>';
  76. if(data.sale_price != "" && data.sale_price != 0 && data.sale_price != null){
  77. html+= '<p class="h_p"><span>'+ data.sale_price +'<i>'+data.price_unit+'</i></span><em>'+data.city_name+'</em></p>';
  78. }else{
  79. html+= '<p class="h_p"><span>待定</span><em>'+data.city_name+'</em></p>';
  80. }
  81. html+= '</a>';
  82. html+= '<p>有效日期:2018/12/01-2019/02/01</p>';
  83. html+= '</div> ';
  84. });
  85. $('.swiper-container .hot-house').html(html);
  86. var mySwiper1= new Swiper("#yw_swiper",{
  87. loop : true,
  88. autoplay:5000,
  89. slidesPerView :2.1,
  90. slidesPerGroup : 1,
  91. });
  92. }
  93. }
  94. });
  95. }
  96. var _dataid = $('.m_hq li.cur').attr('dataid');
  97. //demo示例六 通过id调取 底部菜单插件
  98. $('#mdemo06').navbarscroll({
  99. defaultSelect:_dataid,
  100. scrollerWidth:6,
  101. fingerClick:1,
  102. endClickScroll:function(obj){
  103. // console.log(obj.text())
  104. }
  105. });