1944ff2.js 19 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[46,21],{499:function(t,e,n){"use strict";n(22),n(65);e.a={head:function(){var t=this.$store.getters.headerMeta;return{title:t.title,link:[{rel:"icon",type:"image/x-icon",href:t.ico}],meta:[{hid:"description",name:"description",content:t.description},{hid:"keywords",name:"keywords",content:t.keywords}]}}}},520:function(t,e,n){var content=n(539);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(21).default)("8d3d4dfe",content,!0,{sourceMap:!1})},532:function(t,e,n){"use strict";var r=n(2),o=n(3),c=n(71),l=n(311),d=n(310),h=n(4),f=RangeError,m=String,v=Math.floor,x=o(d),_=o("".slice),C=o(1..toFixed),w=function(t,e,n){return 0===e?n:e%2==1?w(t,e-1,n*t):w(t*t,e/2,n)},y=function(data,t,e){for(var n=-1,r=e;++n<6;)r+=t*data[n],data[n]=r%1e7,r=v(r/1e7)},A=function(data,t){for(var e=6,n=0;--e>=0;)n+=data[e],data[e]=v(n/t),n=n%t*1e7},k=function(data){for(var t=6,s="";--t>=0;)if(""!==s||0===t||0!==data[t]){var e=m(data[t]);s=""===s?e:s+x("0",7-e.length)+e}return s};r({target:"Number",proto:!0,forced:h((function(){return"0.000"!==C(8e-5,3)||"1"!==C(.9,0)||"1.25"!==C(1.255,2)||"1000000000000000128"!==C(0xde0b6b3a7640080,0)}))||!h((function(){C({})}))},{toFixed:function(t){var e,n,r,o,d=l(this),h=c(t),data=[0,0,0,0,0,0],v="",C="0";if(h<0||h>20)throw new f("Incorrect fraction digits");if(d!=d)return"NaN";if(d<=-1e21||d>=1e21)return m(d);if(d<0&&(v="-",d=-d),d>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(d*w(2,69,1))-69)<0?d*w(2,-e,1):d/w(2,e,1),n*=4503599627370496,(e=52-e)>0){for(y(data,0,n),r=h;r>=7;)y(data,1e7,0),r-=7;for(y(data,w(10,r,1),0),r=e-1;r>=23;)A(data,1<<23),r-=23;A(data,1<<r),y(data,1,1),A(data,2),C=k(data)}else y(data,0,n),y(data,1<<-e,0),C=k(data)+x("0",h);return C=h>0?v+((o=C.length)<=h?"0."+x("0",h-o)+C:_(C,0,o-h)+"."+_(C,o-h)):v+C}})},538:function(t,e,n){"use strict";n(520)},539:function(t,e,n){var r=n(20)((function(i){return i[1]}));r.push([t.i,".number-box[data-v-0f3bdeec]{align-items:center;display:inline-flex}.number-box .number-input[data-v-0f3bdeec]{align-items:center;justify-content:center;margin:0 6px;padding:0;position:relative;text-align:center}.number-box .minus[data-v-0f3bdeec],.number-box .plus[data-v-0f3bdeec]{align-items:center;cursor:pointer;display:flex;justify-content:center;width:32px}.number-box .plus[data-v-0f3bdeec]{border-radius:0 2px 2px 0}.number-box .minus[data-v-0f3bdeec]{border-radius:2px 0 0 2px}.number-box .disabled[data-v-0f3bdeec]{background:#f7f8fa!important;color:#c8c9cc!important}.number-box .input-disabled[data-v-0f3bdeec]{background-color:#f2f3f5!important;color:#c8c9cc!important}",""]),r.locals={},t.exports=r},553:function(t,e,n){"use strict";n.r(e);n(309),n(532),n(13),n(38),n(49),n(66);var r={components:{},props:{value:{type:Number,default:1},bgColor:{type:String,default:" #F2F3F5"},min:{type:Number,default:0},max:{type:Number,default:99999},step:{type:Number,default:1},disabled:{type:Boolean,default:!1},size:{type:[Number,String],default:14},inputWidth:{type:[Number,String],default:64},color:{type:String,default:"#333"},inputHeight:{type:[Number,String],default:32},index:{type:[Number,String],default:""},disabledInput:{type:Boolean,default:!1},positiveInteger:{type:Boolean,default:!0},asyncChange:{type:Boolean,default:!1}},watch:{value:function(t,e){this.changeFromInner||(this.inputVal=t,this.$nextTick((function(){this.changeFromInner=!1})))},inputVal:function(t,e){var n=this;if(""!=t){var r=0;r=/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)&&t>=this.min&&t<=this.max?t:e,this.positiveInteger&&(t<0||-1!==String(t).indexOf("."))&&(r=e,this.$nextTick((function(){n.inputVal=e}))),this.asyncChange||this.handleChange(r,"change")}}},data:function(){return{inputVal:1,timer:null,changeFromInner:!1,innerChangeTimer:null}},created:function(){this.inputVal=Number(this.value)},computed:{},methods:{btnTouchStart:function(t){this[t]()},minus:function(){this.computeVal("minus")},plus:function(){this.computeVal("plus")},calcPlus:function(t,e){var n,r,o;try{r=t.toString().split(".")[1].length}catch(t){r=0}try{o=e.toString().split(".")[1].length}catch(t){o=0}return((t*(n=Math.pow(10,Math.max(r,o)))+e*n)/n).toFixed(r>=o?r:o)},calcMinus:function(t,e){var n,r,o;try{r=t.toString().split(".")[1].length}catch(t){r=0}try{o=e.toString().split(".")[1].length}catch(t){o=0}return((t*(n=Math.pow(10,Math.max(r,o)))-e*n)/n).toFixed(r>=o?r:o)},computeVal:function(t){if(!this.disabled){var e=0;"minus"===t?e=this.calcMinus(this.inputVal,this.step):"plus"===t&&(e=this.calcPlus(this.inputVal,this.step)),e<this.min||e>this.max||(this.asyncChange?this.$emit("change",e):(this.inputVal=e,this.handleChange(e,t)))}},onBlur:function(t){var e=this,n=0,r=t.target.value;console.log(r),(n=/(^\d+$)/.test(r)?+r:this.min)>this.max?n=this.max:n<this.min&&(n=this.min),this.$nextTick((function(){e.inputVal=n})),this.handleChange(n,"blur")},onFocus:function(){this.$emit("focus")},handleChange:function(t,e){var n=this;this.disabled||(this.innerChangeTimer&&(clearTimeout(this.innerChangeTimer),this.innerChangeTimer=null),this.changeFromInner=!0,this.innerChangeTimer=setTimeout((function(){n.changeFromInner=!1}),150),this.$emit("input",Number(t)),this.$emit(e,{value:Number(t),index:this.index}))}}},o=(n(538),n(9)),component=Object(o.a)(r,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"number-box"},[e("div",{class:{minus:!0,disabled:t.disabled||t.inputVal<=t.min},style:{background:t.bgColor,height:t.inputHeight+"px",color:t.color},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.btnTouchStart("minus")}}},[e("div",{style:{fontSize:t.size+"px"}},[t._v("-")])]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.inputVal,expression:"inputVal"}],class:{"number-input":!0,"input-disabled":t.disabled},style:{color:t.color,fontSize:t.size+"px",background:t.bgColor,height:t.inputHeight+"px",width:t.inputWidth+"px"},attrs:{disabled:t.disabledInput||t.disabled,type:"text"},domProps:{value:t.inputVal},on:{blur:t.onBlur,focus:t.onFocus,input:function(e){e.target.composing||(t.inputVal=e.target.value)}}}),t._v(" "),e("div",{staticClass:"plus",class:{disabled:t.disabled||t.inputVal>=t.max},style:{background:t.bgColor,height:t.inputHeight+"px",color:t.color},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.btnTouchStart("plus")}}},[e("div",{style:{fontSize:t.size+"px"}},[t._v("+")])])])}),[],!1,null,"0f3bdeec",null);e.default=component.exports},555:function(t,e,n){"use strict";var r=n(2),o=n(88).findIndex,c=n(205),l="findIndex",d=!0;l in[]&&Array(1)[l]((function(){d=!1})),r({target:"Array",proto:!0,forced:d},{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),c(l)},594:function(t,e,n){var content=n(652);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(21).default)("beb00426",content,!0,{sourceMap:!1})},649:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAP1BMVEUAAACAgIBsbGxsbGxubm5xcXFwcHBubm5vb29ubm5vb29ubm5ubm5wcHBwcHBvb29wcHBvb29vb29wcHBwcHCw1+evAAAAFHRSTlMAAhooOj9AQUdITFhoj5/F29zj5uF9dOwAAABQSURBVBjTY2DADrgERMBAiAMuJMQGodkE4EIiaAx+ERTAj6oIwcQqxCjMwMnHwMtNIyEGHpAQOzOqI5hYCLhLiBUmwioICxtBmAeRQgcFAABfsQZNXvKDKwAAAABJRU5ErkJggg=="},650:function(t,e,n){t.exports=n.p+"img/cart_null.663f237.png"},651:function(t,e,n){"use strict";n(594)},652:function(t,e,n){var r=n(20)((function(i){return i[1]}));r.push([t.i,'.shop-cart{padding:24px 0}.shop-cart .cart-list{min-height:600px}.shop-cart .cart-list .cart-hd{border-bottom:1px solid #e5e5e5;height:50px;margin:0 10px}.shop-cart .cart-list .cart-con{margin:0 10px}.shop-cart .cart-list .cart-con .item{border-bottom:1px dashed #e5e5e5;padding:20px 0}.shop-cart .cart-list .check-box{padding-left:10px;width:68px}.shop-cart .cart-list .info{width:450px}.shop-cart .cart-list .info .pictrue{margin-right:10px;position:relative}.shop-cart .cart-list .info .pictrue .img{height:72px;width:72px}.shop-cart .cart-list .info .pictrue .cover{background-color:rgba(0,0,0,.5);bottom:0;height:72px;left:0;position:absolute;right:0;top:0;width:72px}.shop-cart .cart-list .info .pictrue .cover:after{color:#fff;content:"-已失效-";font-size:12px;left:15%;position:absolute;top:50%;transform:translateY(-50%)}.shop-cart .cart-list .info .name{margin-bottom:10px}.shop-cart .cart-list .price{width:150px}.shop-cart .cart-list .num{width:250px}.shop-cart .cart-list .money{width:150px}.shop-cart .cart-list .delete-btn{cursor:pointer}.shop-cart .cart-footer{align-items:flex-start;padding:20px 20px 40px 10px}.shop-cart .cart-footer .total{align-items:flex-end}.shop-cart .cart-footer .total .btn{cursor:pointer;height:44px;margin-top:18px;width:152px}.shop-cart .data-null{padding-top:100px}',""]),r.locals={},t.exports=r},724:function(t,e,n){"use strict";n.r(e);n(32);var r=n(10),o=n(7),c=(n(48),n(26),n(22),n(555),n(68),n(33),n(34),n(25),n(13),n(24),n(553)),l=n(14);function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var f={mixins:[n(499).a],components:{NumberBox:c.default},asyncData:function(t){return Object(o.a)(regeneratorRuntime.mark((function e(){var n,r,o,c,l,d,h,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.$get,t.$post,r=[],o=0,c=0,l=!1,d=0,h=!0,e.next=9,n("cart/lists");case 9:return 1==(f=e.sent).code&&(r=f.data.lists,o=f.data.total_amount,c=f.data.total_num,l=!1,d=0,r.forEach((function(t,e){1==t.selected||1==t.selected?(d++,t.selected=!0):t.selected=!1})),l=d>0&&d<r.length,h=!(r.length>0)),e.abrupt("return",{shopCartList:r,totalAmount:o,totalNum:c,isIndeterminate:l,checkoutCount:d,isDataNull:h,cartListsId:[]});case 12:case"end":return e.stop()}}),e)})))()},data:function(){return{checkAll:!1,isIndeterminate:!1,checkoutCount:0}},mounted:function(){},computed:{isSelectedAll:{get:function(){return!(this.shopCartList.length<=0)&&-1==this.shopCartList.findIndex((function(t){return 0==t.selected}))}}},methods:h(h({},Object(l.b)(["getPublicData"])),{},{getCartList:function(){var t=this;return Object(o.a)(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$get("cart/lists");case 2:1==(n=e.sent).code&&(t.shopCartList=Object.assign([],n.data.lists),t.totalAmount=n.data.total_amount,t.totalNum=n.data.total_num,t.isIndeterminate=!0,t.checkoutCount=0,t.shopCartList.forEach((function(e,n){1==e.selected||1==e.selected?(t.checkoutCount++,e.selected=!0):e.selected=!1})),t.isIndeterminate=t.checkoutCount>0&&t.checkoutCount<t.shopCartList.length,t.shopCartList.length>0?t.isDataNull=!1:t.isDataNull=!0);case 4:case"end":return e.stop()}}),e)})))()},handleCheckAllChange:function(t){var e=this;return Object(o.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.$post("cart/selected",{cart_id:e.shopCartList.map((function(t){return t.id})),selected:1==t?1:0});case 2:1==n.sent.code&&e.getCartList();case 4:case"end":return n.stop()}}),n)})))()},onBoxClick:function(t,e){this.changeSelected(e,t)},changeSelected:function(t,e){var n=this;return Object(o.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n.$post("cart/selected",{cart_id:t,selected:1==e?1:0});case 2:1==r.sent.code&&n.getCartList();case 4:case"end":return r.stop()}}),r)})))()},changeShopCartCount:function(t,e){var n=this;return Object(o.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n.$post("cart/change",{cart_id:e,goods_num:t});case 2:1==r.sent.code&&(n.getCartList(),n.getPublicData());case 4:case"end":return r.stop()}}),r)})))()},blurShopCartCount:function(t,e){var n=this;return Object(o.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,n.$post("cart/change",{cart_id:e,goods_num:t.value});case 2:1==r.sent.code&&(n.getCartList(),n.getPublicData());case 4:case"end":return r.stop()}}),r)})))()},goodsDelete:function(t){var e=this;return Object(o.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.$post("cart/del",{cart_id:t});case 2:1==n.sent.code&&(e.getPublicData(),e.getCartList(),e.$message({message:"删除商品成功",type:"success"}));case 4:case"end":return n.stop()}}),n)})))()},deleteSelectedGoods:function(){var t=this.shopCartList.filter((function(t){return 1==t.selected||1==t.selected}));if(t.length<=0)this.$message({message:"没有选择商品",type:"error"});else{var e=t.map((function(t){return t.id}));this.goodsDelete(e)}},toOrderBuy:function(){var t=this,e=this.shopCartList,n=[];if(e.forEach((function(e){e.selected&&(n.push({item_id:e.item_id,num:e.goods_num}),t.cartListsId.push(e.id))})),0==n.length)return this.$message({message:"您还没有选择商品哦"});this.$router.push({path:"/confirm_order",query:{data:encodeURIComponent(JSON.stringify({goods:n})),source:"cart",order_type:0,cart_id:this.cartListsId}})},toIndex:function(){this.$router.push("/")}})},m=(n(651),n(9)),component=Object(m.a)(f,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"shop-cart",staticStyle:{width:"70%","margin-left":"15%"}},[e("div",{staticClass:"cart-list bg-white"},[e("div",{directives:[{name:"show",rawName:"v-show",value:!t.isDataNull,expression:"!isDataNull"}]},[e("div",{staticClass:"cart-hd flex lighter"},[e("div",{staticClass:"check-box"},[e("el-checkbox",{attrs:{indeterminate:t.isIndeterminate},on:{change:t.handleCheckAllChange},model:{value:t.isSelectedAll,callback:function(e){t.isSelectedAll=e},expression:"isSelectedAll"}},[t._v("全选")])],1),t._v(" "),e("div",{staticClass:"info flex row-center"},[t._v("商品信息")]),t._v(" "),e("div",{staticClass:"price flex row-center"},[t._v("单价")]),t._v(" "),e("div",{staticClass:"num flex row-center"},[t._v("数量")]),t._v(" "),e("div",{staticClass:"money flex row-center"},[t._v("合计")]),t._v(" "),e("div",{staticClass:"operate flex row-center"},[t._v("操作")])]),t._v(" "),e("div",{staticClass:"cart-con"},t._l(t.shopCartList,(function(r,o){return e("div",{key:o,staticClass:"item flex"},[e("div",{staticClass:"check-box"},[e("el-checkbox",{attrs:{disabled:r.cart_status},on:{change:function(e){return t.onBoxClick(e,r.id)}},model:{value:r.selected,callback:function(e){t.$set(r,"selected",e)},expression:"item.selected"}})],1),t._v(" "),e("nuxt-link",{staticClass:"info flex",attrs:{to:"/goods_details?id="+r.goods_id}},[e("div",{staticClass:"pictrue flex-none"},[e("img",{staticClass:"img",attrs:{src:r.goods.image,alt:""}}),t._v(" "),e("div",{class:{cover:r.cart_status}})]),t._v(" "),e("div",[e("div",{staticClass:"name line-2"},[t._v("\n "+t._s(r.goods.name)+"\n ")]),t._v(" "),e("div",{staticClass:"muted"},[t._v("\n "+t._s(r.goods_item.spec_value_str)+"\n ")])])]),t._v(" "),e("div",{staticClass:"price flex row-center"},[t._v("\n ¥"+t._s(r.goods_item.sell_price)+"\n ")]),t._v(" "),e("div",{staticClass:"text-center"},[1===r.goods.limit_type?e("div",{staticClass:"num flex row-center"},[e("number-box",{attrs:{min:1,"async-change":""},on:{change:function(e){return t.changeShopCartCount(e,r.id)},blur:function(e){return t.blurShopCartCount(e,r.id)}},model:{value:r.goods_num,callback:function(e){t.$set(r,"goods_num",e)},expression:"item.goods_num"}})],1):e("div",{staticClass:"num flex row-center"},[e("number-box",{attrs:{min:1,max:r.goods.limit_value,"async-change":""},on:{change:function(e){return t.changeShopCartCount(e,r.id)},blur:function(e){return t.blurShopCartCount(e,r.id)}},model:{value:r.goods_num,callback:function(e){t.$set(r,"goods_num",e)},expression:"item.goods_num"}})],1),t._v(" "),2===r.goods.limit_type?e("div",{staticClass:"p-t-10 muted"},[t._v("\n 每人限购"+t._s(r.goods.limit_value)+"件\n ")]):t._e(),t._v(" "),3===r.goods.limit_type?e("div",{staticClass:"p-t-10 muted"},[t._v("\n 每笔限购"+t._s(r.goods.limit_value)+"件\n ")]):t._e()]),t._v(" "),e("div",{staticClass:"money flex row-center"},[t._v("\n ¥"+t._s(r.sub_price)+"\n ")]),t._v(" "),e("el-popconfirm",{attrs:{title:"确定删除该商品吗?","confirm-button-text":"确定","cancel-button-text":"取消",icon:"el-icon-info","icon-color":"red"},on:{confirm:function(e){return t.goodsDelete(r.id)}}},[e("div",{staticClass:"operate flex row-center delete-btn",attrs:{slot:"reference"},slot:"reference"},[e("img",{attrs:{src:n(649)}})])])],1)})),0),t._v(" "),e("div",{staticClass:"cart-footer flex row-between"},[e("div",{staticClass:"lighter flex"},[e("div",{staticClass:"check-box"},[e("el-checkbox",{attrs:{indeterminate:t.isIndeterminate},on:{change:t.handleCheckAllChange},model:{value:t.isSelectedAll,callback:function(e){t.isSelectedAll=e},expression:"isSelectedAll"}},[t._v("全选")])],1),t._v(" "),e("div",{staticStyle:{margin:"0 24px"}},[t._v("\n 已选 ("+t._s(t.checkoutCount)+")\n ")]),t._v(" "),e("el-popconfirm",{attrs:{title:"确定删除选中商品吗?","confirm-button-text":"确定","cancel-button-text":"取消",icon:"el-icon-info","icon-color":"red"},on:{confirm:t.deleteSelectedGoods}},[e("div",{staticStyle:{cursor:"pointer"},attrs:{slot:"reference"},slot:"reference"},[t._v("\n 删除选中商品\n ")])])],1),t._v(" "),e("div",{staticClass:"total flex-col"},[e("div",{staticClass:"flex"},[e("div",{staticClass:"lighter"},[t._v("商品总价:")]),t._v(" "),e("div",{staticClass:"primary",staticStyle:{"font-size":"20px","margin-left":"28px"}},[t._v("\n ¥"+t._s(t.totalAmount)+"\n ")])]),t._v(" "),e("div",{staticClass:"white bg-primary lg btn flex row-center",on:{click:t.toOrderBuy}},[t._v("\n 去结算\n ")])])])]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isDataNull,expression:"isDataNull"}],staticClass:"flex flex-col col-center data-null"},[e("img",{staticStyle:{width:"150px",height:"150px"},attrs:{src:n(650)}}),t._v(" "),e("div",{staticClass:"muted xs m-t-8"},[t._v("购物车是空的~")]),t._v(" "),e("div",{staticClass:"m-t-8"},[e("el-button",{attrs:{round:"",type:"primary",size:"medium"},on:{click:t.toIndex}},[t._v("去逛逛~")])],1)])])])}),[],!1,null,null,null);e.default=component.exports}}]);