style.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. $(function () {
  2. var HcityId=$('.hotlist_nav a').eq(0).attr('data-city')
  3. $('.hotlist_nav a').eq(0).addClass('on');
  4. hotList(HcityId);
  5. $('.hotlist_nav').on('click','a',function(){
  6. $(this).addClass('on').siblings().removeClass('on')
  7. HcityId=$(this).attr('data-city')
  8. hotList(HcityId);
  9. })
  10. var WcityId=$('.hotwanquBox_nav a').eq(0).attr('data-city')
  11. $('.hotwanquBox_nav a').eq(0).addClass('on');
  12. hotwanqu(WcityId);
  13. $('.hotwanquBox_nav').on('click','a',function(){
  14. $(this).addClass('on').siblings().removeClass('on')
  15. WcityId=$(this).attr('data-city')
  16. hotwanqu(WcityId);
  17. })
  18. function hotList(id){
  19. var _list="";
  20. $.ajax({
  21. url:"/zt/getprovince",
  22. type:"POST",
  23. dataType:"json",
  24. data:{city:id},
  25. success:function(data){
  26. if(data.code == 200){
  27. $('.hotlist_main ul').html('')
  28. $.each(data.data,function(key,val){
  29. // console.log(val)
  30. if (key<8) {
  31. _list+='<li>';
  32. _list+='<div class="top_img">';
  33. _list+='<a href="/house/'+val['id']+'">';
  34. _list+='<p class="lpimg"><img src="'+val['thumb']+'" alt=""></p>';
  35. _list+='<p class="top">TOP'+(key+1)+'</p>';
  36. _list+='<div class="title_lp">';
  37. _list+='<p>'+val['name']+'</p>';
  38. _list+='<span><img src="/overseas/zt/hnbszt20200701/image/ico_m11.png" alt="">有效期 '+v3Time+'</span>';
  39. _list+='</div>';
  40. _list+='</a>';
  41. _list+='</div>';
  42. _list+='<div class="center_m">';
  43. if (val.sale_price!='' && val.sale_price!=null) {
  44. _list+='<p class="pric">均价<span>'+val['sale_price']+'</span>'+val['price_unit']+'</p>';
  45. }else{
  46. _list+='<p class="pric">均价<span>待定</span></p>';
  47. }
  48. if (val.preferential!='' && val.preferential!=null) {
  49. _list+='<p class="zk" title="'+val.preferential+'"><img src="/overseas/zt/hnbszt20200701/image/ico_m12.png" alt=""><span>'+val.preferential+'</span></p>';
  50. }else{
  51. _list+='<p class="zk"><img src="/overseas/zt/hnbszt20200701/image/ico_m12.png" alt=""><span>暂无优惠</span></p>';
  52. }
  53. _list+='</div>';
  54. _list+='<div class="bum_bm">';
  55. _list+='<a class="hq js_buttonHn" data-module="103" data-button="立即获取" data-text="获取项目新底价+项目详细资料+投资分析+升值空间评测,为您投资置业保驾护航" data-type="获取底价" data-id="'+val['id']+'" href="javascript:;"><img src="/overseas/zt/hnbszt20200701/image/ico_m13.png" alt="">获取底价</a>';
  56. _list+='<a class="lq js_buttonHn" data-module="104" data-button="立即领取" data-text="领取项目折扣+免费接机+酒店接送+专车看房,领取优惠,更享有购房立减优惠折扣" data-type="领取折扣" data-id="'+val['id']+'" href="javascript:;"><img src="/overseas/zt/hnbszt20200701/image/ico_m14.png" alt="">领取折扣</a>';
  57. _list+='</div>';
  58. _list+='</li>';
  59. }
  60. })
  61. $('.hotlist_main ul').html(_list)
  62. }
  63. },
  64. error:function(request){
  65. console.log('加载失败!');
  66. }
  67. })
  68. };
  69. function hotwanqu(id){
  70. var _list="";
  71. $.ajax({
  72. url:"/zt/getgulfcitygl",
  73. type:"POST",
  74. dataType:"json",
  75. data:{id:id},
  76. success:function(data){
  77. if(data.code == 200){
  78. $('.hotwanquBox_l ul').html('')
  79. $.each(data.data,function(key,val){
  80. if (key<6) {
  81. _list+='<li>';
  82. _list+='<div class="top_ico">';
  83. _list+='<a href="/house/'+val['hid']+'">';
  84. _list+='<p><img src="'+val['thumb']+'" alt=""></p>';
  85. _list+='<span><img src="/overseas/zt/hnbszt20200701/image/ico_m11.png" alt="">有效期 '+v3Time+'</span>';
  86. _list+='</a>';
  87. _list+='</div>';
  88. _list+='<div class="bottom_text">';
  89. _list+='<p class="title"><a href="">'+val['name']+'</a></p>';
  90. if (val.sale_price!='' && val.sale_price!=null) {
  91. _list+='<p class="pric">均价<span>'+val['sale_price']+'</span>'+val['price_unit']+'</p>';
  92. }else{
  93. _list+='<p class="pric">均价<span>待定</span></p>';
  94. }
  95. _list+='<p class="zxzx"><a onclick="$53click()" href="javascript:;">在线咨询</a></p>';
  96. _list+='</div>';
  97. _list+='</li>';
  98. };
  99. })
  100. $('.hotwanquBox_l ul').html(_list)
  101. }
  102. },
  103. error:function(request){
  104. console.log('加载失败!');
  105. }
  106. })
  107. };
  108. $('.myscroll').myScroll({
  109. speed: 40, //数值越大,速度越慢
  110. rowHeight: 30 //li的高度
  111. });
  112. $('.js_myscroll').myScroll({
  113. speed: 40, //数值越大,速度越慢
  114. rowHeight: 30 //li的高度
  115. });
  116. var c=1;
  117. $('.js_city_main').on('click',function(){
  118. if (c==1) {
  119. $('.js_city_main_list').show(20)
  120. c=2;
  121. }else if (c==2) {
  122. $('.js_city_main_list').hide()
  123. c=1;
  124. }
  125. })
  126. $('.js_city_main_list').on('click','a',function(){
  127. $(this).addClass('on').siblings().removeClass('on')
  128. var cityName=$(this).text();
  129. $('.js_city_main').find('span').text(cityName)
  130. $('.r_form_city input[name="intention_city"]').val(cityName);
  131. // console.log(cityName);
  132. $('.js_city_main_list').hide()
  133. c=1;
  134. })
  135. //调用方法二(传对象函数)
  136. var fun = {
  137. "error" : function(){
  138. PublicAction.hint("提交末成功!"); //编写需要操作的方法
  139. },
  140. "success" : function(){
  141. PublicAction.hint("提交成功!"); //编写需要操作的方法
  142. $('.js_city_main').find('span').text('请选择意向城市')
  143. $('.r_form_city input[name="intention_city"]').val('');
  144. $('.r_form input[type="text"]').val('');
  145. }
  146. }
  147. PublicAction.AjaxSend({CORID:'js_button_bnzf'},fun);
  148. var n=1;
  149. $('.js_pric_in_text').on('click',function(){
  150. if (n==1) {
  151. $('.js_pric_in_list').show(20)
  152. n=2;
  153. }else if (n==2) {
  154. $('.js_pric_in_list').hide()
  155. n=1;
  156. }
  157. })
  158. $('.js_pric_in_list').on('click','a',function(){
  159. $(this).addClass('on').siblings().removeClass('on')
  160. var cityName=$(this).text();
  161. $('.js_pric_in_text').find('span').text(cityName)
  162. $('.pric_in input[name="budget"]').val(cityName);
  163. // console.log(cityName);
  164. $('.js_pric_in_list').hide()
  165. n=1;
  166. })
  167. //调用方法二(传对象函数)
  168. var fun = {
  169. "error" : function(){
  170. PublicAction.hint("提交末成功!"); //编写需要操作的方法
  171. },
  172. "success" : function(){
  173. PublicAction.hint("提交成功!"); //编写需要操作的方法
  174. $('.js_pric_in_text').find('span').text('请选择意向城市')
  175. $('.pric_in input[name="intention_city"]').val('');
  176. $('.adv_bottom_form_t input[type="text"]').val('');
  177. }
  178. }
  179. PublicAction.AjaxSend({CORID:'js_button_pric'},fun);
  180. //调用方法二(传对象函数)
  181. var fun = {
  182. "error" : function(){
  183. PublicAction.hint("提交末成功!"); //编写需要操作的方法
  184. $('.body input[type="text"]').val('');
  185. },
  186. "success" : function(){
  187. PublicAction.hint("提交成功!"); //编写需要操作的方法
  188. $('.body input[type="text"]').val('');
  189. }
  190. }
  191. PublicAction.AjaxSend({CORID:'js_pulice_button'},fun);
  192. tab ('.js_adv_left a','.js_adv_right ul','data-id')
  193. // 选项卡
  194. function tab (name1,name2,name3){;
  195. $(name1).on('click',function(){
  196. $(name2).hide();
  197. var Idoption = $(this).attr(name3);
  198. $(name2+'['+name3+''+'='+ Idoption +']').show();
  199. $(this).addClass('on').siblings().removeClass('on');
  200. })
  201. $(name1).eq(0).addClass('on');
  202. $(name2).eq(0).show();
  203. }
  204. })
  205. $(function(){
  206. $('body').on('click','.js_buttonHn',function(){
  207. var $that = $(this); //添加加载页面
  208. var _type = $that.attr('data-type'); //把报名窗口 类型传向父级
  209. var _hid = $that.attr('data-id'); //把楼盘ID传向父级
  210. var _text = $that.attr('data-text'); //把报名 text文本传向父级
  211. var _module = $that.attr('data-module'); //来源模块ID
  212. var _title = $that.attr('data-name'); //报名标题
  213. var _button = $that.attr('data-button'); //提交按钮文案
  214. $('.applekf_title span').html(_type)
  215. $('.applekf_title .freehead p.text').html(_text)
  216. $('.applekf_form input[name="hid"]').val(_hid)
  217. $('.applekf_form input[name="source"]').val(_module)
  218. $('.applekf_form a.app_buttom').html(_button)
  219. $('.applekf').show(20);
  220. $('.applekfBG').show();
  221. });
  222. $('.applekfBG,.applekf_gb a').on('click',function(){
  223. $('.applekf').hide();
  224. $('.applekfBG').hide();
  225. })
  226. //调用方法二(传对象函数)
  227. var fun = {
  228. "error" : function(){
  229. PublicAction.hint("提交失败"); //编写需要操作的方法
  230. $('.applekfBG').click();
  231. },
  232. "success" : function(){
  233. PublicAction.hint("提交成功!"); //编写需要操作的方法
  234. $('.applekfBG').click();
  235. }
  236. }
  237. PublicAction.AjaxSend({CORID:'m_app_buttom'},fun);
  238. })