(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/views/tabBar/cart"],{"20b9":function(t,e,n){"use strict";var r=n("2155"),o=n.n(r);o.a},2103:function(t,e,n){"use strict";(function(t){n("2804");r(n("66fd"));var e=r(n("b337"));function r(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},2155:function(t,e,n){},"39e4":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n("c041");function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var a=getApp(),i={data:function(){return{colors:"",statusBarHeight:20,cartList:[],current:99999,allCurrent:!1,sum:0,sumPrice:0,lock:!1,bottomShow:"",showHeader:!1}},components:{},props:{},onLoad:function(t){this.bottomShow=0},onReady:function(){},onShow:function(){var t=(0,r.getCart)()||[];this.setData({colors:a.globalData.newColor,current:"99999",cartList:t,allCurrent:!1,sum:0,sumPrice:0})},onHide:function(){},onUnload:function(){},onPullDownRefresh:function(){},onReachBottom:function(){},onShareAppMessage:function(){},methods:{setCurrent:function(t,e){var n;if(1!=t.status){var r=this.cartList,a=this.cartList[e];a.current=!a.current;var i="cartList["+e+"]",u=!1,s=[];r.forEach((function(t){1==t.current&&s.push(t)})),s.length==r.length&&(u=!0),this.setData((n={},o(n,i,a),o(n,"allCurrent",u),n)),this.getSumprice()}},onshowDel:function(t,e){this.setData({current:e,lock:!0})},delItem:function(e,n){this.cartList.splice(n,1),this.setData({current:"9999",lock:!1}),t.showToast({title:"删除成功",icon:"none"}),this.setTabBarBadge()},oncencal:function(){this.setData({current:"99999"})},onsub:function(t,e){if(!(1==t.status||t.number<=1)){var n=t.number-1;this.$set(t,"number",n),this.getSumprice()}},onadd:function(t,e){if(1!=t.status){var n=t.number+1;this.$set(t,"number",n),this.getSumprice()}},setAllCurrent:function(){var e=this,n=e.cartList,r=e.allCurrent,o=!0;n.forEach((function(e){1==e.status&&(t.showToast({title:"存在失效商品",icon:"none"}),o=!1)})),0!=o&&(n.forEach((function(t){t.current=!r})),r=!r,e.setData({cartList:n,allCurrent:r}),e.getSumprice())},getSumprice:function(){var t=this,e=t.cartList,n="",r=[];e.forEach((function(t){1==t.current&&r.push(t)}));for(var o=r.length,a=0;a<o;a++){var i=r[a];n=i.selectSku?(Number(n)+Number(i.selectSku.money*i.number)).toFixed(2):(Number(n)+Number(i.money*i.number)).toFixed(2)}t.sum=o,t.sumPrice=n},ontouchend:function(){var t=this;console.log("触发了touch"),this.lock&&setTimeout((function(){t.setData({lock:!1})}),100)},clearInvalid:function(){var e=this;this.cartList.forEach((function(t,n){1==t.status&&e.cartList.splice(n,1),t.current=!1})),t.showToast({title:"清空成功~",icon:"none"}),this.setTabBarBadge()},delectAll:function(){this.cartList=[],(0,r.removeCart)(),this.setTabBarBadge()},setTabBarBadge:function(){var e=String(this.cartList.length);0!=e?t.setTabBarBadge({index:2,text:e}):t.removeTabBarBadge({index:2})},jumpDetails:function(e,n){1==e.status||this.lock||t.navigateTo({url:"/pages/views/goods/goodsDetails"})},settlement:function(){if(0!=this.sum){t.showLoading({title:"提交中..."});var e=[];this.cartList.forEach((function(t){1==t.current&&e.push(t)})),(0,r.setGoodsData)(e),setTimeout((function(){t.hideLoading(),t.navigateTo({url:"/pages/views/order/confirmOrder"})}),1e3)}},onStroll:function(){t.switchTab({url:"/pages/views/tabBar/category"})}}};e.default=i}).call(this,n("543d")["default"])},6940:function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return r}));var o=function(){var t=this,e=t.$createElement,n=(t._self._c,0!==t.cartList.length?t.__map(t.cartList,(function(e,n){var r=t.__get_orig(e),o=e.selectSku?(Number(e.selectSku.money)*e.number).toFixed(2):null,a=e.selectSku?null:(Number(e.money)*e.number).toFixed(2);return{$orig:r,g0:o,g1:a}})):null);t.$mp.data=Object.assign({},{$root:{l0:n}})},a=[]},b337:function(t,e,n){"use strict";n.r(e);var r=n("6940"),o=n("b707");for(var a in o)"default"!==a&&function(t){n.d(e,t,(function(){return o[t]}))}(a);n("20b9");var i,u=n("f0c5"),s=Object(u["a"])(o["default"],r["b"],r["c"],!1,null,"3559321d",null,!1,r["a"],i);e["default"]=s.exports},b707:function(t,e,n){"use strict";n.r(e);var r=n("39e4"),o=n.n(r);for(var a in r)"default"!==a&&function(t){n.d(e,t,(function(){return r[t]}))}(a);e["default"]=o.a}},[["2103","common/runtime","common/vendor"]]]);