text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-c3064c6e"],{"0c69":function(t,e,i){},"1b7b":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"cart"},[i("Nav"),t._l(t.list,(function(e,n){return i("Item",{key:e.skuId,attrs:{index:n,info:e,"is-checked":e.isChecked},on:{input:t.handleItemSelect,handleDelete:t.handleDelete}})})),i("Tabbar",{attrs:{amount:t.amount,value:t.isAllSelect},on:{input:t.handleAllSelect,handleSubmit:t.handleSubmit}}),t.isSkeletonShow?i("Skeleton"):t._e(),t.list&&t.list.length<=0?i("van-empty",{attrs:{description:"购物车里没有内容"}}):t._e()],2)},r=[],a=(i("a623"),i("4160"),i("d81d"),i("13d5"),i("a434"),i("159b"),function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("nav-bar",{staticClass:"nav",attrs:{title:"购物车"}}),i("div",{staticClass:"nav--placeholder",staticStyle:{width:"100%",height:"46px"}})],1)}),s=[],o=i("e590"),c={components:{NavBar:o["a"]}},u=c,l=(i("2cad"),i("2877")),d=Object(l["a"])(u,a,s,!1,null,"11a40252",null),h=d.exports,f=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"card__item"},[i("van-checkbox",{staticStyle:{padding:"0 10px 0 16px"},attrs:{"icon-size":"18px","checked-color":t.variables.theme},model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}}),i("van-swipe-cell",{staticStyle:{width:"100%"},attrs:{"before-close":t.beforeClose},scopedSlots:t._u([{key:"right",fn:function(){return[i("van-button",{staticStyle:{height:"100%"},attrs:{square:"",text:"删除",type:"danger"}})]},proxy:!0}])},[i("van-card",{attrs:{num:t.info.num,tag:t.info.tag,price:t._f("toDecimal")(t.info.price),desc:t.info.desc,title:t.info.title,thumb:t.info.img,"origin-price":t._f("toDecimal")(t.info.oldPrice)},on:{click:t.gotoDetail},scopedSlots:t._u([{key:"tags",fn:function(){return t._l(t.info.skuAttr,(function(e,n){return i("van-tag",{key:n,staticStyle:{"margin-right":"2px"},attrs:{plain:"",color:"#999"}},[t._v(t._s(e))])}))},proxy:!0}])})],1)],1)},p=[],m=(i("a9e3"),i("cf1e")),y=i.n(m),b={model:{prop:"isChecked"},props:{index:{type:Number,default:0},info:{type:Object,default:function(){return{}}},isChecked:{type:Boolean,default:!1}},computed:{variables:function(){return y.a},checked:{get:function(){return this.isChecked},set:function(t){this.$emit("input",{val:t,idx:this.index})}}},methods:{gotoDetail:function(){this.$router.push({path:"/detail",query:{productId:this.info.productId}})},beforeClose:function(t){var e=this,i=t.position,n=t.instance;switch(i){case"cell":case"outside":n.close();break;case"right":this.$dialog.confirm({message:"确定删除吗？"}).then((function(){e.$emit("handleDelete",e.index,e.info.skuId),n.close()})).catch((function(){n.close()}));break}}}},v=b,g=(i("f3bd"),Object(l["a"])(v,f,p,!1,null,"5112abc4",null)),k=g.exports,x=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("van-submit-bar",{staticClass:"submit-bar",attrs:{price:t.amount,"button-text":"提交订单"},on:{submit:t.onSubmit}},[i("van-checkbox",{attrs:{"icon-size":"18px","checked-color":t.variables.theme},model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}},[t._v("全选")])],1),i("div",{staticClass:"submit-bar-placeholder",staticStyle:{width:"100%",height:"50px"}})],1)},S=[],C={props:{amount:{type:Number,default:0},value:{type:Boolean,default:!1}},computed:{variables:function(){return y.a},checked:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}},methods:{onSubmit:function(){this.$emit("handleSubmit")}}},w=C,_=(i("8ca2"),Object(l["a"])(w,x,S,!1,null,"388cacbd",null)),O=_.exports,$=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"skeleton"},[i("ContentLoader",{attrs:{width:"325",height:"600"}},[i("rect",{attrs:{x:"10",y:"8",rx:"3",ry:"3",width:"305",height:"30"}}),i("rect",{attrs:{x:"10",y:"45",rx:"3",ry:"3",width:"305",height:"85"}}),i("rect",{attrs:{x:"10",y:"145",rx:"3",ry:"3",width:"305",height:"85"}}),i("rect",{attrs:{x:"10",y:"245",rx:"3",ry:"3",width:"305",height:"85"}}),i("rect",{attrs:{x:"10",y:"345",rx:"3",ry:"3",width:"305",height:"85"}}),i("rect",{attrs:{x:"10",y:"445",rx:"3",ry:"3",width:"305",height:"85"}}),i("rect",{attrs:{x:"10",y:"545",rx:"3",ry:"3",width:"305",height:"85"}})])],1)},A=[],N=i("e330"),I={components:{ContentLoader:N["a"]}},j=I,E=(i("f9e1"),Object(l["a"])(j,$,A,!1,null,"483ac5f1",null)),D=E.exports,q=i("2166"),M={name:"Cart",components:{Nav:h,Item:k,Tabbar:O,Skeleton:D},data:function(){return{list:[],amount:0,isAllSelect:!1,isSkeletonShow:!0}},watch:{list:function(t){if(t&&t.length>0){var e=0;t.forEach((function(t){t.isChecked&&(e+=t.price*t.num)})),this.isAllSelect=t.every((function(t){return!0===t.isChecked})),this.amount=e}}},mounted:function(){this.getList()},methods:{getList:function(){var t=this;Object(q["c"])().then((function(e){var i=e.entry;i.forEach((function(t){t.isChecked=!1})),t.list=i||[],t.isSkeletonShow=!1}))},handleItemSelect:function(t){var e=t.val,i=t.idx,n=this.list[i];n.isChecked=e,this.$set(this.list,i,n)},handleAllSelect:function(t){var e=this.list.map((function(e){return e.isChecked=t,e}));this.list=e},handleDelete:function(t,e){var i=this;this.$toast.loading({message:"加载中...",overlay:!0,duration:0,forbidClick:!0}),Object(q["b"])({skuId:e}).then((function(e){i.list.splice(t,1),i.$toast.clear(),i.$toast.success("删除成功")}))},handleSubmit:function(){var t=this,e=this.list.reduce((function(t,e,i,n){return e.isChecked&&t.push({id:e.skuId,productId:e.productId,selectedNum:e.num}),t}),[]);e.length?this.$store.dispatch("order/setIds",e).then((function(e){t.$router.push({path:"/order/confirm"})})):this.$toast("请至少勾选一件商品")}}},B=M,K=Object(l["a"])(B,n,r,!1,null,null,null);e["default"]=K.exports},2166:function(t,e,i){"use strict";i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return s})),i.d(e,"d",(function(){return o}));var n=i("b775");function r(){return Object(n["a"])({url:"/order/cart/list",method:"get"})}function a(t){return Object(n["a"])({url:"/order/cart/add",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/order/cart/delete",method:"delete",data:t})}function o(t){return Object(n["a"])({url:"/order/cart/num",method:"get",params:t})}},"2cad":function(t,e,i){"use strict";i("441f")},"441f":function(t,e,i){},8981:function(t,e,i){},"8ca2":function(t,e,i){"use strict";i("0c69")},"92fa":function(t,e){var i=/^(attrs|props|on|nativeOn|class|style|hook)$/;function n(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}}t.exports=function(t){return t.reduce((function(t,e){var r,a,s,o,c;for(s in e)if(r=t[s],a=e[s],r&&i.test(s))if("class"===s&&("string"===typeof r&&(c=r,t[s]=r={},r[c]=!0),"string"===typeof a&&(c=a,e[s]=a={},a[c]=!0)),"on"===s||"nativeOn"===s||"hook"===s)for(o in a)r[o]=n(r[o],a[o]);else if(Array.isArray(r))t[s]=r.concat(a);else if(Array.isArray(a))t[s]=[r].concat(a);else for(o in a)r[o]=a[o];else t[s]=e[s];return t}),{})}},a434:function(t,e,i){"use strict";var n=i("23e7"),r=i("23cb"),a=i("a691"),s=i("50c4"),o=i("7b0b"),c=i("65f0"),u=i("8418"),l=i("1dde"),d=i("ae40"),h=l("splice"),f=d("splice",{ACCESSORS:!0,0:0,1:2}),p=Math.max,m=Math.min,y=9007199254740991,b="Maximum allowed length exceeded";n({target:"Array",proto:!0,forced:!h||!f},{splice:function(t,e){var i,n,l,d,h,f,v=o(this),g=s(v.length),k=r(t,g),x=arguments.length;if(0===x?i=n=0:1===x?(i=0,n=g-k):(i=x-2,n=m(p(a(e),0),g-k)),g+i-n>y)throw TypeError(b);for(l=c(v,n),d=0;d<n;d++)h=k+d,h in v&&u(l,d,v[h]);if(l.length=n,i<n){for(d=k;d<g-n;d++)h=d+n,f=d+i,h in v?v[f]=v[h]:delete v[f];for(d=g;d>g-n+i;d--)delete v[d-1]}else if(i>n)for(d=g-n;d>k;d--)h=d+n-1,f=d+i-1,h in v?v[f]=v[h]:delete v[f];for(d=0;d<i;d++)v[d+k]=arguments[d+2];return v.length=g-n+i,l}})},a623:function(t,e,i){"use strict";var n=i("23e7"),r=i("b727").every,a=i("a640"),s=i("ae40"),o=a("every"),c=s("every");n({target:"Array",proto:!0,forced:!o||!c},{every:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},e330:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i("92fa"),r=i.n(n),a=function(){return Math.random().toString(36).substring(2)},s={name:"ContentLoader",functional:!0,props:{width:{type:[Number,String],default:400},height:{type:[Number,String],default:130},speed:{type:Number,default:2},preserveAspectRatio:{type:String,default:"xMidYMid meet"},baseUrl:{type:String,default:""},primaryColor:{type:String,default:"#f9f9f9"},secondaryColor:{type:String,default:"#ecebeb"},primaryOpacity:{type:Number,default:1},secondaryOpacity:{type:Number,default:1},uniqueKey:{type:String},animate:{type:Boolean,default:!0}},render:function(t,e){var i=e.props,n=e.data,s=e.children,o=i.uniqueKey?i.uniqueKey+"-idClip":a(),c=i.uniqueKey?i.uniqueKey+"-idGradient":a();return t("svg",r()([n,{attrs:{viewBox:"0 0 "+i.width+" "+i.height,version:"1.1",preserveAspectRatio:i.preserveAspectRatio}}]),[t("rect",{style:{fill:"url("+i.baseUrl+"#"+c+")"},attrs:{"clip-path":"url("+i.baseUrl+"#"+o+")",x:"0",y:"0",width:i.width,height:i.height}}),t("defs",[t("clipPath",{attrs:{id:o}},[s||t("rect",{attrs:{x:"0",y:"0",rx:"5",ry:"5",width:i.width,height:i.height}})]),t("linearGradient",{attrs:{id:c}},[t("stop",{attrs:{offset:"0%","stop-color":i.primaryColor,"stop-opacity":i.primaryOpacity}},[i.animate?t("animate",{attrs:{attributeName:"offset",values:"-2; 1",dur:i.speed+"s",repeatCount:"indefinite"}}):null]),t("stop",{attrs:{offset:"50%","stop-color":i.secondaryColor,"stop-opacity":i.secondaryOpacity}},[i.animate?t("animate",{attrs:{attributeName:"offset",values:"-1.5; 1.5",dur:i.speed+"s",repeatCount:"indefinite"}}):null]),t("stop",{attrs:{offset:"100%","stop-color":i.primaryColor,"stop-opacity":i.primaryOpacity}},[i.animate?t("animate",{attrs:{attributeName:"offset",values:"-1; 2",dur:i.speed+"s",repeatCount:"indefinite"}}):null])])])])}}},ea6a:function(t,e,i){},f3bd:function(t,e,i){"use strict";i("8981")},f9e1:function(t,e,i){"use strict";i("ea6a")}}]);
  //# sourceMappingURL=chunk-c3064c6e.88dda4b4.js.map