2023-10-23 16:11:09 +08:00

1 line
18 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonp=window.webpackJsonp||[]).push([[36,17],{434:function(t,e,n){"use strict";var r=n(15),o=n(2),c=n(3),l=n(137),d=n(27),h=n(17),f=n(273),m=n(53),v=n(136),x=n(272),_=n(4),C=n(93).f,w=n(45).f,y=n(23).f,A=n(435),k=n(436).trim,N="Number",I=o.Number,S=I.prototype,O=o.TypeError,E=c("".slice),j=c("".charCodeAt),B=function(t){var e=x(t,"number");return"bigint"==typeof e?e:$(e)},$=function(t){var e,n,r,o,c,l,d,code,h=x(t,"number");if(v(h))throw O("Cannot convert a Symbol value to a number");if("string"==typeof h&&h.length>2)if(h=k(h),43===(e=j(h,0))||45===e){if(88===(n=j(h,2))||120===n)return NaN}else if(48===e){switch(j(h,1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+h}for(l=(c=E(h,2)).length,d=0;d<l;d++)if((code=j(c,d))<48||code>o)return NaN;return parseInt(c,r)}return+h};if(l(N,!I(" 0o1")||!I("0b1")||I("+0x1"))){for(var F,T=function(t){var e=arguments.length<1?0:I(B(t)),n=this;return m(S,n)&&_((function(){A(n)}))?f(Object(e),n,T):e},V=r?C(I):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),M=0;V.length>M;M++)h(I,F=V[M])&&!h(T,F)&&y(T,F,w(I,F));T.prototype=S,S.constructor=T,d(o,N,T)}},435:function(t,e,n){var r=n(3);t.exports=r(1..valueOf)},436:function(t,e,n){var r=n(3),o=n(31),c=n(16),l=n(437),d=r("".replace),h="["+l+"]",f=RegExp("^"+h+h+"*"),m=RegExp(h+h+"*$"),v=function(t){return function(e){var n=c(o(e));return 1&t&&(n=d(n,f,"")),2&t&&(n=d(n,m,"")),n}};t.exports={start:v(1),end:v(2),trim:v(3)}},437:function(t,e){t.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},469:function(t,e,n){var content=n(483);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(19).default)("9935c90c",content,!0,{sourceMap:!1})},480:function(t,e,n){"use strict";var r=n(7),o=n(96).findIndex,c=n(187),l="findIndex",d=!0;l in[]&&Array(1).findIndex((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)},481:function(t,e,n){"use strict";var r=n(7),o=n(2),c=n(3),l=n(65),d=n(435),h=n(275),f=n(4),m=o.RangeError,v=o.String,x=Math.floor,_=c(h),C=c("".slice),w=c(1..toFixed),y=function(t,e,n){return 0===e?n:e%2==1?y(t,e-1,n*t):y(t*t,e/2,n)},A=function(data,t,e){for(var n=-1,r=e;++n<6;)r+=t*data[n],data[n]=r%1e7,r=x(r/1e7)},k=function(data,t){for(var e=6,n=0;--e>=0;)n+=data[e],data[e]=x(n/t),n=n%t*1e7},N=function(data){for(var t=6,s="";--t>=0;)if(""!==s||0===t||0!==data[t]){var e=v(data[t]);s=""===s?e:s+_("0",7-e.length)+e}return s};r({target:"Number",proto:!0,forced:f((function(){return"0.000"!==w(8e-5,3)||"1"!==w(.9,0)||"1.25"!==w(1.255,2)||"1000000000000000128"!==w(0xde0b6b3a7640080,0)}))||!f((function(){w({})}))},{toFixed:function(t){var e,n,r,o,c=d(this),h=l(t),data=[0,0,0,0,0,0],f="",x="0";if(h<0||h>20)throw m("Incorrect fraction digits");if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return v(c);if(c<0&&(f="-",c=-c),c>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}(c*y(2,69,1))-69)<0?c*y(2,-e,1):c/y(2,e,1),n*=4503599627370496,(e=52-e)>0){for(A(data,0,n),r=h;r>=7;)A(data,1e7,0),r-=7;for(A(data,y(10,r,1),0),r=e-1;r>=23;)k(data,1<<23),r-=23;k(data,1<<r),A(data,1,1),k(data,2),x=N(data)}else A(data,0,n),A(data,1<<-e,0),x=N(data)+_("0",h);return x=h>0?f+((o=x.length)<=h?"0."+_("0",h-o)+x:C(x,0,o-h)+"."+C(x,o-h)):f+x}})},482:function(t,e,n){"use strict";n(469)},483:function(t,e,n){var r=n(18)(!1);r.push([t.i,".number-box[data-v-0f3bdeec]{display:inline-flex;align-items:center}.number-box .number-input[data-v-0f3bdeec]{position:relative;text-align:center;padding:0;margin:0 6px;align-items:center;justify-content:center}.number-box .minus[data-v-0f3bdeec],.number-box .plus[data-v-0f3bdeec]{width:32px;display:flex;justify-content:center;align-items:center;cursor:pointer}.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]{color:#c8c9cc!important;background:#f7f8fa!important}.number-box .input-disabled[data-v-0f3bdeec]{color:#c8c9cc!important;background-color:#f2f3f5!important}",""]),t.exports=r},493:function(t,e,n){"use strict";n.r(e);n(434),n(39),n(274),n(10),n(95),n(481),n(78);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(482),n(11)),component=Object(o.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"number-box"},[n("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")}}},[n("div",{style:{fontSize:t.size+"px"}},[t._v("-")])]),t._v(" "),n("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(" "),n("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")}}},[n("div",{style:{fontSize:t.size+"px"}},[t._v("+")])])])}),[],!1,null,"0f3bdeec",null);e.default=component.exports},519:function(t,e,n){var content=n(570);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(19).default)("2936b0da",content,!0,{sourceMap:!1})},567:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAP1BMVEUAAACAgIBsbGxsbGxubm5xcXFwcHBubm5vb29ubm5vb29ubm5ubm5wcHBwcHBvb29wcHBvb29vb29wcHBwcHCw1+evAAAAFHRSTlMAAhooOj9AQUdITFhoj5/F29zj5uF9dOwAAABQSURBVBjTY2DADrgERMBAiAMuJMQGodkE4EIiaAx+ERTAj6oIwcQqxCjMwMnHwMtNIyEGHpAQOzOqI5hYCLhLiBUmwioICxtBmAeRQgcFAABfsQZNXvKDKwAAAABJRU5ErkJggg=="},568:function(t,e,n){t.exports=n.p+"img/cart_null.f9179fd.png"},569:function(t,e,n){"use strict";n(519)},570:function(t,e,n){var r=n(18)(!1);r.push([t.i,".shop-cart{padding:24px 0}.shop-cart .cart-list{min-height:600px}.shop-cart .cart-list .cart-hd{height:50px;margin:0 10px;border-bottom:1px solid #e5e5e5}.shop-cart .cart-list .cart-con{margin:0 10px}.shop-cart .cart-list .cart-con .item{padding:20px 0;border-bottom:1px dashed #e5e5e5}.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}.shop-cart .cart-list .info .pictrue img{width:72px;height:72px}.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{padding:20px 20px 40px 10px;align-items:flex-start}.shop-cart .cart-footer .total{align-items:flex-end}.shop-cart .cart-footer .total .btn{width:152px;height:44px;margin-top:18px;cursor:pointer}.shop-cart .data-null{padding-top:100px}",""]),t.exports=r},638:function(t,e,n){"use strict";n.r(e);n(25),n(20),n(32),n(33);var r=n(9),o=n(6),c=(n(52),n(10),n(21),n(480),n(64),n(24),n(493)),l=n(13);function d(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function h(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?d(Object(source),!0).forEach((function(e){Object(r.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):d(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var f={head:function(){return{title:this.$store.getters.headTitle,link:[{rel:"icon",type:"image/x-icon",href:this.$store.getters.favicon}]}},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});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}))},set:function(t){var e=this.shopCartList.map((function(t){return t.cart_id}));this.changeSelected(e,t)}}},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){},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:e});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)})))()},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.cart_id}));this.goodsDelete(e)}},toOrderBuy:function(){var t=this.shopCartList,e=[];if(t.forEach((function(t){t.selected&&e.push({item_id:t.item_id,num:t.goods_num})})),0==e.length)return this.$message({message:"您还没有选择商品哦"});var n="/confirm_order?data="+encodeURIComponent(JSON.stringify({goods:e,type:"cart"}));this.$router.push(n)},toIndex:function(){this.$router.push("/")}})},m=(n(569),n(11)),component=Object(m.a)(f,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"shop-cart"},[r("div",{staticClass:"cart-list bg-white"},[r("div",{directives:[{name:"show",rawName:"v-show",value:!t.isDataNull,expression:"!isDataNull"}]},[r("div",{staticClass:"cart-hd row lighter"},[r("div",{staticClass:"check-box"},[r("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(" "),r("div",{staticClass:"info row-center"},[t._v("商品信息")]),t._v(" "),r("div",{staticClass:"price row-center"},[t._v("单价")]),t._v(" "),r("div",{staticClass:"num row-center"},[t._v("数量")]),t._v(" "),r("div",{staticClass:"money row-center"},[t._v("合计")]),t._v(" "),r("div",{staticClass:"operate row-center"},[t._v("操作")])]),t._v(" "),r("div",{staticClass:"cart-con"},t._l(t.shopCartList,(function(e,o){return r("div",{key:o,staticClass:"item row"},[r("div",{staticClass:"check-box"},[r("el-checkbox",{on:{change:function(n){return t.onBoxClick(n,e.cart_id)}},model:{value:e.selected,callback:function(n){t.$set(e,"selected",n)},expression:"item.selected"}})],1),t._v(" "),r("nuxt-link",{staticClass:"info row",attrs:{to:"/goods_details/"+e.goods_id}},[r("div",{staticClass:"pictrue flexnone"},[r("img",{attrs:{src:e.img,alt:""}})]),t._v(" "),r("div",[r("div",{staticClass:"name line2"},[t._v("\n "+t._s(e.name)+"\n ")]),t._v(" "),r("div",{staticClass:"muted"},[t._v(t._s(e.spec_value_str))])])]),t._v(" "),r("div",{staticClass:"price row-center"},[t._v("¥"+t._s(e.price))]),t._v(" "),r("div",{staticClass:"num row-center"},[r("number-box",{attrs:{min:1,"async-change":""},on:{change:function(n){return t.changeShopCartCount(n,e.cart_id)}},model:{value:e.goods_num,callback:function(n){t.$set(e,"goods_num",n)},expression:"item.goods_num"}})],1),t._v(" "),r("div",{staticClass:"money row-center"},[t._v("¥"+t._s(e.sub_price))]),t._v(" "),r("el-popconfirm",{attrs:{title:"确定删除该商品吗?","confirm-button-text":"确定","cancel-button-text":"取消",icon:"el-icon-info","icon-color":"red"},on:{confirm:function(n){return t.goodsDelete(e.cart_id)}}},[r("div",{staticClass:"operate row-center delete-btn",attrs:{slot:"reference"},slot:"reference"},[r("img",{attrs:{src:n(567)}})])])],1)})),0),t._v(" "),r("div",{staticClass:"cart-footer row-between"},[r("div",{staticClass:"lighter row"},[r("div",{staticClass:"check-box"},[r("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(" "),r("div",{staticStyle:{margin:"0 24px"}},[t._v("已选 ("+t._s(t.checkoutCount)+")")]),t._v(" "),r("el-popconfirm",{attrs:{title:"确定删除选中商品吗?","confirm-button-text":"确定","cancel-button-text":"取消",icon:"el-icon-info","icon-color":"red"},on:{confirm:t.deleteSelectedGoods}},[r("div",{staticStyle:{cursor:"pointer"},attrs:{slot:"reference"},slot:"reference"},[t._v("删除选中商品")])])],1),t._v(" "),r("div",{staticClass:"total column"},[r("div",{staticClass:"row"},[r("div",{staticClass:"lighter"},[t._v("商品总价:")]),t._v(" "),r("div",{staticClass:"primary",staticStyle:{"font-size":"20px","margin-left":"28px"}},[t._v("\n ¥"+t._s(t.totalAmount)+"\n ")])]),t._v(" "),r("div",{staticClass:"white bg-primary lg btn row-center",on:{click:t.toOrderBuy}},[t._v("\n 去结算\n ")])])])]),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:t.isDataNull,expression:"isDataNull"}],staticClass:"column-center data-null"},[r("img",{staticStyle:{width:"150px",height:"150px"},attrs:{src:n(568)}}),t._v(" "),r("div",{staticClass:"muted xs mt8"},[t._v("购物车是空的~")]),t._v(" "),r("div",{staticClass:"mt8"},[r("el-button",{attrs:{round:"",type:"primary",size:"medium"},on:{click:t.toIndex}},[t._v("去逛逛~")])],1)])])])}),[],!1,null,null,null);e.default=component.exports}}]);