signup.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * 手机端报名弹窗JS
  3. * 调用的时候,只在需要的地方添加上 popup 类就可以了
  4. */
  5. $(function(){
  6. var w_title,w_id,w_text,w_module; //为了这些变量在其它地方用;
  7. /*
  8. * 其它公共报名弹窗
  9. * */
  10. $('.appleBm_popup').on('click',function(){
  11. var $that = $(this);
  12. CreatePopLayerDiv(300,400,'/public/signup');
  13. $('.m_signUp_box').show();
  14. // 向弹窗传数据
  15. parent.w_title = $that.attr('data-title'); //把楼盘名称传向父级
  16. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  17. parent.w_module = $that.attr('data-module'); //模块ID
  18. parent.w_text = $that.attr('data-text'); //窗口文本内容
  19. // var hk = $that.attr('data-hk');
  20. // if(hk == "hk"){
  21. // parent.hk = "hk";
  22. // }
  23. })
  24. /*
  25. * 国内楼盘报名 弹窗
  26. * */
  27. $('.appleBm_popup_ch').on('click',function(){
  28. var $that = $(this);
  29. CreatePopLayerDiv(300,400,'/public/signupch');
  30. $('.m_signUp_box').show();
  31. // 向弹窗传数据
  32. parent.w_title = $that.attr('data-title'); //把楼盘名称传向父级
  33. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  34. parent.w_module = $that.attr('data-module'); //模块ID
  35. parent.w_text = $that.attr('data-text'); //窗口文本内容
  36. // var hk = $that.attr('data-hk');
  37. // if(hk == "hk"){
  38. // parent.hk = "hk";
  39. // }
  40. })
  41. /*
  42. * 新公共报名弹窗 小明
  43. * */
  44. $('.m_appleBm_popup').on('click',function(){
  45. var $that = $(this);
  46. CreatePopLayerDiv(300,400,'/public/signupv2');
  47. $('.m_signUp_box').show();
  48. // 向弹窗传数据
  49. parent.w_title = $that.attr('data-title'); //把楼盘名称传向父级
  50. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  51. parent.w_module = $that.attr('data-module'); //模块ID
  52. parent.w_text = $that.attr('data-text'); //窗口文本内容
  53. parent.w_button = $that.attr('data-button');
  54. })
  55. /*
  56. * 新公共报名弹窗 小明
  57. * */
  58. $('.xm_appleBm_popup').on('click',function(){
  59. var $that = $(this);
  60. CreatePopLayerDiv(300,400,'/public/signupv3');
  61. $('.m_signUp_box').show();
  62. // 向弹窗传数据
  63. parent.w_title = $that.attr('data-title'); //把楼盘名称传向父级
  64. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  65. parent.w_module = $that.attr('data-module'); //模块ID
  66. parent.w_text = $that.attr('data-text'); //窗口文本内容
  67. })
  68. /*
  69. * 底部看房定制弹窗
  70. * */
  71. $('.customize_btn').on('click',function(){
  72. var $that = $(this);
  73. var height = $('.m_form').outerHeight();
  74. var width = $('.m_form').outerWidth();
  75. CreatePopLayerDiv(width,width,'/public/customization');
  76. $('.m_signUp_box').show();
  77. $('.m_form').css('margin-top',-height/2 -20);
  78. // 向弹窗传数据
  79. parent.w_title = $that.attr('data-name'); //把楼盘名称传向父级
  80. parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
  81. parent.w_module = $that.attr('data-module'); //模块ID
  82. })
  83. })
  84. //创建一个弹出层,width 宽度,height 高度,url
  85. function CreatePopLayerDiv(width,height,url){
  86. var Iheight=$(window).outerHeight();
  87. var Iwidth =$(window).outerWidth();
  88. var heights = height || 300;
  89. var widths = width || 500;
  90. var Oheight= (Iheight -heights) / 2;
  91. var Owidth = (Iwidth - widths) /2;
  92. var div ='<div id="InDiv" style="width:'+Iwidth+'px;height:'+Iheight+'px;background:rgba(0,0,0,0.6);position:fixed;z-index:10000;top:0;left:0;">';
  93. div+='<div id="Content"></div>';
  94. div+='</div>';
  95. $(document.body).append(div);
  96. if(url != ""){
  97. $("#Content").load(url);
  98. }
  99. }
  100. //移除弹出层
  101. function RemoveDiv(){
  102. $("#InDiv").remove();
  103. }