layui.use(['jquery','laypage'],function(){ var $ = layui.jquery , laypage = layui.laypage; $("#faq .problem").click(function(){ $(this).siblings('.active').find('.answer').slideUp(); $(this).siblings('.active').removeClass('active'); if($(this).hasClass('active')){ $(this).removeClass('active'); $(this).find('.answer').slideUp(); } else{ $(this).addClass('active'); $(this).find('.answer').slideDown(); } }) $(".content-menu .extend").click(function(ev){ var subset = $(this).next('.subset').eq(0); var href = $(this).attr('href'); if(href && href.length > 2) return location.href = href; if($(this).hasClass('open')){ $(this).removeClass('open'); subset.slideUp(); } else{ $(this).addClass('open'); subset.slideDown(); } }) // $(".content-menu .extend").click(function(ev){ // $(this).find('.subset').eq(0).filter(':not(:animated)').slideToggle(); // ev.stopPropagation(); // }) $("#video .video-box .item").click(function(){ var url = $(this).attr('data-url'); var area = ['510px', '498px']; if(window.innerWidth < 550){ var w = window.outerWidth*0.9; area[0] = w+'px'; area[1] = w * 0.6 + 'px'; } layer.open({ type: 2, title:false, shadeClose: true, area: area, content: [url, 'no'] }); }) $(".orderDel").click(function(){ var orderId = $(this).attr('data-id'); layer.confirm('鎮ㄧ‘瀹氬垹闄よ璁㈠崟锛?, { btn: ['纭畾','鍙栨秷'] //鎸夐挳 }, function(){ $.post('/del_order',{orderId:orderId},function(res){ layer.msg(res.msg,function(){ location.reload(); }) }) }) }) $(".shopping_cart_del").click(function(){ var id = $(this).attr('data-id'); layer.confirm('鎮ㄧ‘瀹氬垹闄ゅ晢鍝侊紵', { btn: ['纭畾','鍙栨秷'] //鎸夐挳 }, function(){ $.post('/shopping_cart_del',{id:id},function(res){ layer.msg(res.msg,function(){ location.reload(); }) }) }) }) $(".shopping_submit").click(function(){ if($('.order-row .trow').length == 0){ layer.msg('璐墿杞︿负绌?); return; } location.href = '/orderCheckStep1.html'; // $.post('/shopping_submit',{},function(res){ // layer.msg(res.msg,function(){ // // location.reload(); // location.href = '/order'; // }) // }) }) if(typeof(limit) == 'undefined'){ limit = 10; } if(typeof(page) != 'undefined' && (page != 1 || count > (limit))){ var laypage = layui.laypage; laypage.render({ elem: 'page' //娉ㄦ剰锛岃繖閲岀殑 test1 鏄 ID锛屼笉鐢ㄥ姞 # 鍙 ,count: count //鏁版嵁鎬绘暟锛屼粠鏈嶅姟绔緱鍒 ,theme:'page' ,curr:page ,limit:limit ,jump: function(obj, first){ //obj鍖呭惈浜嗗綋鍓嶅垎椤电殑鎵€鏈夊弬鏁帮紝姣斿锛 var link = $("#page").attr('link'); if(!link) link = '/'+columnName+'/'; //'/service_support/'+ //棣栨涓嶆墽琛 if(!first){ location = link + obj.curr+'.html'; //寰楀埌姣忛〉鏄剧ず鐨勬潯鏁 } } }); } var articleTitle = $('.article-title').html(); $("#faq.article .content img").each(function(){ if(!$(this).attr('title')){ $(this).attr('title',articleTitle); } }) })