登录 注册 购物车 13310039714
setTimeout(function () { window.location.href = '/login' }, 1000) } else if (data.code == 500) { layer.msg(data.msg) } else { layer.msg(data.msg); window.location.href='/cart.html'; } }, error: function () { } }); } function select_sku(object){ $(object).addClass('active').siblings().removeClass('active'); } // 产品详细小图切换大图 window.onload=function(){ var large = new Swiper(".product-show .large .swiper-container", { slidesPerView: 1, speed: 500, paginationClickable :true, autoplay: { delay: 5000, }, navigation: { prevEl: ".product-show .large .swiper-button-prev", nextEl: ".product-show .large .swiper-button-next", }, breakpoints: { 1024: { // direction: 'vertical', }, }, pagination: { el: '.product-show .large .swiper-pagination', type: "custom", renderCustom: function (swiper, current, total) { var dangqian = document.querySelector(".dangqian") var zongshu = document.querySelector(".zongshu") if(current<=9){ current = "0"+current }else{ current = current } if(total<=9){ total = "0"+total }else{ total = total } dangqian.innerText = current zongshu.innerText = total } }, }) } // 详细选择卡 let menuTabsTop = $(".product-show .bd").offset().top-$(".top-header").outerHeight(); $(".product-show .menuTabs .list .box").click(function(){ let liIndex = $(this).parent().index(); $(this).parent().addClass("active").siblings().removeClass("active"); $(".product-show .conTabs .item").eq(liIndex).show().siblings().hide(); $("html,body").animate({ scrollTop:menuTabsTop, },0) if (liIndex==0) { $(".product-show .conTabs .item").show() } else{ } }) /*弹出视频*/ function videoPlay(srcUrl) { const videoPopup = document.querySelector(".videoPopup") //获取弹出框 const video = document.querySelector(".videoPopup video"); //获取弹出框视频 video.src = srcUrl; //设置视频url videoPopup.classList.add("show") //显示弹出框 video.play(); //视频播放 const closeBtn = document.querySelectorAll(".videoPopup .closeBtn");//获取关闭按钮 const transparent = document.querySelectorAll(".videoPopup .transparent");//获取关闭图层 videoPopup.addEventListener("click", function (event) { if (event.target.classList.contains("closeBtn")||event.target.classList.contains("transparent")) { videoPopup.classList.remove("show"); video.src = ""; video.pause(); } }) } // 点击展开 $(".xgWd .listQuestion .title").click(function(){ if ($(this).closest("li").hasClass("active")) { $(this).closest("li").removeClass("active"); $(this).next().slideUp(); } else{ $(this).closest("li").addClass("active"); $(this).next().slideDown(); } })