chunk-6860eab2.48f43871.js 8.2 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6860eab2"],{"55a8":function(t,e,s){},"700a":function(t,e,s){"use strict";var o=s("55a8"),i=s.n(o);i.a},e037:function(t,e,s){"use strict";s.r(e);var o,i=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,"right-arrow":"","right-icon":"share"},on:{"click-left":t.prev,"click-right":t.right}}),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),s("van-popup",{style:{width:"80%"},model:{value:t.isPoster,callback:function(e){t.isPoster=e},expression:"isPoster"}},[s("img",{staticStyle:{width:"100%",height:"100%"},attrs:{src:t.src}}),s("vue-canvas-poster",{staticClass:"poster",staticStyle:{display:"none"},attrs:{widthPixels:1e3,painting:t.painting},on:{success:t.success,fail:t.fail}})],1)],1)},a=[],n=(s("b0c0"),s("ac1f"),s("5319"),s("ade3")),c=(s("4b0a"),s("2bb1")),r=(s("7844"),s("5596")),d=(s("ab71"),s("58e6")),l=(s("8a58"),s("e41f")),u=(s("66cf"),s("343b")),p=(s("e7e5"),s("d399")),f=s("2b0e"),h=s("85b3"),m=s("7cc0"),g=s("ed72"),v=s("a65e"),x=s("3050"),b=s("d635"),_=s("33a5"),k=s.n(_);p["a"].setDefaultOptions({duration:5e3}),f["a"].use(u["a"]),f["a"].use(l["a"]),f["a"].use(k.a);var C={name:"GoodsView",components:(o={},Object(n["a"])(o,d["a"].name,d["a"]),Object(n["a"])(o,x["a"].name,x["a"]),Object(n["a"])(o,r["a"].name,r["a"]),Object(n["a"])(o,c["a"].name,c["a"]),Object(n["a"])(o,h["a"].name,h["a"]),Object(n["a"])(o,m["a"].name,m["a"]),Object(n["a"])(o,g["a"].name,g["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:{},isPoster:!1,html:"",src:"",painting:{}}},created:function(){var t=this.$storage.get("users",!0);this.cartCount=null!=t?t.shop_count:0,this.onLoad()},methods:{right:function(){this.isPoster=!0},success:function(t){this.src=t},fail:function(t){console.log("fail",t)},onLoad:function(){var t=this,e=b["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 o=t.$request.domain()+"static/images/loader.gif";t.html=e.data.goods.content.replace(/src=/g," data-loading='"+o+"' data-src="),t.attribute=e.data.attr,t.comments=e.data.comments,t.item=e.data.item,t.images=e.data.photo,t.painting={width:"550px",height:"876px",background:"#f4f5f7",views:[{type:"image",url:void 0!=t.images[0]?t.images[0]:s("0f7b"),css:{top:"30px",left:"25px",width:"500px",height:"432px"}},{type:"text",text:t.products.title,css:{top:"487px",left:"25px",textIndent:"0px",color:"#666666",fontSize:"22px",width:"460px",lineHeight:"33px",maxLines:2}},{id:"price",type:"text",text:"¥"+t.products.sell_price,css:{top:"580px",left:"25px",color:"#E5463E",fontSize:"36px",fontWeight:"bold"}},{type:"text",text:"¥"+t.products.market_price,css:{top:"639px",left:"25px",color:"#999999",fontSize:"26px",fontWeight:"bold",textDecoration:"line-through"}},{type:"text",text:"长按或扫描二维码",css:{fontSize:"18px",color:"#999999",bottom:"22px",left:"385px"}},{type:"text",text:"A3Mall B2C商城",css:{left:"26px",bottom:"22px",fontSize:"18px",color:"#999999"}},{type:"qrcode",content:window.location.href,css:{bottom:"50px",right:"26px",color:"#000",width:"130px",height:"130px"}}]}})).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(p["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(p["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(p["a"])(e.info)):Object(p["a"])(e.info)})).catch((function(t){Object(p["a"])("网络出错,请检查网络是否连接")}))})).catch((function(){t.$storage.set("VUE_REFERER","/goods/view/"+t.$route.params.id),t.$router.push("/public/login")})):(Object(p["a"])("请选择规格!"),!1);this.isSkuStatus=!0},prev:function(){this.$tools.prev()}}},S=C,y=(s("700a"),s("2877")),$=Object(y["a"])(S,i,a,!1,null,"5d168712",null);e["default"]=$.exports}}]);