chunk-44ef8672.e7c4f5b1.js 6.6 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-44ef8672"],{"5cc4":function(t,e,s){"use strict";var o=s("b9c8"),a=s.n(o);a.a},b9c8:function(t,e,s){},e037:function(t,e,s){"use strict";s.r(e);var o,a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",[s("nav-bar",{attrs:{title:"商品详情","left-arrow":"",fixed:!0,placeholder:!0,"z-index":9999},on:{"click-left":t.prev}}),s("van-pull-refresh",{on:{refresh:t.onRefresh},model:{value:t.isRefresh,callback:function(e){t.isRefresh=e},expression:"isRefresh"}},[s("van-swipe",{staticClass:"swiper-box",attrs:{loop:!0},on:{change:t.onChange},scopedSlots:t._u([{key:"indicator",fn:function(){return[s("div",{staticClass:"custom-indicator"},[t._v(" "+t._s(t.current+1)+" / "+t._s(t.images.length)+" ")])]},proxy:!0}])},t._l(t.images,(function(t,e){return s("van-swipe-item",{key:e},[s("img",{attrs:{src:t}})])})),1),s("div",{staticClass:"goods-price"},[s("div",{staticClass:"price"},[s("span",[t._v("¥"),s("i",[t._v(t._s(t.products.sell_price))])]),s("span",[t._v("原价格"),s("i",[t._v("¥"+t._s(t.products.market_price))])])])]),s("div",{staticClass:"goods-info clear"},[s("div",{staticClass:"title"},[t._v(" "+t._s(t.products.title)+" ")]),s("div",{staticClass:"goods-info-box"},[s("span",[t._v("库存: "+t._s(t.products.store_nums)+"件")]),s("span",[t._v("销量: "+t._s(t.products.sale)+"件")])])]),s("div",{staticClass:"goods-comments clear"},[s("div",{staticClass:"title"},[s("span",[t._v("商品评价")]),t.comments.length>0?s("span",{on:{click:function(e){return t.$router.push("/comments/goods/"+t.$route.params.id)}}},[t._v("更多 >")]):t._e()]),t.comments.length<=0?s("div",{staticClass:"comments-empty"},[t._v("该商品还没有评论哦!")]):t._e(),t.comments.length>0?s("div",{staticClass:"goods-comments-list clear"},t._l(t.comments,(function(e,o){return s("div",{key:o,staticClass:"goods-comments-box clear"},[s("div",{staticClass:"t"},[s("div",{staticClass:"u"},[s("span",[s("img",{attrs:{src:e.avatar}})]),s("span",[t._v(t._s(e.username))])]),s("div",{staticClass:"time"},[t._v(t._s(e.time))])]),s("div",{staticClass:"c"},[t._v(t._s(e.content))]),e.reply_content?s("div",{staticClass:"d"},[s("div",{staticClass:"d-1"},[t._v("商家回复")]),s("div",{staticClass:"d-2"},[t._v(t._s(e.reply_content))])]):t._e()])})),0):t._e()]),s("div",{staticClass:"goods-content clear"},[s("div",{staticClass:"title"},[t._v("图文详情")]),s("div",{directives:[{name:"lazy-container",rawName:"v-lazy-container",value:{selector:"img"},expression:"{ selector: 'img' }"}],staticClass:"clear",domProps:{innerHTML:t._s(t.html)}})])],1),s("sku-action",{attrs:{goods:t.products,attribute:t.attribute,item:t.item,"goods-info":t.selectedGoodsInfo,fields:t.fields},on:{"update:goodsInfo":function(e){t.selectedGoodsInfo=e},"update:goods-info":function(e){t.selectedGoodsInfo=e}},model:{value:t.isSkuStatus,callback:function(e){t.isSkuStatus=e},expression:"isSkuStatus"}}),s("goods-action",[s("goods-action-icon",{attrs:{icon:"home",text:"首页"},on:{click:function(e){return t.$router.replace("/")}}}),s("goods-action-icon",{attrs:{icon:"cart",text:"购物车",count:t.cartCount},on:{click:function(e){return t.$router.replace("/cart/index")}}}),s("goods-action-icon",{attrs:{icon:"collect",text:"收藏",active:t.collect},on:{click:t.favorite}}),s("goods-action-button",{attrs:{type:"cart",text:"加入购物车"},on:{click:t.onAddCartClicked}}),s("goods-action-button",{attrs:{type:"buy",text:"立即购买"},on:{click:t.onBuyClicked}})],1)],1)},i=[],n=(s("b0c0"),s("ac1f"),s("5319"),s("ade3")),c=(s("4b0a"),s("2bb1")),r=(s("7844"),s("5596")),d=(s("ab71"),s("58e6")),u=(s("66cf"),s("343b")),l=(s("e7e5"),s("d399")),m=s("2b0e"),f=s("85b3"),p=s("7cc0"),h=s("ed72"),v=s("a65e"),g=s("3050"),_=s("d635");l["a"].setDefaultOptions({duration:5e3}),m["a"].use(u["a"]);var b={name:"GoodsView",components:(o={},Object(n["a"])(o,d["a"].name,d["a"]),Object(n["a"])(o,g["a"].name,g["a"]),Object(n["a"])(o,r["a"].name,r["a"]),Object(n["a"])(o,c["a"].name,c["a"]),Object(n["a"])(o,f["a"].name,f["a"]),Object(n["a"])(o,p["a"].name,p["a"]),Object(n["a"])(o,h["a"].name,h["a"]),Object(n["a"])(o,v["a"].name,v["a"]),o),data:function(){return{fields:["id"],isSkuStatus:!1,images:[],collect:!1,cartCount:0,current:0,isRefresh:!1,selectedGoodsInfo:{},products:{},attribute:[],comments:[],item:{},html:""}},created:function(){var t=this.$storage.get("users",!0);this.cartCount=null!=t?t.shop_count:0,this.onLoad()},methods:{onLoad:function(){var t=this,e=_["a"].get("users",!0);this.$http.getGoodsDetail({id:this.$route.params.id,token:e&&e.token?e.token:""}).then((function(e){t.collect=!!e.data.collect,t.products=e.data.goods;var s=t.$request.domain()+"static/images/loader.gif";t.html=e.data.goods.content.replace(/src=/g," data-loading='"+s+"' data-src="),t.attribute=e.data.attr,t.comments=e.data.comments,t.item=e.data.item,t.images=e.data.photo})).catch((function(e){t.$router.replace("/404")}))},favorite:function(){var t=this;this.$store.dispatch("isUsers").then((function(){t.$http.goodsDetailFavorite({id:t.$route.params.id}).then((function(e){e.status?t.collect=1==e.data:Object(l["a"])(e.info)}))})).catch((function(){t.$storage.set("VUE_REFERER","/goods/view/"+t.$route.params.id),t.$router.push("/public/login")}))},onChange:function(t){this.current=t},onRefresh:function(){var t=this;setTimeout((function(){t.isRefresh=!1,t.onLoad()}),1500)},onBuyClicked:function(){var t=this;if(0!=this.isSkuStatus)return this.selectedGoodsInfo.isSubmit?void this.$store.dispatch("isUsers").then((function(){t.$router.push({path:"/cart/confirm",query:{id:t.selectedGoodsInfo.id,sku_id:t.selectedGoodsInfo.selectedSku.id,num:t.selectedGoodsInfo.num,type:"buy"}})})).catch((function(){t.$storage.set("VUE_REFERER","/goods/view/"+t.$route.params.id),t.$router.push("/public/login")})):(Object(l["a"])("请选择规格!"),!1);this.isSkuStatus=!0},onAddCartClicked:function(){var t=this;if(0!=this.isSkuStatus)return this.selectedGoodsInfo.isSubmit?void this.$store.dispatch("isUsers").then((function(){t.$http.goodsDetailAddCart({id:t.selectedGoodsInfo.id,sku_id:t.selectedGoodsInfo.selectedSku.id,num:t.selectedGoodsInfo.num}).then((function(e){t.isShow=!1,e.status?(t.cartCount=e.data.count,t.$store.commit("UPDATECART",e.data.count),Object(l["a"])(e.info)):Object(l["a"])(e.info)})).catch((function(t){Object(l["a"])("网络出错,请检查网络是否连接")}))})).catch((function(){t.$storage.set("VUE_REFERER","/goods/view/"+t.$route.params.id),t.$router.push("/public/login")})):(Object(l["a"])("请选择规格!"),!1);this.isSkuStatus=!0},prev:function(){this.$tools.prev()}}},k=b,C=(s("5cc4"),s("2877")),$=Object(C["a"])(k,a,i,!1,null,"241aa596",null);e["default"]=$.exports}}]);