123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- $('.m_video_img').on('click',function(){ //处理视频播放图标
- var _video = document.getElementById("myVideo");
- myVideo.play(); //点击图标视频播放
- $('.m_video_sp').attr('controls','controls'); //点击 显示默认的控件
- $(this).hide();
- var id = $(".m_video_img").attr('data-id');
- $.ajax({
- url:'/video/houseplays',
- dataType:"json",
- type:'GET',
- data:{id:id},
- success:function(data){
- }
- });
- })
- // 汇率弹窗
- $('.m_conversion').on('click',function(){
- $('.exchange_rate_box').fadeIn(100);
- })
- $('.exchange_gb').on('click',function(){
- $('.exchange_rate_box').fadeOut(100);
- })
- // 精选楼盘 换一换
- var idQh = 1; //默认页数
- var DataN = $('.m_zaigai_title i').attr('city'); //默认ID
- var _number = $('.m_zaigai_title i').attr('number'); //换一换页数
- ajax_lp();
- if(_number < 2){
- $('.m_zaigai_title i').hide();
- }else{
- $('.m_zaigai_title i').show();
- $('.m_zaigai_title i').on('click',function(){
- idQh += 1;
- // console.log(idQh);
- if (idQh > _number) {
- idQh = 1;
- };
-
- ajax_lp();
- })
- }
- // 精选楼盘
- function ajax_lp (){
- var html = '';
- $.ajax({
- url: "/video/videodetailspush", // 索取
- data:{page:idQh,city:DataN}, //传ID
- type: "GET",
- dataType: "json",
- success: function(data) {//请求成功完成后要执行的方法
- if(data.code == 200){
- $.each(data.data, function (i, data) {
- // html+= '<a target="_blank" href="/house/'+data.name+'/">';
- html+= '<li class="c">';
- html+= '<a href="/video/videodetails/'+data.id+'" class="c">';
- html+= '<div class="sell_img">';
- html+= '<img class="img" src="'+data.thumb+'" alt="">';
- html+= '<p>';
- html+= '<i><img src="/video/image/video10.png" alt="">'+data.city_name+'</i>';
- html+= '</p>';
- html+= '<img class="tb" src="/video/image/video2.png" alt="">';
- html+= '</div>';
- html+= ' <div class="sell_conter_right">';
- html+= '<p class="title">'+data.name+'</p>';
- html+= '<p class="jg_ing jg_ingdd">';
- html+= '<span>约¥<em>'+data.price+'</em>'+data.price_nuit+'</span>';
- html+= '</p>';
- html+= '<p class="date">有效期至:'+getNextMonth(time)+'</p>';
- html+= '<p class="style">';
- html+= '<i>房价涨幅'+data.recent_price+'</i>';
- html+= '<i>参考收益'+data.rent.proportion+'</i>';
- html+= '</p>';
- html+= '</div>';
- html+= '</a>';
- html+= '</li>';
- });
- }
- $('.sell_conter ul').html(html);
- }
- });
- }
- // 有效期 时间加两个自然月
- function getNextMonth(date,an) {
- 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;
- // console.log(an) 当an不为空或undefined时输出一个月,否则输出两个月
- if(an != undefined && an != '' && an != 'undefined'){
- var month2 = parseInt(month) + 1;
- if (month2 > 12) {
- year2 = parseInt(year2) + 1;
- if (parseInt(month)==12) {
- month2 = 1;
- }
- }
- var day2 = day;
- var days2 = new Date(year2, month2, 0);
- days2 = days2.getDate();
- if (day2 > days2) {
- day2 = days2;
- }
- if (month2 < 10) {
- month2 = '0' + month2;
- }
- var t2 = year2 + '-' + month2 + '-' + day2;
- }else{
- var month2 = parseInt(month) + 2;
- if (month2 > 13) {
- year2 = parseInt(year2) + 1;
- if (parseInt(month)==11) {
- month2 = 1;
- }else if (parseInt(month)==12) {
- month2 = 2;
- };
- }
- var day2 = day;
- var days2 = new Date(year2, month2, 0);
- days2 = days2.getDate();
- if (day2 > days2) {
- day2 = days2;
- }
- if (month2 < 10) {
- month2 = '0' + month2;
- }
- var t2 = year2 + '/' + month2 + '/' + day2;
- }
- return t2;
- }
- var myDate = new Date;
- var year = myDate.getFullYear(); //获取当前时间年份
- var yue = myDate.getMonth()+1;//获取当前时间月份
- if (yue<10) {
- yue= '0' + yue;
- };
- // 有效期时间 获取当前时间
- var time = year+'/'+yue+'/01';
- var time_yxq= year+'/'+yue+'/01-'+getNextMonth(time);
|