chunk-3cd027a4.251a00d9.js 7.9 KB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3cd027a4"],{"11e9":function(t,o,e){var r=e("52a7"),a=e("4630"),n=e("6821"),s=e("6a99"),i=e("69a8"),c=e("c69a"),u=Object.getOwnPropertyDescriptor;o.f=e("9e1e")?u:function(t,o){if(t=n(t),o=s(o,!0),c)try{return u(t,o)}catch(e){}if(i(t,o))return a(!r.f.call(t,o),t[o])}},"37a9":function(t,o,e){"use strict";e.r(o);var r=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",{staticClass:"catindex"},[e("div",{style:"margin-bottom:"+t.margin_top},t._l(t.goods_list,function(o,r){return e("div",{key:r,staticClass:"card-root-c"},[e("van-swipe-cell",{attrs:{"right-width":65,"data-id":o.goods_id,"data-goods_sku_id":o.goods_sku_id,"on-close":t.onCloseItem}},[0!=o.show_error?e("div",{staticClass:"goods_err_div"},[t._v(t._s(o.show_error_text))]):t._e(),e("van-card",{class:0==o.show_error?"":"error_goods",attrs:{price:o.goods_price,"thumb-link":"#/cartindex/goods?id="+o.goods_id,title:o.goods_name,desc:o.goods_sku.goods_attr?o.goods_sku.goods_attr:"默认规格",centered:!0,"lazy-load":!0,thumb:""==o.goods_sku.spec_image?o.image:o.goods_sku.img_show}},[0==o.show_error?e("div",{attrs:{slot:"footer"},slot:"footer"},[e("van-stepper",{staticClass:"van-stepper-c",attrs:{"disable-input":"","async-change":"",value:o.total_num,integer:"",min:1,max:999},on:{plus:function(e){return t.onplus(r,o.goods_sku_id)},minus:function(e){return t.onsub(r,o.goods_sku_id)}}})],1):t._e()]),e("div",{staticClass:"delb",attrs:{slot:"right"},slot:"right"},[e("span",[t._v("删除")])])],1)],1)}),0),t.goods_list.length?t._e():e("div",{staticClass:"liteshop-notcont",staticStyle:{"margin-top":"130px"}},[t._m(0),e("span",{staticClass:"cont"},[t._v("购物车空空如也")])]),e("van-submit-bar",{attrs:{price:100*t.order_total_price,"button-text":"开始结算"},on:{submit:t.onSubmit}}),e("BottomTabbar",{attrs:{curactive:2}}),e("cube-view")],1)},a=[function(){var t=this,o=t.$createElement,r=t._self._c||o;return r("div",{staticClass:"img"},[r("img",{attrs:{src:e("5c25")}})])}],n=(e("c5f6"),e("ce11")),s=e("55f1"),i=e("c290"),c=e("b970"),u={components:{CubeView:n["a"],BottomTabbar:s["a"]},data:function(){return{goods_list:[],order_total_num:0,order_total_price:0,margin_top:"108px"}},created:function(){this.getCartList()},watch:{$route:function(t,o){console.log(t),"/CartIndex/cartcheck"!=t.path&&"/cartindex/goods"!=t.path||(this.margin_top="0px"),"/CartIndex"==t.path&&(this.margin_top="108px")}},methods:{onSubmit:function(){0!=this.goods_list.length?this.$router.push({path:"CartIndex/cartcheck",query:{type:"cart"}}):c["c"].fail("请添置您的购物车。")},getCartList:function(){var t=this,o="/addons/litestore/api.cart/getlists";i["a"](o,{},function(o){t.goods_list=o.data.goods_list,t.order_total_num=o.data.order_total_num,t.order_total_price=o.data.order_total_price})},onCloseItem:function(t,o){var e=this;switch(t){case"left":case"cell":case"outside":o.close();break;case"right":c["a"].confirm({message:"确定删除吗?"}).then(function(){o.close();var t="/addons/litestore/api.cart/delete";i["a"](t,{goods_id:o.$attrs["data-id"],goods_sku_id:o.$attrs["data-goods_sku_id"]},function(t){console.log(t),e.getCartList()})}).catch(function(){});break}},onplus:function(t,o){var e=this,r=e.goods_list[t],a=e.order_total_price,n="/addons/litestore/api.cart/add";i["a"](n,{goods_id:r.goods_id,goods_num:1,goods_sku_id:o},function(o){r.total_num++,e.goods_list[t]=r,e.order_total_price=e.mathadd(a,r.goods_price)})},mathadd:function(t,o){return(Number(t)+Number(o)).toFixed(2)},onsub:function(t,o){var e=this,r=e.goods_list[t],a=e.order_total_price,n="/addons/litestore/api.cart/sub";i["a"](n,{goods_id:r.goods_id,goods_sku_id:o},function(o){r.total_num--,r.total_num>0&&(e.goods_list[t]=r,e.order_total_price=e.mathsub(a,r.goods_price))})},mathsub:function(t,o){return(Number(t)-Number(o)).toFixed(2)},togoods:function(t){this.$router.push({path:"cartindex/goods",query:{id:t}})}}},d=u,l=(e("4da4"),e("2877")),_=Object(l["a"])(d,r,a,!1,null,null,null);o["default"]=_.exports},"37d6":function(t,o,e){},"3e4a":function(t,o,e){"use strict";var r=e("8d5d"),a=e.n(r);a.a},"4da4":function(t,o,e){"use strict";var r=e("9d0c"),a=e.n(r);a.a},"55f1":function(t,o,e){"use strict";var r=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("div",[e("van-tabbar",{style:"background-color:"+t.gcfg.BackgroundColor,model:{value:t.active,callback:function(o){t.active=o},expression:"active"}},[e("van-tabbar-item",{attrs:{icon:"shop",to:"/"}},[t._v("首页")]),e("van-tabbar-item",{attrs:{icon:"bars",to:"PageList"}},[t._v("搜索")]),e("van-tabbar-item",{attrs:{icon:"cart",to:"CartIndex"}},[t._v("购物车")]),e("van-tabbar-item",{attrs:{icon:"manager",to:"My"}},[t._v("我的")])],1)],1)},a=[],n=(e("c290"),{props:["curactive"],data:function(){return{active:this.curactive,gcfg:[]}},methods:{},created:function(){this.gcfg=this.$store.getters.getGcfg},watch:{"$store.state.gcfg":function(){this.gcfg=this.$store.getters.getGcfg}}}),s=n,i=(e("3e4a"),e("2877")),c=Object(i["a"])(s,r,a,!1,null,null,null);o["a"]=c.exports},"5c25":function(t,o,e){t.exports=e.p+"img/no-data.edbbd919.png"},"5dbc":function(t,o,e){var r=e("d3f4"),a=e("8b97").set;t.exports=function(t,o,e){var n,s=o.constructor;return s!==e&&"function"==typeof s&&(n=s.prototype)!==e.prototype&&r(n)&&a&&a(t,n),t}},"8b97":function(t,o,e){var r=e("d3f4"),a=e("cb7c"),n=function(t,o){if(a(t),!r(o)&&null!==o)throw TypeError(o+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,o,r){try{r=e("9b43")(Function.call,e("11e9").f(Object.prototype,"__proto__").set,2),r(t,[]),o=!(t instanceof Array)}catch(a){o=!0}return function(t,e){return n(t,e),o?t.__proto__=e:r(t,e),t}}({},!1):void 0),check:n}},"8d5d":function(t,o,e){},9093:function(t,o,e){var r=e("ce10"),a=e("e11e").concat("length","prototype");o.f=Object.getOwnPropertyNames||function(t){return r(t,a)}},"9d0c":function(t,o,e){},aa77:function(t,o,e){var r=e("5ca1"),a=e("be13"),n=e("79e5"),s=e("fdef"),i="["+s+"]",c="​…",u=RegExp("^"+i+i+"*"),d=RegExp(i+i+"*$"),l=function(t,o,e){var a={},i=n(function(){return!!s[t]()||c[t]()!=c}),u=a[t]=i?o(_):s[t];e&&(a[e]=u),r(r.P+r.F*i,"String",a)},_=l.trim=function(t,o){return t=String(a(t)),1&o&&(t=t.replace(u,"")),2&o&&(t=t.replace(d,"")),t};t.exports=l},c153:function(t,o,e){"use strict";var r=e("37d6"),a=e.n(r);a.a},c5f6:function(t,o,e){"use strict";var r=e("7726"),a=e("69a8"),n=e("2d95"),s=e("5dbc"),i=e("6a99"),c=e("79e5"),u=e("9093").f,d=e("11e9").f,l=e("86cc").f,_=e("aa77").trim,f="Number",g=r[f],p=g,h=g.prototype,v=n(e("2aeb")(h))==f,m="trim"in String.prototype,b=function(t){var o=i(t,!1);if("string"==typeof o&&o.length>2){o=m?o.trim():_(o,3);var e,r,a,n=o.charCodeAt(0);if(43===n||45===n){if(e=o.charCodeAt(2),88===e||120===e)return NaN}else if(48===n){switch(o.charCodeAt(1)){case 66:case 98:r=2,a=49;break;case 79:case 111:r=8,a=55;break;default:return+o}for(var s,c=o.slice(2),u=0,d=c.length;u<d;u++)if(s=c.charCodeAt(u),s<48||s>a)return NaN;return parseInt(c,r)}}return+o};if(!g(" 0o1")||!g("0b1")||g("+0x1")){g=function(t){var o=arguments.length<1?0:t,e=this;return e instanceof g&&(v?c(function(){h.valueOf.call(e)}):n(e)!=f)?s(new p(b(o)),e,g):b(o)};for(var x,k=e("9e1e")?u(p):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),y=0;k.length>y;y++)a(p,x=k[y])&&!a(g,x)&&l(g,x,d(p,x));g.prototype=h,h.constructor=g,e("2aba")(r,f,g)}},ce11:function(t,o,e){"use strict";var r=function(){var t=this,o=t.$createElement,e=t._self._c||o;return e("transition",{attrs:{name:"page-move"}},[e("router-view",{staticClass:"cube-view"})],1)},a=[],n={methods:{}},s=n,i=(e("c153"),e("2877")),c=Object(i["a"])(s,r,a,!1,null,null,null);o["a"]=c.exports},fdef:function(t,o){t.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"}}]);
//# sourceMappingURL=chunk-3cd027a4.251a00d9.js.map