cxybn/public/pc/_nuxt/2046890.js
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([[38,17],{415:function(t,e,n){"use strict";var r=n(13),o=n(2),c=n(121),l=n(24),d=n(14),h=n(53),f=n(258),m=n(84),v=n(257),x=n(5),C=n(70),_=n(85).f,w=n(45).f,y=n(23).f,A=n(416).trim,N="Number",I=o.Number,S=I.prototype,k=h(C(S))==N,O=function(t){if(m(t))throw TypeError("Cannot convert a Symbol value to a number");var e,n,r,o,c,l,d,code,h=v(t,"number");if("string"==typeof h&&h.length>2)if(43===(e=(h=A(h)).charCodeAt(0))||45===e){if(88===(n=h.charCodeAt(2))||120===n)return NaN}else if(48===e){switch(h.charCodeAt(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=h.slice(2)).length,d=0;d<l;d++)if((code=c.charCodeAt(d))<48||code>o)return NaN;return parseInt(c,r)}return+h};if(c(N,!I(" 0o1")||!I("0b1")||I("+0x1"))){for(var E,F=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof F&&(k?x((function(){S.valueOf.call(n)})):h(n)!=N)?f(new I(O(e)),n,F):O(e)},j=r?_(I):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),B=0;j.length>B;B++)d(I,E=j[B])&&!d(F,E)&&y(F,E,w(I,E));F.prototype=S,S.constructor=F,l(o,N,F)}},416:function(t,e,n){var r=n(28),o=n(11),c="["+n(417)+"]",l=RegExp("^"+c+c+"*"),d=RegExp(c+c+"*$"),h=function(t){return function(e){var n=o(r(e));return 1&t&&(n=n.replace(l,"")),2&t&&(n=n.replace(d,"")),n}};t.exports={start:h(1),end:h(2),trim:h(3)}},417:function(t,e){t.exports="\t\n\v\f\r    \u2028\u2029\ufeff"},449:function(t,e,n){var content=n(464);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(16).default)("33847236",content,!0,{sourceMap:!1})},460:function(t,e,n){"use strict";var r=n(4),o=n(88).findIndex,c=n(173),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)},461:function(t,e,n){"use strict";var r=n(4),o=n(59),c=n(462),l=n(260),d=n(5),h=1..toFixed,f=Math.floor,m=function(t,e,n){return 0===e?n:e%2==1?m(t,e-1,n*t):m(t*t,e/2,n)},v=function(data,t,e){for(var n=-1,r=e;++n<6;)r+=t*data[n],data[n]=r%1e7,r=f(r/1e7)},x=function(data,t){for(var e=6,n=0;--e>=0;)n+=data[e],data[e]=f(n/t),n=n%t*1e7},C=function(data){for(var t=6,s="";--t>=0;)if(""!==s||0===t||0!==data[t]){var e=String(data[t]);s=""===s?e:s+l.call("0",7-e.length)+e}return s};r({target:"Number",proto:!0,forced:h&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!d((function(){h.call({})}))},{toFixed:function(t){var e,n,r,d,h=c(this),f=o(t),data=[0,0,0,0,0,0],_="",w="0";if(f<0||f>20)throw RangeError("Incorrect fraction digits");if(h!=h)return"NaN";if(h<=-1e21||h>=1e21)return String(h);if(h<0&&(_="-",h=-h),h>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}(h*m(2,69,1))-69)<0?h*m(2,-e,1):h/m(2,e,1),n*=4503599627370496,(e=52-e)>0){for(v(data,0,n),r=f;r>=7;)v(data,1e7,0),r-=7;for(v(data,m(10,r,1),0),r=e-1;r>=23;)x(data,1<<23),r-=23;x(data,1<<r),v(data,1,1),x(data,2),w=C(data)}else v(data,0,n),v(data,1<<-e,0),w=C(data)+l.call("0",f);return w=f>0?_+((d=w.length)<=f?"0."+l.call("0",f-d)+w:w.slice(0,d-f)+"."+w.slice(d-f)):_+w}})},462:function(t,e,n){var r=n(53);t.exports=function(t){if("number"!=typeof t&&"Number"!=r(t))throw TypeError("Incorrect invocation");return+t}},463:function(t,e,n){"use strict";n(449)},464:function(t,e,n){var r=n(15)(!1);r.push([t.i,".number-box[data-v-1266c81c]{display:inline-flex;align-items:center}.number-box .number-input[data-v-1266c81c]{position:relative;text-align:center;padding:0;margin:0 6px;align-items:center;justify-content:center}.number-box .minus[data-v-1266c81c],.number-box .plus[data-v-1266c81c]{width:32px;display:flex;justify-content:center;align-items:center;cursor:pointer}.number-box .plus[data-v-1266c81c]{border-radius:0 2px 2px 0}.number-box .minus[data-v-1266c81c]{border-radius:2px 0 0 2px}.number-box .disabled[data-v-1266c81c]{color:#c8c9cc!important;background:#f7f8fa!important}.number-box .input-disabled[data-v-1266c81c]{color:#c8c9cc!important;background-color:#f2f3f5!important}",""]),t.exports=r},475:function(t,e,n){"use strict";n.r(e);n(415),n(69),n(259),n(19),n(87),n(461),n(71);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(463),n(7)),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,"1266c81c",null);e.default=component.exports},505:function(t,e,n){var content=n(558);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(16).default)("2936b0da",content,!0,{sourceMap:!1})},555:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAP1BMVEUAAACAgIBsbGxsbGxubm5xcXFwcHBubm5vb29ubm5vb29ubm5ubm5wcHBwcHBvb29wcHBvb29vb29wcHBwcHCw1+evAAAAFHRSTlMAAhooOj9AQUdITFhoj5/F29zj5uF9dOwAAABQSURBVBjTY2DADrgERMBAiAMuJMQGodkE4EIiaAx+ERTAj6oIwcQqxCjMwMnHwMtNIyEGHpAQOzOqI5hYCLhLiBUmwioICxtBmAeRQgcFAABfsQZNXvKDKwAAAABJRU5ErkJggg=="},556:function(t,e,n){t.exports=n.p+"img/cart_null.f9179fd.png"},557:function(t,e,n){"use strict";n(505)},558:function(t,e,n){var r=n(15)(!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},625:function(t,e,n){"use strict";n.r(e);n(21),n(17),n(29),n(30);var r=n(8),o=n(6),c=(n(48),n(18),n(460),n(58),n(415),n(20),n(475)),l=n(10);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:Number(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(557),n(7)),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)},input: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(555)}})])])],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(556)}}),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}}]);