text: "use strict";(self["webpackChunksupermall"]=self["webpackChunksupermall"]||[]).push([[540],{4769:function(t,s,e){e.r(s),e.d(s,{default:function(){return ut}});var i=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{attrs:{id:"detail"}},[e("detail-nav-bar",{ref:"nav",staticClass:"detail-nav",on:{titleClick:t.titleClick}}),e("scroll",{ref:"scroll",staticClass:"content",attrs:{probeType:3},on:{scroll:t.contentScroll}},[e("detail-swiper",{attrs:{topImages:t.topImages}}),e("detail-base-info",{attrs:{goods:t.goods}}),e("detail-shop-info",{attrs:{shop:t.shop}}),e("detail-goods-info",{attrs:{detailInfo:t.detailInfo},on:{click:t.imageLoad}}),e("detail-param-info",{ref:"params",attrs:{paramInfo:t.paramInfo}}),e("detail-comment-info",{ref:"comment",attrs:{commentInfo:t.commentInfo}}),e("goods-list",{ref:"recommend",attrs:{goods:t.recommendList}})],1),e("detail-bottom-bar",{on:{addCart:t.addToCart}}),e("back-top",{directives:[{name:"show",rawName:"v-show",value:t.isShowBackTop,expression:"isShowBackTop"}],nativeOn:{click:function(s){return t.backClick.apply(null,arguments)}}})],1)},a=[],o=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",[i("nav-bar",[i("div",{staticClass:"back",attrs:{slot:"left"},on:{click:t.backClick},slot:"left"},[i("img",{attrs:{src:e(228),alt:""}})]),i("div",{staticClass:"title",attrs:{slot:"center"},slot:"center"},t._l(t.titles,(function(s,e){return i("div",{key:e,staticClass:"title-item",class:{active:e===t.currentIndex},on:{click:function(s){return t.titleClick(e)}}},[t._v(" "+t._s(s)+" ")])})),0)])],1)},n=[],l=e(3558),r={components:{NavBar:l.Z},data(){return{titles:["商品","参数","评论","推荐"],currentIndex:0}},methods:{titleClick(t){this.currentIndex=t,this.$emit("titleClick",t)},backClick(){this.$router.back()}}},c=r,d=e(1001),m=(0,d.Z)(c,o,n,!1,null,null,null),f=m.exports,h=e(256);function p(t){return(0,h.W)({url:"/detail",params:{iid:t}})}function u(){return(0,h.W)({url:"/recommend"})}class v{constructor(t,s,e){this.title=t.title,this.desc=t.desc,this.newPrice=t.price,this.oldPrice=t.oldPrice,this.discount=t.discountDesc,this.columns=s,this.services=e,this.realPrice=t.lowNowPrice}}class _{constructor(t){this.logo=t.shopLogo,this.name=t.name,this.fans=t.cFans,this.sells=t.cSells,this.score=t.score,this.goodsCount=t.cGoods}}class g{constructor(t,s){this.image=t.images?t.images[0]:"",this.infos=t.set,this.sizes=s.tables}}var C=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("swiper",{staticClass:"detail-swiper"},t._l(t.topImages,(function(t){return e("swiper-item",{key:t.acm},[e("img",{attrs:{src:t,alt:""}})])})),1)},I=[],k=e(2594),b={name:"DetailSwiper",components:{Swiper:k.k,SwiperItem:k.t},props:{topImages:{type:Array,default(){return[]}}}},y=b,w=(0,d.Z)(y,C,I,!1,null,"6e780229",null),$=w.exports,x=function(){var t=this,s=t.$createElement,e=t._self._c||s;return 0!==Object.keys(t.goods).length?e("div",{staticClass:"base-info"},[e("div",{staticClass:"info-title"},[t._v(t._s(t.goods.title))]),e("div",{staticClass:"info-price"},[e("span",{staticClass:"n-price"},[t._v(t._s(t.goods.newPrice))]),e("span",{staticClass:"o-price"},[t._v(t._s(t.goods.oldPrice))]),t.goods.discount?e("span",{staticClass:"discount"},[t._v(t._s(t.goods.discount))]):t._e()]),e("div",{staticClass:"info-other"},[e("span",[t._v(t._s(t.goods.columns[0]))]),e("span",[t._v(t._s(t.goods.columns[1]))]),e("span",[t._v(t._s(t.goods.services[t.goods.services.length-1].name))])]),e("div",{staticClass:"info-service"},t._l(t.goods.services.length-1,(function(s){return e("span",{key:s,staticClass:"info-service-item"},[e("img",{attrs:{src:t.goods.services[s-1].icon}}),e("span",[t._v(t._s(t.goods.services[s-1].name))])])})),0)]):t._e()},T=[],D={name:"DetailBaseInfo",props:{goods:{type:Object,default(){return{}}}}},L=D,B=(0,d.Z)(L,x,T,!1,null,"2d7c7142",null),P=B.exports,S=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"shop-info"},[e("div",{staticClass:"shop-top"},[e("img",{attrs:{src:t.shop.logo}}),e("span",{staticClass:"title"},[t._v(t._s(t.shop.name))])]),e("div",{staticClass:"shop-middle"},[e("div",{staticClass:"shop-middle-item shop-middle-left"},[e("div",{staticClass:"info-sells"},[e("div",{staticClass:"sells-count"},[t._v(" "+t._s(t._f("sellCountFilter")(t.shop.sells))+" ")]),e("div",{staticClass:"sells-text"},[t._v("总销量")])]),e("div",{staticClass:"info-goods"},[e("div",{staticClass:"goods-count"},[t._v(" "+t._s(t.shop.goodsCount)+" ")]),e("div",{staticClass:"goods-text"},[t._v("全部宝贝")])])]),e("div",{staticClass:"shop-middle-item shop-middle-right"},[e("table",t._l(t.shop.score,(function(s,i){return e("tr",{key:i},[e("td",[t._v(t._s(s.name))]),e("td",{staticClass:"score",class:{"score-better":s.isBetter}},[t._v(t._s(s.score))]),e("td",{staticClass:"better",class:{"better-more":s.isBetter}},[e("span",[t._v(t._s(s.isBetter?"高":"低"))])])])})),0)])]),t._m(0)])},Y=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"shop-bottom"},[e("div",{staticClass:"enter-shop"},[t._v("进店逛逛")])])}],E={name:"DetailShopInfo",props:{shop:{type:Object,default(){return{}}}},filters:{sellCountFilter:function(t){return t<1e4?t:(t/1e4).toFixed(1)+"万"}}},Z=E,O=(0,d.Z)(Z,S,Y,!1,null,"2ae65805",null),j=O.exports,F=e(1691),G=function(){var t=this,s=t.$createElement,e=t._self._c||s;return 0!==Object.keys(t.detailInfo).length?e("div",{staticClass:"goods-info"},[e("div",{staticClass:"info-desc clear-fix"},[e("div",{staticClass:"start"}),e("div",{staticClass:"desc"},[t._v(t._s(t.detailInfo.desc))]),e("div",{staticClass:"end"})]),e("div",{staticClass:"info-key"},[t._v(t._s(t.detailInfo.detailImage[0].key))]),e("div",{staticClass:"info-list"},t._l(t.detailInfo.detailImage[0].list,(function(s,i){return e("img",{key:i,attrs:{src:s,alt:""},on:{load:t.imgLoad}})})),0)]):t._e()},N=[],z={name:"DetailGoodsInfo",props:{detailInfo:{type:Object}},data(){return{counter:0,imagesLength:0}},methods:{imgLoad(){++this.counter===this.imagesLength&&this.$emit("imageLoad")}},watch:{detailInfo(){this.imagesLength=this.detailInfo.detailImage[0].list.length}}},M=z,R=(0,d.Z)(M,G,N,!1,null,"4b824e10",null),W=R.exports,A=function(){var t=this,s=t.$createElement,e=t._self._c||s;return 0!==Object.keys(t.paramInfo).length?e("div",{staticClass:"param-info"},[t._l(t.paramInfo.sizes,(function(s,i){return e("table",{key:i,staticClass:"info-size"},t._l(s,(function(s,i){return e("tr",{key:i},t._l(s,(function(s,i){return e("td",{key:i},[t._v(t._s(s))])})),0)})),0)})),e("table",{staticClass:"info-param"},t._l(t.paramInfo.infos,(function(s,i){return e("tr",{key:i},[e("td",{staticClass:"info-param-key"},[t._v(t._s(s.key))]),e("td",{staticClass:"param-value"},[t._v(t._s(s.value))])])})),0),0!==t.paramInfo.image.length?e("div",{staticClass:"info-img"},[e("img",{attrs:{src:t.paramInfo.image,alt:""}})]):t._e()],2):t._e()},U=[],q={name:"DetailParamInfo",props:{paramInfo:{type:Object,default(){return{}}}}},H=q,J=(0,d.Z)(H,A,U,!1,null,"9fad0c24",null),K=J.exports,Q=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",[0!==Object.keys(t.commentInfo).length?e("div",{staticClass:"comment-info"},[t._m(0),e("div",{staticClass:"info-user"},[e("img",{attrs:{src:t.commentInfo.user.avatar,alt:""}}),e("span",[t._v(t._s(t.commentInfo.user.uname))])]),e("div",{staticClass:"info-detail"},[e("p",[t._v(t._s(t.commentInfo.content))]),e("div",{staticClass:"info-other"},[e("span",{staticClass:"date"},[t._v(t._s(t._f("showDate")(t.commentInfo.created)))]),e("span",[t._v(t._s(t.commentInfo.style))])]),e("div",{staticClass:"info-imgs"},t._l(t.commentInfo.images,(function(t,s){return e("img",{key:s,attrs:{src:t}})})),0)])]):t._e()])},V=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"info-header"},[e("div",{staticClass:"header-title"},[t._v("用户评价")]),e("div",{staticClass:"header-more"},[t._v(" 更多 "),e("i",{staticClass:"arrow-right"})])])}],X=e(2815),tt={name:"DetailCommentInfo",props:{commentInfo:{type:Object}},filters:{showDate:function(t){let s=new Date(1e3*t);return(0,X.p)(s,"yyyy-MM-dd")}}},st=tt,et=(0,d.Z)(st,Q,V,!1,null,"1ccbb001",null),it=et.exports,at=e(80),ot=e(7639),nt=function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"bottom-bar"},[t._m(0),e("div",{staticClass:"bar-item bar-right"},[e("div",{staticClass:"cart",on:{click:t.addToCart}},[t._v("加入购物车")]),e("div",{staticClass:"buy"},[t._v("购买")])])])},lt=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"bar-item bar-left"},[e("div",[e("i",{staticClass:"icon service"}),e("span",{staticClass:"text"},[t._v("客服")])]),e("div",[e("i",{staticClass:"icon shop"}),e("span",{staticClass:"text"},[t._v("店铺")])]),e("div",[e("i",{staticClass:"icon select"}),e("span",{staticClass:"text"},[t._v("收藏")])])])}],rt={name:"DetailBottomBar",methods:{addToCart(){this.$emit("addCart")}}},ct=rt,dt=(0,d.Z)(ct,nt,lt,!1,null,"0caabb58",null),mt=dt.exports,ft={name:"Detail",components:{DetailNavBar:f,DetailSwiper:$,DetailBaseInfo:P,DetailShopInfo:j,Scroll:F.Z,DetailGoodsInfo:W,DetailParamInfo:K,DetailCommentInfo:it,GoodsList:at.Z,DetailBottomBar:mt},data(){return{iid:null,topImages:[],goods:{},shop:{},detailInfo:{},paramInfo:{},commentInfo:{},recommendList:[],itemImgListener:null,themeTopYs:[],getThemeTopY:null,currentIndex:0}},created(){this.iid=this.$route.params.iid,p(this.iid).then((t=>{const s=t.data.result;this.topImages=s.itemInfo.topImages,this.goods=new v(s.itemInfo,s.columns,s.shopInfo.services),this.shop=new _(s.shopInfo),this.detailInfo=s.detailInfo,this.paramInfo=new g(s.itemParams.info,s.itemParams.rule),0!==s.rate.cRate&&(this.commentInfo=s.rate.list[0]),u().then(((t,s)=>{s||(this.recommendList=t.data.data.list)}))}))},updated(){this.themeTopYs=[],this.themeTopYs.push(0),this.themeTopYs.push(this.$refs.params.$el.offsetTop),this.themeTopYs.push(this.$refs.comment.$el.offsetTop),this.themeTopYs.push(this.$refs.recommend.$el.offsetTop),console.log(this.themeTopYs)},methods:{imageLoad(){this.$ref.scroll.refresh()},titleClick(t){console.log(t),this.$refs.scroll.scrollTo(0,-this.themeTopYs[t],200)},contentScroll(t){const s=-t.y;let e=this.themeTopYs.length;for(let i=0;i<e;i++)this.currentIndex!==i&&(i<e-1&&s>=this.themeTopYs[i]&&s<this.themeTopYs[i+1]||i===e-1&&s>=this.themeTopYs[i])&&(this.currentIndex=i,this.$refs.nav.currentIndex=this.currentIndex);this.isShowBackTop=-t.y>3e3},addToCart(){const t={};t.iid=this.iid,t.imgURL=this.topImages[0],t.title=this.goods.title,t.desc=this.goods.desc,t.newPrice=this.goods.nowPrice,this.$store.dispatch("addCart",t)}},mixins:[ot.x,ot.s],mounted(){},destroyed(){this.$bus.$off("itemImageLoad",this.itemImgListener)}},ht=ft,pt=(0,d.Z)(ht,i,a,!1,null,"5f865690",null),ut=pt.exports},228:function(t,s,e){t.exports=e.p+"img/back.2905f178.svg"}}]);
  //# sourceMappingURL=540.040530c2.js.map