'; $('.vodeo_Tk .shipin div').html(sp); }) $(document).on('click', '.bofang2', function() { var url =$('.swiper-slide-visible').attr('date'); $('.vodeo_Tk').show(); var sp = ''; $('.vodeo_Tk .shipin div').html(sp); }) var mySwiper = $('.swiper-container').swiper({ autoplayDisableOnInteraction: false, //点击自动轮播 autoplay: 3000, //是否轮播 speed:1000, loop: true, //是否循环 slidesPerView: 1, //显示几个 slidesPerGroup: 1, //每次移动几个 paginationClickable: true, pagination: '.pagination' }); } }) } var Page = { _url:'/Home/News/product', _url1:'/Member/Car/ajax_add', _url2:'/Member/Order/ajax_add', init:function(){ this.bind(); this.renderTable(); }, bind:function(){ var _this = this; var winH = $(window).height(); //页面可视区域高度 $('#ck_more').click(function () { // var totalheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop()); //浏览器的高度加上滚动条的高度 // if ($(document).height() <= totalheight) //当文档的高度小于或者等于总的高度的时候,开始动态加载数据 // { if($('#no_data').val()){ alert('没有更多产品了') return false; } _this.page+=1; _this.renderTable(); layer.closeAll('loading'); // } }); //查看3D效果 $(document).on('click','.button_3d',function(){ // layer.load(1, { // shade: [0.1,'#fff'] //0.1透明度的白色背景 // }); var _style = $(this).parent().attr('target_id'); _this._style = _style; $.ajax({ url:_this.url, data:{ do:'show_3d', style:_style }, success:function(e){ // console.log(_this.url) // $('content'+e.style).html() if(e.status==1){ $('.chakan_3d').show() // $('.content_'+e.style).html("

关闭

