123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364 |
- $(function(){
- $('#demo07').navbarscroll({
- defaultSelect: 0 , //默认选中
- scrollerWidth:4,
- fingerClick:1,
- endClickScroll:function(obj){
- // console.log(obj[0].dataset.name)
- // console.log(obj[0].attributes.value.value)
- // console.log(obj[0].attributes.hid.value)
- cityID = obj[0].attributes.value.value;
- // console.log(cityID)
- ajax_lp(cityID)
- }
- });
- $('#demo08').navbarscroll({
- defaultSelect: 0 , //默认选中
- scrollerWidth:4,
- fingerClick:1,
- endClickScroll:function(obj){
- // console.log(obj[0].dataset.name)
- // console.log(obj[0].attributes.value.value)
- // console.log(obj[0].attributes.hid.value)
- cityID = obj[0].attributes.value.value;
- // console.log(cityID)
- wanquHotBox (cityID)
- }
- });
- $('.Boutique_nav a').eq(0).addClass('on').siblings().removeClass('on');
- var typeId=$('.Boutique_nav a').eq(0).attr('data-id');
- adv_list (typeId);
- $('.Boutique_nav a').on('click',function(){
- $(this).addClass('on').siblings().removeClass('on');
- typeId=$(this).attr('data-id');
-
- adv_list (typeId);
- })
- $('.bmrs_list_cen').myScroll({
- speed: 40, //数值越大,速度越慢
- rowHeight: 25 //li的高度
- });
- setTimeout(function(){
- var mySwiperadv = new Swiper(".js_service_main",{
- loop : true,
- slidesPerView : 'auto',
- slidesPerGroup : 1,
- onSetTranslate: function(swiper,translate){
- // console.log(translate);
- //自定义事件
- if(swiper.translate >= 0) {
- var TR=swiper.translate
- $("#js_service_main ul").css({
- 'transform': 'translate3d('+(TR-55)+'px, 0px, 0px)'
- })
- }
- },
- });
- },800)
- tab ('.subnews_nav a','.subnews_list ul','data-id')
-
- var n=1;
- $('.js_top_m').on('click',function(){
- if (n==1) {
- $('.js_pric_list').show(20)
- n=2;
- }else if (n==2) {
- $('.js_pric_list').hide()
- n=1;
- }
- })
- $('.js_pric_list').on('click','a',function(){
- $(this).addClass('on').siblings().removeClass('on')
- var cityName=$(this).text();
- $('.js_top_m').find('span').text(cityName)
- $('.js_pric_c input[name="budget"]').val(cityName);
- // console.log(cityName);
- $('.js_pric_list').hide()
- n=1;
- })
- var c=1;
- $('.js_top_c').on('click',function(){
- if (c==1) {
- $('.js_citybm_list').show(20)
- c=2;
- }else if (c==2) {
- $('.js_citybm_list').hide()
- c=1;
- }
- })
- $('.js_citybm_list').on('click','a',function(){
- $(this).addClass('on').siblings().removeClass('on')
- var cityName=$(this).text();
- $('.js_top_c').find('span').text(cityName)
- $('.js_pric_c input[name="intention_city"]').val(cityName);
- // console.log(cityName);
- $('.js_citybm_list').hide()
- c=1;
- })
- $('.js_bangnizgf').on('click',function(){
- $('.bmzgBox').show(20)
- $('.bmzgBox_bg').show()
- $('body').addClass('bodyC');
- })
- $('.bmzgBox_bg').on('click',function(){
- $('.bmzgBox').hide(0)
- $('.bmzgBox_bg').hide(0)
- $('body').removeClass('bodyC');
- })
- //调用方法二(传对象函数)
- var fun = {
- "error" : function(){
- PublicAction.hint("提交末成功!"); //编写需要操作的方法
- },
- "success" : function(){
- PublicAction.hint("提交成功!"); //编写需要操作的方法
- $('.bmzgBox').hide(0)
- $('.bmzgBox_bg').hide(0)
- $('body').removeClass('bodyC');
- $('body input[type="text"]').val('');
- $('.js_top_m').find('span').html('您的预算')
- $('.js_pric_list a').removeClass('on');
- $('body input[name="budget"]').val('');
- $('.js_top_c').find('span').html('请选择意向城市')
- $('.js_citybm_list a').removeClass('on');
- $('body input[name="intention_city"]').val('');
-
- }
- }
- PublicAction.AjaxSend({CORID:'js_pulice_button'},fun);
- $('body').on('click','.js_appleBm_popup',function(){
- $('.appleBm').show(20);
- $('.appleBmBG').show();
- var _Tilte= $(this).attr('data-title');
- var _hid= $(this).attr('data-id');
- var _module = $(this).attr('data-module');
- var _text = $(this).attr('data-text');
- $('body').addClass('bodyC')
- $('.appleBm_top p.title').html(_Tilte)
- $('.appleBm_top p.text').html(_text);
- $('.appleBm_form input[name="hid"]').val(_hid)
- })
- //调用方法二(传对象函数)
- var fun = {
- "error" : function(){
- PublicAction.hint("提交末成功!"); //编写需要操作的方法
- },
- "success" : function(){
- PublicAction.hint("提交成功!"); //编写需要操作的方法
- $('.appleBmBG').click()
- }
- }
- PublicAction.AjaxSend({CORID:'js_pulice_button'},fun);
- $('.appleBmBG,.appleBm_gb a').on('click',function(){
- $('.appleBm').hide(0)
- $('.appleBmBG').hide(0)
- $('body').removeClass('bodyC');
- })
- })
- // 选项卡
- function tab (name1,name2,name3){;
- $(name1).on('click',function(){
- $(name2).hide();
- var Idoption = $(this).attr(name3);
- $(name2+'['+name3+''+'='+ Idoption +']').show();
- $(this).addClass('on').siblings().removeClass('on');
- })
- $(name1).eq(0).addClass('on');
- $(name2).eq(0).show();
- }
- function ajax_lp (cityID){
- var html = '';
- $.ajax({
- url: "/zt/getprovince", // 索取
- data:{city:cityID}, //传ID
- type: "POST",
- dataType: "json",
- success: function(data) {//请求成功完成后要执行的方法
- if (data.code==200) {
- $('.hot_list').html('')
- html+= '<div class="hot_list_mian js_recommend_list">';
- html+= '<ul class="swiper-wrapper">';
- $.each(data.data, function (key,val) {
- // console.log(val.preferential)
- html+= '<li class="swiper-slide">';
- html+= '<div class="lp_top">';
- html+= '<a href="/house/'+val['id']+'">';
- html+= '<div class="lp_top_ico">';
- html+= '<p class="ico"><img src="'+val['thumb']+'" alt=""></p>';
- html+= '<p class="index">TOP'+(key+1)+'</p>';
- html+= '<div class="lp_text">';
- html+= '<p class="title">'+val['name']+'</p>';
- html+= '<p class="time"><img src="/overseas/zt/hnbszt20200701/image/ico__23.png" alt="">有效期 '+v3Time+'</p>';
- html+= '</div>';
- html+= '</div>';
- html+= '<div class="lp_bottom_m">';
- if (val.sale_price!='' && val.sale_price!=null) {
- html+= '<p class="pric">均价<span>'+val['sale_price']+'</span>'+val['price_unit']+'</p>';
- }else{
- html+= '<p class="pric">均价<span>待定</span></p>';
- }
- if (val.preferential!='' && val.preferential!= null) {
- html+= '<p class="zk"><img src="/overseas/zt/hnbszt20200701/image/ico__22.png" alt="">'+val['preferential']+'</p>';
- }else{
- html+= '<p class="zk"><img src="/overseas/zt/hnbszt20200701/image/ico__22.png" alt="">暂无优惠</p>';
- }
- html+= '</div>';
- html+= '</a>';
- html+= '</div>';
- html+= '<div class="lp_bm">';
- html+= '<a class="hqdj js_appleBm_popup" data-id="'+val['id']+'" data-module="132" data-title="获取底价" data-text="获取项目新底价+项目详细资料+投资分析+升值空间评测,为您投资置业保驾护航" href="javascript:;"><img src="/overseas/zt/hnbszt20200701/image/ico__29.png" alt="">获取底价</a>';
- html+= '<a class="zk js_appleBm_popup" data-id="'+val['id']+'" data-module="133" data-title="领取折扣" data-text="领取项目折扣+免费接机+酒店接送+专车看房,领取优惠,更享有购房立减优惠折扣" href="javascript:;"><img src="/overseas/zt/hnbszt20200701/image/ico__30.png" alt="">领取折扣</a>';
- html+= '</div>';
- html+= '</li>';
- });
- html+= '</ul>';
- html+= '</div>';
- html+= '<div class="swiper-pagination hot_swiper-pagination"></div>';
- $('.hot_list').html(html);
- var swiperRe= new Swiper(".js_recommend_list",{
- loop : false,
- autoplay:false,
- slidesPerView : 1.3,
- spaceBetween : 15,
- slidesPerGroup : 1,
- pagination : '.hot_swiper-pagination',
- });
- }
- }
- });
- }
- function wanquHotBox (cityID){
- var html = '';
- $.ajax({
- url: "/zt/getgulfcitygl", // 索取
- data:{id:cityID}, //传ID
- type: "POST",
- dataType: "json",
- success: function(data) {//请求成功完成后要执行的方法
- if (data.code==200) {
- $('.wanquHotBox ul').html('');
- $.each(data.data, function (k,val) {
- html+= '<li>';
- html+= '<div class="left_text">';
- html+= '<a href="/house/'+val['hid']+'">';
- html+= '<div class="l_img">';
- html+= '<img src="'+val['thumb']+'" alt="">';
- html+= '</div>';
- html+= '<div class="r_text">';
- html+= '<p class="title">'+val['name']+'</p>';
- if (val.sale_price!='' && val.sale_price!=null) {
- html+= '<p class="pric">均价<span>'+val['sale_price']+'</span>'+val['price_unit']+'</p>';
- }else{
- html+= '<p class="pric">均价<span>待定</span></p>';
- }
- html+= '<p class="time"><img src="/overseas/zt/hnbszt20200701/image/ico__24.png" alt="">有效期 '+v3Time+'</p>';
- html+= '</div>';
- html+= '</a>';
- html+= '</div>';
- html+= '<div class="right_zx">';
- html+= '<a href="tel:'+val['tel']+'">免费通话</a>';
- html+= '</div>';
- html+= '</li>';
- });
- $('.wanquHotBox ul').html(html);
- }
- }
- });
- }
- function adv_list (id){
- var html = '';
- $.ajax({
- url: "/zt/getboutiquevillalist", // 索取
- data:{id:id}, //传ID
- type: "POST",
- dataType: "json",
- success: function(data) {//请求成功完成后要执行的方法
- if (data.code==200) {
- html+= '<div class="Boutique_list js_Boutique_list" id="js_Boutique_list">';
- html+= '<ul class="swiper-wrapper">';
- $.each(data.data, function (k,v) {
- html+= '<li class="swiper-slide">';
- html+= '<a href="'+v['url']+'"><img src="'+v['img']+'" alt=""></a>';
- html+= '</li>';
- });
- html+= '</ul>';
- html+= '</div>';
- $('.xhin').html(html);
- setTimeout(function(){
- var mySwiperadv = new Swiper("#js_Boutique_list",{
- loop : true,
- slidesPerView : 'auto',
- slidesPerGroup : 1,
- });
- },1000);
- }
- }
- });
- }
- // 处理资讯详情页面的底部一个月的有效日期
- var myDate = new Date;
- var year = myDate.getFullYear(); //获取当前时间年份
- var yue = myDate.getMonth()+1;//获取当前时间月份
- if (yue<10) {
- yue= '0' + yue;
- }else if(yue == 13){
- yue = '01';
- };
- // 返回下个月有多少天数
- function mGetDate(yue){
- var date = new Date();
- var year = date.getFullYear();
- var d = new Date(year,parseInt(yue), 0);
- return d.getDate();
- }
- var v3Time = year + '.'+ yue + '.' + mGetDate(yue);
|