(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/cart/cart"],{"4bf1":function(t,s,i){"use strict";i.r(s);var e=i("87cc"),o=i("9c87");for(var n in o)"default"!==n&&function(t){i.d(s,t,(function(){return o[t]}))}(n);i("b980");var c,l=i("f0c5"),h=Object(l["a"])(o["default"],e["b"],e["c"],!1,null,null,null,!1,e["a"],c);s["default"]=h.exports},8773:function(t,s,e){"use strict";(function(t){Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var o=n(e("a34a"));function n(t){return t&&t.__esModule?t:{default:t}}function c(t,s,i,e,o,n,c){try{var l=t[n](c),h=l.value}catch(d){return void i(d)}l.done?s(h):Promise.resolve(h).then(e,o)}function l(t){return function(){var s=this,i=arguments;return new Promise((function(e,o){var n=t.apply(s,i);function l(t){c(n,e,o,l,h,"next",t)}function h(t){c(n,e,o,l,h,"throw",t)}l(void 0)}))}}var h=function(){e.e("components/empty").then(function(){return resolve(e("9467"))}.bind(null,e)).catch(e.oe)},d={components:{empty:h},data:function(){return{sumPrice:"0.00",headerPosition:"fixed",headerTop:null,statusTop:null,selectedList:[],isAllselected:!1,goodsList:[],theIndex:null,oldIndex:null,isStop:!1,startingPrice:0}},onShow:function(){this.goodsList=t.getStorageSync("cartlist");var s=this.goodsList.length,i=[];if(s<=0)this.isAllselected=!1,this.sumPrice=0;else{for(var e=[],o=0;o0){for(var n=0;n=0?"fixed":"absolute",this.headerTop=t.scrollTop>=0?null:0,this.statusTop=t.scrollTop>=0?null:-this.statusHeight+"px"},onPullDownRefresh:function(){setTimeout((function(){t.stopPullDownRefresh()}),1e3)},filters:{toFixed:function(t){return parseFloat(t).toFixed(2)}},onLoad:function(){this.goodsList=t.getStorageSync("cartlist");for(var s="",i=0;i1?this.isStop=!0:(this.oldIndex=this.theIndex,this.theIndex=null,this.initXY=[s.touches[0].pageX,s.touches[0].pageY])},touchMove:function(t,s){var i=this;if(s.touches.length>1)this.isStop=!0;else{var e=s.touches[0].pageX-this.initXY[0],o=s.touches[0].pageY-this.initXY[1];this.isStop||Math.abs(e)<5||(Math.abs(o)>Math.abs(e)?this.isStop=!0:e<0?(this.theIndex=t,this.isStop=!0):e>0&&null!=this.theIndex&&this.oldIndex==this.theIndex&&(this.oldIndex=t,this.theIndex=null,this.isStop=!0,setTimeout((function(){i.oldIndex=null}),150)))}},touchEnd:function(t,s){this.isStop=!1},toGoods:function(t){},toConfirmation:function(){var s=t.getStorageSync("userinfo");if(""==s.uid||void 0==s.uid)t.showModal({title:"温馨提示",content:"您还没登录,请登录",success:function(s){s.confirm?t.navigateTo({url:"/pages/user/checklogin"}):s.cancel&&console.log("用户点击取消")}});else{wx.requestSubscribeMessage({tmplIds:["xrga_0YidesSMMfOxNaLmzvpfu42RdOYaA85D8ru88k"],success:function(t){console.log(t,"返回什么")}});for(var i=[],e=this.goodsList.length,o=0;o0)this.deleteGoods(this.selectedList[0]);this.selectedList=[],this.isAllselected=this.selectedList.length==this.goodsList.length&&this.goodsList.length>0,this.sum()},selected:function(t){this.goodsList[t].selected=!this.goodsList[t].selected;var s=this.selectedList.indexOf(this.goodsList[t].id);s>-1?this.selectedList.splice(s,1):this.selectedList.push(this.goodsList[t].id),this.isAllselected=this.selectedList.length==this.goodsList.length,this.sum()},allSelect:function(){for(var t=this.goodsList.length,s=[],i=0;i0&&s.push(this.goodsList[i].id),console.log(s,"选择");this.selectedList=this.isAllselected?[]:s,this.isAllselected=!this.isAllselected&&0!=this.goodsList.length,this.sum()},sub:function(s){this.goodsList[s].num<=1||(this.goodsList[s].num--,this.goodsList[s].total=this.goodsList[s].num*this.goodsList[s].price,t.setStorageSync("cartlist",this.goodsList),this.sum())},add:function(s){this.goodsList[s].num++,this.goodsList[s].total=this.goodsList[s].num*this.goodsList[s].price,t.setStorageSync("cartlist",this.goodsList),this.sum()},sum:function(t,s){this.sumPrice=0;for(var i=this.goodsList.length,e="",o=0;o0&&(this.sumPrice=t&&o==s?this.sumPrice+t.detail.value*this.goodsList[o].price:this.sumPrice+this.goodsList[o].num*this.goodsList[o].price);e=e.substr(1),this.checkkc(e),this.sumPrice=this.sumPrice.toFixed(2),console.log(this.sumPrice,"总额")},discard:function(){}}};s.default=d}).call(this,e("543d")["default"])},"87cc":function(t,s,i){"use strict";var e;i.d(s,"b",(function(){return o})),i.d(s,"c",(function(){return n})),i.d(s,"a",(function(){return e}));var o=function(){var t=this,s=t.$createElement,i=(t._self._c,!(t.sumPrice>0&&t.sumPrice-t.startingPrice>=0)&&t.startingPrice>=0?t._f("toFixed")(-(t.sumPrice-t.startingPrice)):null);t.$mp.data=Object.assign({},{$root:{f0:i}})},n=[]},"9c87":function(t,s,i){"use strict";i.r(s);var e=i("8773"),o=i.n(e);for(var n in e)"default"!==n&&function(t){i.d(s,t,(function(){return e[t]}))}(n);s["default"]=o.a},b980:function(t,s,i){"use strict";var e=i("c798"),o=i.n(e);o.a},c798:function(t,s,i){},fa0e:function(t,s,i){"use strict";(function(t){i("8d0c");e(i("66fd"));var s=e(i("4bf1"));function e(t){return t&&t.__esModule?t:{default:t}}wx.__webpack_require_UNI_MP_PLUGIN__=i,t(s.default)}).call(this,i("543d")["createPage"])}},[["fa0e","common/runtime","common/vendor"]]]);