").css('display','block'); $('.cpxq_3d div').html("").css('display','block'); }else{ alert('暂无3D效果,请等待更新!'); } } }) }) $(document).on('click','.close_3d,.close_3d',function(){ $('.cpxq_3d div').html(''); $('.cpxq_3d').parent().hide(); }) $(document).on('click','#sure',function(){ var that = $(this); if($('input[name="style"]').val().length>0){ _this.style = $('input[name="style"]').val(); } else { _this.style = ''; } _this.gold = $('input[name="gold_min"]').val(); if($('input[name="gold_max"]').val()>0){ _this.gold += ('-'+$('input[name="gold_max"]').val()); } _this.page = 1; $('#product_list').html(''); _this.renderTable(); }) $(document).on('click','#product_list .pro_Xq img',function(){ layer.load(1, { shade: [0.1,'#fff'] //0.1透明度的白色背景 }); var _style = $(this).attr('target_id'); _this._style = _style; $.ajax({ url:_this.url, data:{ do:'finished_model', style:_style }, success:function(e){ // console.log(e) $('.finished_model').show() $('.finished_model').html(e); var td_len = $('#finished_body tr').length * $('#finished_body tr').height(); var tbody_height = $('#finished_body').height(); if ( td_len > tbody_height) { $('#finished_body').css({'overflow-y':'scroll'}) } } }) return false; }) // $.post( // '/Member/Order/ajax_add', // _data, // function(e) // { // if(e.error!=undefined) // { // newTab.close(); // Form.alert(e.error); // if(e.error=='生成失败'){ // $('.goback_prevmodel').click(); // $('.finished_back').click(); // $('#product_list').html(''); // _this.renderTable(); // layer.closeAll('loading'); // } // }else{ // if(e.redirect == 1){ // $('.popBox').show(); // newTab.location.href=e.url; // // setTimeout(function(){ window.open(e.url)},500); // var interval = window.setInterval(function () { // $.get("/Member/Order/order?order_no="+ e.order_no + new Date().getMilliseconds(), // function (data, status) { // if(data == 'success'){ // window.location.href='/Member/Center/order/type/1'; // } // }) // }, 1000); // // window.open(e.url); // // location.replace(e.url); // } else { // layer.msg('下单成功',{time: 5000}); // $('.order_model').fadeOut(); // $('.finished_model').fadeOut(); // $('body').css("overflow","scroll"); // $('#product_list').html(''); // $('#product_list li').trigger('click'); // _this.renderTable(); // layer.closeAll('loading'); // } // } // }, // 'json' // ) $('.ok').click(function(){ window.location.href = '/Member/Center/order'; }) $('.no').click(function(){ window.location.href = '/Member/Center/help'; }) $('.close').click(function(){ window.location.href = '/Member/Center/order/type/0'; }) $(document).on('change','input[name="price_min"],input[name="price_max"]',function(){ var that = $(this); if(that.attr('name') == 'price_min'){ _this.price = that.val()+'-'+$('input[name=price_max]').val(); } else { _this.price = $('input[name=price_min]').val()+'-'+that.val(); } $('#product_list').html(''); _this.renderTable(); }) $(document).on('click','.only_row li',function(){ var that = $(this); if(that.find('input').length>0){ return false; } if(that.parent().parent().index() == 0){ if(that.index() == 0){ that.parent().find('li').removeClass('active_row'); that.addClass('active_row'); if(that.children('a').attr('col') == 'pcategory'){ _this.pcategory = ''; } else if(that.children('a').attr('col') == 'serie'){ _this.serie = ''; } else if(that.children('a').attr('col') == 'yellow'){ _this.yellow = ''; } else if(that.children('a').attr('col') == 'price'){ _this.price = ''; } } else { that.parent().find('li').eq(0).removeClass('active_row'); } }else{ if(that.index() == 0){ that.parent().find('li').removeClass('active_row'); that.addClass('active_row'); if(that.children('a').attr('col') == 'pcategory'){ _this.pcategory = ''; } else if(that.children('a').attr('col') == 'serie'){ _this.serie = ''; } else if(that.children('a').attr('col') == 'yellow'){ _this.yellow = ''; } else if(that.children('a').attr('col') == 'price'){ _this.price = ''; } } else { that.parent().find('li').removeClass('active_row'); //that.addClass('active_row'); } } // that.parent().parent('ul').children('li:eq(1)').removeClass('active_row'); // $(this).addClass('active_row ') //TODO:没有选中时的样式class样式暂未写,临时写一个,后期补上 if(that.children('a').attr('col') == 'pcategory'){ if(that.hasClass('active_row')){ that.removeClass('active_row'); var cur_sel = that.parent().find('.active_row').length; // alert(cur_sel); if(cur_sel == 0){ that.parent().find('li').eq(0).addClass('active_row'); _this.pcategory = ''; } else { var cur = _this.pcategory; _this.pcategory = cur.replace(that.text()+',',''); } } else { that.addClass('active_row'); _this.pcategory += (that.text()+','); } } else if(that.children('a').attr('col') == 'yellow'){ if(that.hasClass('active_row')){ that.removeClass('active_row'); var cur_sel = that.parent().find('.active_row').length; if(cur_sel == 0){ that.parent().find('li').eq(0).addClass('active_row'); _this.yellow = ''; } else { var cur = _this.pcategory; _this.yellow = cur.replace(that.text()+',',''); } } else { that.addClass('active_row'); _this.yellow += (that.text()+','); } } else if(that.children('a').attr('col') == 'serie'){ if(that.hasClass('active_row')){ that.removeClass('active_row'); var cur_sel = that.parent().find('.active_row').length; if(cur_sel == 0){ that.parent().find('li').eq(0).addClass('active_row'); _this.serie = ''; } else { var cur = _this.serie; _this.serie = cur.replace(that.text()+',',''); } } else { that.addClass('active_row'); _this.serie = (that.text()); } } else if(that.children('a').attr('col') == 'price'){ that.parent().find('li').removeClass('active_row'); if(that.hasClass('active_row')){ _this.price = ''; } else { that.addClass('active_row'); _this.price = (that.text()); } } _this.page = 1; $('#product_list').html(''); _this.renderTable(); // alert($('#product_list li').length); }) }, page:1, price:'', pcategory:'', style:'', gold:'', yellow:'', // var key = "耳语"; // serie:key, serie:"", renderTable:function(){ layer.load(1, { shade: [0.1,'#fff'] //0.1透明度的白色背景 }); var _this = this; var d3 = "1"; var xl = _this.serie ? _this.serie :""; $.ajax({ url:'/news/product', data:{ do:'listTableData', page:_this.page, price:_this.price, d3 : d3, pcategory:_this.pcategory, style:_this.style, gold:_this.gold, yellow:_this.yellow, serie:_this.serie ? _this.serie :"" }, type:'post', success:function(res){ lunbo(xl); layer.closeAll('loading'); if(""){ $('.serie_row li').eq(0).removeClass('active_row'); } $('#product_list').append(res); if($('#product_list li').length == 0){ $('.none_product_time').show(); } else { $('.none_product_time').hide(); } } }) }, 'closeDia':function(){ $('.finished_model').fadeOut(); $('.finished_model').html(''); $('body').css("overflow","scroll"); return false; }, order:function(_pid){ var _this = this; var _data = { pid:_pid, type:1 }; $.post( '/Member/Order/ajax_submit', _data, function(e){ if(e.error!=undefined){ layer.msg(e.error) $('.clear').trigger('click'); }else{ $('.order_model').html(e.msg); $('.order_model').fadeIn(); } }, 'json' ) }, } $(function(){ Page.init(); })

返回

顶部