|
|
(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;o<s;o++)this.goodsList[o].num<=0?e.push(this.goodsList[o].id):1==this.goodsList[o].selected&&i.push(this.goodsList[o].id);if(e.length>0){for(var n=0;n<e.length;n++)this.deleteGoods(e[n]);this.goodsList.length<=0&&(this.isAllselected=!1)}else this.selectedList=i,this.isAllselected=this.selectedList.length==this.goodsList.length,console.log(i,"选中数据")}console.log(this.goodsList,"购物车商品"),this.sum(),this.baseinfo("lessmoney")},onPageScroll:function(t){this.headerPosition=t.scrollTop>=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;i<this.goodsList.length;i++){if(this.goodsList[i].num<=0){this.goodsList.splice(i,1),t.setStorageSync("cartlist",this.goodsList);break}s=s+","+this.goodsList[i].id}s=s.substr(1)},methods:{checkkc:function(t){var s=this;return l(o.default.mark((function i(){var e,n,c,l,h;return o.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,s.$api.checkkc({action:"checkkc",gids:t});case 2:if(e=i.sent,n=e.data,c=s.goodsList,n)for(l=0;l<n.length;l++)for(h=0;h<c.length;h++)n[l].id==c[h].id&&s.$set(s.goodsList[h],"kucun",n[l].kucun);case 6:case"end":return i.stop()}}),i)})))()},baseinfo:function(t){var s=this;return l(o.default.mark((function i(){var e;return o.default.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,s.$api.baseinfo({action:"baseinfo",key:t});case 2:e=i.sent,s.startingPrice=parseInt(e.data.info).toFixed(2),console.log(s.startingPrice);case 5:case"end":return i.stop()}}),i)})))()},joinGoods:function(t){for(var s=this.goodsList.length,e=!1,o=0;o<s;o++){var n=this.goodsList[o];if(n.id==t.id){this.goodsList[o].num++,e=!0;break}}e||this.goodsList[i].unshift(t)},touchStart:function(t,s){s.touches.length>1?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:"您还�
|