123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- // 导航切换语言
- $(function(){
- // 导航切换语言 显示 隐藏
- function navMouseleave (id,id1){
- $(id).on({
- mouseover: function() {
- $(id1).show();
- },
- mouseleave: function() {
- $(id1).hide();
- }
- });
- }
- navMouseleave('.area','.area .option');//导航区域显示 隐藏
- // 底部报名 关闭按钮
- $('.ocls').on('click',function(){
- $('.order-box').animate({width:"0"},function(){
- $('.order-box').hide();
- $('.min-left').show();
- })
- })
- // 显示报名 窗口
- $('.min-left').on('click',function(){
- $('.order-box').show(function(){
- $('.min-left').hide();
- $('.order-box').animate({width:"100%"},function(){})
- })
-
- })
- // 首页、列表页、楼盘首页底部公共报名
- /*
- * 调用的方法
- * */
- PublicAction.AjaxSend(
- {
- CORID:'wa_submit', /*操作ID*/
- }
- );
- })
- // 处理资讯详情页面的底部一个月的有效日期
- 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 whtmltimes = year + '/'+ yue + '/' + mGetDate(yue);
- var whtmltime = year + '/'+ yue + '/' +'01'+'-'+ year + '/'+ yue + '/' + mGetDate(yue);
- var time_yxq= whtmltime;
- $('.youxiaoqi_sj').html('(有效期:'+time_yxq+')');
- //底部横幅关闭
- $('.m_tc_gb').on('click',function(){
- $('.m_tc_box').hide();
- })
- // 广告自动修改时间
- function getNextMonth_m(date) {
- var arr = date.split('/');
- var year = arr[0]; //获取当前日期的年份
- var month = arr[1]; //获取当前日期的月份
- var day = arr[2]; //获取当前日期的日
- var days = new Date(year, month, 0);
- days = days.getDate(); //获取当前日期中的月的天数
- var year2 = year;
- var month2 = parseInt(month);
- if (parseInt(day) > 20) {
- var month2 = parseInt(month) + 1;
- if (month2 > 12) {
- year2 = parseInt(year2) + 1;
- month2 = 1;
- }
- };
- if (month2 < 10) {
- month2 = '0' + month2;
- }
- var t2 = year2 + '年' + month2 + '月';
- return t2;
- }
- var myDate = new Date;
- var year = myDate.getFullYear(); //获取当前时间年份
- var yue = myDate.getMonth()+1;//获取当前时间月份
- var date=myDate.getDate(); //获取当前日
- if (yue<10) {
- yue= '0' + yue;
- };
- // 有效期时间 获取当前时间
- var time = year+'/'+yue+'/'+date;
- $('.shijian_text').html(getNextMonth_m(time)+'20日启程')
- // 底部JS
- $('.m_FriendshipLinks a').eq(0).attr('class','on');
- var _default = $('.m_FriendshipLinks a').eq(0).attr('qhid');
- $('.m_regionfc[qhid="'+_default+'"]').show();
- $('.m_FriendshipLinks a').on('mousemove',function(){
- var _qhid = $(this).attr('qhid');
- $('.m_regionfc').hide();
- $('.m_regionfc[qhid="'+_qhid+'"]').show();
- $(this).attr('class','on').siblings().attr('class','');
- })
- var data_id = $('.gzhclick').attr('data-id');
- // console.log(data_id)
- // 处理当没有获取到ID时,不执行以下请求;
- if(data_id != undefined && data_id != '' && data_id != 'undefined'){
- var html = '';
- var tophtml = '';
- var toplist = '';
- $.ajax({
- url: "/index/getgzh", // 索取
- data:{id:data_id}, //传ID
- type: "GET",
- dataType: "json",
- success: function(data) {//请求成功完成后要执行的方法
- if(data.code == 200){
- // console.log(data);
- html+= '<ul class="m_gzhlist c">';
- html+= '<img class="m_tb" src="/image/v2/index33.png" alt="">';
- $.each(data.data, function (i, data) {
- html+= '<li>';
- html+= '<img src="'+data.icon+'" alt="">';
- html+= '<p>'+data.name+'</p>';
- html+= '</li>';
- var text_tit=data.name.split('公众号');
- toplist+='<a href="javascript:;" data-id="'+i+'">'+text_tit[0]+'</a>';
- tophtml+='<div class="right_imgUl" data-id="'+i+'">';
- tophtml+='<div class="right_imgUl_m">';
- tophtml+='<i class="sj"></i>';
- tophtml+='<p class="top_img"><img src="'+data.icon+'" alt=""></p>';
- tophtml+='<p class="title">'+data.name+'</p>';
- tophtml+='</div>';
- tophtml+='</div>';
- });
- }
- $('.m_HeadGzh_box_a').html(toplist);
- $('.m_HeadGzh_box_right').html(tophtml);
- $('.m_gzhlist_box').html(html);
- // 首页头部 公众号选项卡切换
- $('body .m_HeadGzh_box_a a').eq(0).addClass('on');
- $('body .right_imgUl').eq(0).show();
- $('body').on('mouseover','.m_HeadGzh_box_a a',function(){
- $('body .right_imgUl').hide();
- var Idoption = $(this).attr('data-id');
- $('body .right_imgUl[data-id='+ Idoption +']').show();
- $(this).addClass('on').siblings().removeClass('on');
- })
- }
- });
- }
- $('.m_regionfc a').on('mousemove',function(){
- $('.m_gzhlist_box').hide();
- })
- $('.gzhclick').on('mousemove',function(){
- $('.m_gzhlist_box').show();
- })
- $('.m_regionfc').on('mouseleave',function(){
- $('.m_gzhlist_box').hide();
- })
- // 导航
- $('.wm_Navigation ul li').on('mousemove',function(){
- $('.wm_Navigation_list').hide();
- })
- $('.wm_Navigation ul .Navigation_click').on('mousemove',function(){
-
- $(this).find('.wm_Navigation_list').show();
- })
- $('.wm_Navigation').on('mouseleave',function(){
- $('.wm_Navigation_list').hide();
- })
- // 楼盘首页报名 --最新价格 ---变动通知
- //创建一个弹出层,width 宽度,height 高度,url
- function CreatePopLayerDiv(width,height,url){
- var Iheight=$(window).height();
- var Iwidth =$(window).width();
- var heights = height || 300;
- var widths = width || 500;
- var Oheight= (Iheight -heights) / 2;
- var Owidth = (Iwidth - widths) /2;
- var div ='<div id="InDiv" style="width:'+Iwidth+'px;height:'+Iheight+'px;background:rgba(0,0,0,0.6);position:fixed;z-index:1000;top:0;left:0;">';
- div+='<div id="offDiv" style="width:'+widths+'px;height:'+heights+'px;left:'+Owidth+'px;position:fixed;z-index:32;border-radius:5px;">';
- div+='<a id="AClose" class="y_close" href="javascript:;" onclick="btnCloses()"><img src="/image/ico_close1.png" alt="" /></a>';
- div+='<div id="Content"></div>';
- div+='</div>';
- div+='</div>';
- $(document.body).append(div);
- if(url != ""){
- $("#Content").load(url);
- }
- }
- //移除弹出层
- function RemoveDiv(){
- $("#AClose").remove();
- $("#HTitle").remove();
- $("#offDiv").remove();
- $("#InDiv").remove();
- }
- function btnCloses(){
- RemoveDiv();
- }
- $(function(){
- // //降价通知
- var w_type,w_id,w_title,w_tel,w_module,w_text,w_button; //为了这些变量在其它地方用;
- $('body').on('click','.applekf-id,.pic_jjtz',function(){
- var $that = $(this);
- CreatePopLayerDiv(440,510,"/public/reduced"); //添加加载页面
- $('#offDiv').css({'margin-top':'-300px'}).animate({top:'50%'},500);
- parent.w_type = $that.attr('data-type'); //把报名窗口 类型传向父级
- parent.w_id = $that.attr('data-id'); //把楼盘ID传向父级
- parent.w_text = $that.attr('data-text'); //把报名 text文本传向父级
- parent.w_module = $that.attr('data-module'); //来源模块ID
- parent.w_title = $that.attr('data-name'); //报名标题
- parent.w_tel = $that.attr('data-tel'); //楼盘电话
- parent.w_button = $that.attr('data-button'); //提交按钮文案
- });
- $('#InDiv').on('click',function(){
- btnCloses();
- })
- //报名验证提交的调用
- PublicAction.AjaxSend({CORID:'v2inform_buttom'/*操作ID*/});
- })
- /*---------------------------------------COOKIE方法 end-----------------------------------------*/
- // 封装一个COOKIE方法
- var cookie = {
- //设置cookie方法
- set:function(key,val,time){
- var date=new Date(); //获取当前时间
- var expiresDays=time; //将date设置为n天以后的时间
- date.setTime(date.getTime()+expiresDays*24*3600*1000); //格式化为cookie识别的时间
- document.cookie=key + "=" + val +";expires="+date.toGMTString(); //设置cookie
- },
- //获取cookie方法
- get:function(key){
- /*获取cookie参数*/
- var getCookie = document.cookie.replace(/[ ]/g,""); //获取cookie,并且将获得的cookie格式化,去掉空格字符
- var arrCookie = getCookie.split(";") //将获得的cookie以"分号"为标识 将cookie保存到arrCookie的数组中
- var tips; //声明变量tips
- for(var i=0;i<arrCookie.length;i++){ //使用for循环查找cookie中的tips变量
- var arr=arrCookie[i].split("="); //将单条cookie用"等号"为标识,将单条cookie保存为arr数组
- if(key==arr[0]){ //匹配变量名称,其中arr[0]是指的cookie名称,如果该条变量为tips则执行判断语句中的赋值操作
- tips=arr[1]; //将cookie的值赋给变量tips
- break; //终止for循环遍历
- }
- }
- return tips;
- },
- //删除cookie方法
- delete:function(key){
- var date = new Date(); //获取当前时间
- date.setTime(date.getTime()-10000); //将date设置为过去的时间
- document.cookie = key + "=v; expires =" +date.toGMTString();//设置cookie
- }
- }
- // 调用方法
- // cookie.set("www","54165165",24);//设置为24天过期
- // console.log(cookie.get("www"));//获取cookie
- /*---------------------------------------COOKIE方法 end-----------------------------------------*/
|