"use strict";!function(){var e=store.get("sinfo");e=e?JSON.parse(e):{},window.saleCarousel=new Vue({el:"#sgk-carousel",data:function(){return{poster:"",carousels:[],videoCarousel:[],isBackHome:isBackHome,sinfo:e||{},thumbs:"",height:0,comment:null,gallery:null,slotHtml:window.carouselsSlot||""}},created:function(){this.sinfo.carousels&&(this.carousels=this.sinfo.carousels.filter(function(e){return 3!==Number(e.position)}),this.videoCarousel=this.sinfo.carousels.filter(function(e){return 3===Number(e.position)}),this.poster=this.carousels.length?this.carousels[0].image:"",this.thumbs=this.getHtml(!0))},mounted:function(){this.renderSwiper()},methods:{getHtml:function(e){var s=this,t=0<arguments.length&&void 0!==e&&e,n="";if(this.videoCarousel.length&&this.videoCarousel.forEach(function(e){var i=t?'<i class="iconfont iconbofang1 position-absolute video-icon"></i>':"";n+='\n              <div class="swiper-slide position-relative">\n            <video class="video" style="object-fit: fill;width: 100%;" muted playsinline="false"\n              webkit-playsinline="false" x-webkit-airplay="false" poster="'.concat(s.poster,'">\n              <source src="').concat(e.image,'" type="video/mp4">\n            </video>\n            ').concat(i,"\n          </div>")}),this.carousels.length){var o=.15*$("#thumbs .swiper-wrapper").width();this.carousels.forEach(function(e){var i=e.image;"undefined"!=typeof addImgSize&&(i=addImgSize(i,100<o?o:100,200)),n+=' <div class="swiper-slide">\n              <img src="'.concat(i,'">\n            </div>')})}return n},renderSwiper:function(){if(this.carousels.length||this.videoCarousel.length){var i=this,e=new Swiper("#thumbs",{spaceBetween:5,slidesPerView:6,freeMode:!0,watchSlidesVisibility:!0,watchSlidesProgress:!0,observer:!0,observeParents:!0}),s=[0],t={spaceBetween:10,observer:!0,observeParents:!0,pagination:{el:".swiper-pagination",type:"fraction"},thumbs:{swiper:e},on:{slideChangeTransitionEnd:function(){s.includes(this.realIndex)||(s.push(this.realIndex),"undefined"!=typeof addImgSize&&$("#gallery .swiper-slide").eq(this.realIndex).find(">img").length&&i.cropImg(this.realIndex),"undefined"!=typeof swiperCommentShow&&swiperCommentShow&&i.$refs.swiperImg&&2<=i.sinfo.carousels.length&&this.realIndex==i.sinfo.carousels.length-2&&require(["getComment"],function(e){"undefined"!=typeof isNewComment&&"1"==isNewComment?e({saleId:i.sinfo.id,marketId:marketId,collId:collId||id},i.getCommentList,!0):e(i.sinfo.id,i.getCommentList)}))}}};"undefined"!=typeof newSwiperParams&&Object.assign(t,newSwiperParams),this.gallery=new Swiper("#gallery",t),this.cropImg(0),"undefined"!=typeof swiperCommentShow&&swiperCommentShow&&i.$refs.swiperImg&&i.sinfo.carousels.length<=2&&setTimeout(function(){require(["getComment"],function(e){e(i.sinfo.id,i.getCommentList)})})}},getCommentList:function(e){if((this.comment=e).lists.length){var i=this;require(["swiperComment"],function(){i.height=i.$refs.swiperImg.length?i.$refs.swiperImg[0].offsetHeight:i.$refs.swiperImg.offsetHeight})}},getImg:function(e,i,s){return"undefined"!=typeof addImgSize?"undefined"!=typeof newSwiperParams&&newSwiperParams.autoplay?addImgSize(e,$("#gallery").width(),1e3):addImgSize(e,i,s):e},cropImg:function(e){var s=this;$("#gallery .swiper-slide").eq(e).find(">img").each(function(){var e=$(this).attr("src").replace(/\.(\d+)x(\d+)/,""),i=$("#gallery .swiper-slide").width();i=i||$("#gallery").width(),$(this).attr("src",s.getImg(e,i,1e3))})}}})}();