You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jiaojiu/dist/js/chunk-ac48065c.cda05a22.js

2 lines
5.2 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ac48065c"],{"0647":function(t,e,c){},1257:function(t,e,c){"use strict";var n=c("98d4"),i=c.n(n);i.a},1744:function(t,e,c){"use strict";var n=c("3a11"),i=c.n(n);i.a},"324e":function(t,e,c){"use strict";var n=c("9734"),i=c.n(n);i.a},"3a11":function(t,e,c){},5981:function(t,e,c){},9734:function(t,e,c){},"98d4":function(t,e,c){},c228:function(t,e,c){"use strict";c.r(e);var n=function(){var t=this,e=t.$createElement,c=t._self._c||e;return c("div",{staticClass:"cart"},[c("NavBar",{staticClass:"nav-bar"},[c("div",{attrs:{slot:"center"},slot:"center"},[t._v("购物车("+t._s(t.length)+")")])]),this.cartlistisexit?c("CartList"):t._e(),c("CartBottomBar")],1)},i=[],s=c("5530"),a=function(){var t=this,e=t.$createElement,c=t._self._c||e;return c("div",{staticClass:"cart"},[c("Scroll",{ref:"scroll",staticClass:"content",attrs:{"probe-type":3,"pull-up-load":!0},on:{pullingUp:t.loadMore,pullingDown:t.pullingDown}},t._l(t.list,(function(e,n){return c("CartListItem",{key:n,attrs:{"item-info":e}},[t._v(t._s(e)+"> ")])})),1)],1)},r=[],o=c("8d33"),l=function(){var t=this,e=t.$createElement,c=t._self._c||e;return this.isexit?c("div",{attrs:{id:"shop-item"}},[c("van-swipe-cell",{scopedSlots:t._u([{key:"right",fn:function(){return[c("van-button",{staticClass:"delete-button",attrs:{square:"",text:"删除",type:"danger"},on:{click:t.remove}})]},proxy:!0}],null,!1,1181944412)},[c("van-card",{staticClass:"goods-card",attrs:{num:t.itemInfo.count,price:t.itemInfo.price,desc:t.itemInfo.desc,title:t.itemInfo.title,thumb:t.itemInfo.image}})],1)],1):t._e()},u=[],f=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"check-button",class:{check:t.isCheck}},[n("img",{attrs:{src:c("94a1"),alt:""}})])},h=[],d={name:"CheckButton",props:{isCheck:{type:Boolean,default:!1}}},m=d,p=(c("1744"),c("2877")),v=Object(p["a"])(m,f,h,!1,null,"7f236110",null),k=v.exports,b={name:"CartListItem",components:{CheckButton:k},data:function(){return{isexit:!0}},props:{itemInfo:{type:Object,default:function(){return{}}}},methods:{remove:function(){this.$store.commit("REMOVE_TO_DATA",this.itemInfo.iid),this.isexit=!1}}},C=b,_=(c("efc6"),Object(p["a"])(C,l,u,!1,null,"8854e116",null)),g=_.exports,B=c("2f62"),L={name:"CartList",components:{Scroll:o["a"],CartListItem:g},computed:Object(s["a"])({},Object(B["b"])({list:"cartList"})),activated:function(){this.$refs.scroll.refresh()},methods:{loadMore:function(){this.$refs.scroll.refresh()},pullingDown:function(){var t=this;this.pullingdown=!0,setTimeout((function(){t.pullingdown=!1,t.$refs.scroll.finishPullDown()}),0)}}},$=L,x=(c("324e"),Object(p["a"])($,a,r,!1,null,"913925ea",null)),O=x.exports,w=function(){var t=this,e=t.$createElement,c=t._self._c||e;return c("div",{staticClass:"bottom-menu"},[c("CheckButton",{staticClass:"select-all",on:{checkBtnClick:t.checkBtnClick},model:{value:t.isSelectAll,callback:function(e){t.isSelectAll=e},expression:"isSelectAll"}}),c("span",{staticClass:"total-price"},[t._v("合计: "+t._s(t.totalPrice))]),c("span",{staticClass:"buy-product",on:{click:t.btnclick}},[t._v("去计算("+t._s(t.$store.getters.cartLength)+")")])],1)},j=[],I=(c("4de4"),c("7db0"),c("4160"),c("13d5"),c("b680"),c("159b"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("div",{staticClass:"icon-selector",class:{"selector-active":t.checked},on:{click:t.selectItem}},[n("img",{attrs:{src:c("94a1"),alt:""}})])])}),E=[],y={name:"CheckButton",props:{value:{type:Boolean,default:!0}},data:function(){return{checked:this.value}},methods:{selectItem:function(){this.$emit("checkBtnClick")}},watch:{value:function(t){this.checked=t}}},S=y,A=(c("1257"),Object(p["a"])(S,I,E,!1,null,"43f0c0b6",null)),D=A.exports,M={name:"BottomBar",components:{CheckButton:D},computed:Object(s["a"])(Object(s["a"])({},Object(B["b"])(["cartList"])),{},{totalPrice:function(){return"¥"+this.cartList.filter((function(t){return t.checked})).reduce((function(t,e){return t+e.price*e.count}),0).toFixed(2)},checkLength:function(){return!this.cartList.filter((function(t){return t.checked})).length},isSelectAll:function(){return 0!==this.cartList.length&&!this.cartList.find((function(t){return!t.checked}))}}),methods:{checkBtnClick:function(){var t=this.$store.getters.cartList.find((function(t){return!t.checked}));t?this.$store.state.cartList.forEach((function(t){t.checked=!0})):this.$store.state.cartList.forEach((function(t){t.checked=!1}))},btnclick:function(){this.isSelectAll?this.$router.push("/order"):this.$toast.show("请选购商品",2e3)}}},P=M,T=(c("d42a"),Object(p["a"])(P,w,j,!1,null,"0e565102",null)),J=T.exports,N=c("a7ac"),q={name:"Cart",components:{CartBottomBar:J,NavBar:N["a"],CartList:O},computed:Object(s["a"])({},Object(B["b"])({length:"cartLength",list:"cartList"})),data:function(){return{cartlistisexit:!0}},mounted:function(){var t=this;this.$bus.$on("clearcartlist",(function(){t.cartlistisexit=!1,t.cartlistisexit=!0}))}},F=q,R=(c("faa0"),Object(p["a"])(F,n,i,!1,null,"12198472",null));e["default"]=R.exports},d42a:function(t,e,c){"use strict";var n=c("d92f"),i=c.n(n);i.a},d92f:function(t,e,c){},efc6:function(t,e,c){"use strict";var n=c("5981"),i=c.n(n);i.a},faa0:function(t,e,c){"use strict";var n=c("0647"),i=c.n(n);i.a}}]);
//# sourceMappingURL=chunk-ac48065c.cda05a22.js.map