glhcp/server/public/_nuxt/a16b1e0.js

1 line
18 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[39,17],{516:function(t,e,n){"use strict";var r=n(2),o=n(110).findIndex,c=n(194),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)},519:function(t,e,n){var content=n(532);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(18).default)("8e6e7932",content,!0,{sourceMap:!1})},530:function(t,e,n){"use strict";var r=n(2),o=n(4),c=n(68),l=n(302),d=n(301),h=n(3),f=RangeError,v=String,m=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=m(r/1e7)},A=function(data,t){for(var e=6,n=0;--e>=0;)n+=data[e],data[e]=m(n/t),n=n%t*1e7},S=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+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],m="",C="0";if(h<0||h>20)throw f("Incorrect fraction digits");if(d!=d)return"NaN";if(d<=-1e21||d>=1e21)return v(d);if(d<0&&(m="-",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=S(data)}else y(data,0,n),y(data,1<<-e,0),C=S(data)+x("0",h);return C=h>0?m+((o=C.length)<=h?"0."+x("0",h-o)+C:_(C,0,o-h)+"."+_(C,o-h)):m+C}})},531:function(t,e,n){"use strict";n(519)},532:function(t,e,n){var r=n(17)((function(i){return i[1]}));r.push([t.i,".number-box[data-v-1d9d8f36]{align-items:center;display:inline-flex}.number-box .number-input[data-v-1d9d8f36]{align-items:center;justify-content:center;margin:0 6px;padding:0;position:relative;text-align:center}.number-box .minus[data-v-1d9d8f36],.number-box .plus[data-v-1d9d8f36]{align-items:center;cursor:pointer;display:flex;justify-content:center;width:32px}.number-box .plus[data-v-1d9d8f36]{border-radius:0 2px 2px 0}.number-box .minus[data-v-1d9d8f36]{border-radius:2px 0 0 2px}.number-box .disabled[data-v-1d9d8f36]{background:#f7f8fa!important;color:#c8c9cc!important}.number-box .input-disabled[data-v-1d9d8f36]{background-color:#f2f3f5!important;color:#c8c9cc!important}",""]),r.locals={},t.exports=r},546:function(t,e,n){"use strict";n.r(e);n(300),n(39),n(12),n(47),n(530),n(87);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(531),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,"1d9d8f36",null);e.default=component.exports},576:function(t,e,n){var content=n(636);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(18).default)("1e518390",content,!0,{sourceMap:!1})},633:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAP1BMVEUAAACAgIBsbGxsbGxubm5xcXFwcHBubm5vb29ubm5vb29ubm5ubm5wcHBwcHBvb29wcHBvb29vb29wcHBwcHCw1+evAAAAFHRSTlMAAhooOj9AQUdITFhoj5/F29zj5uF9dOwAAABQSURBVBjTY2DADrgERMBAiAMuJMQGodkE4EIiaAx+ERTAj6oIwcQqxCjMwMnHwMtNIyEGHpAQOzOqI5hYCLhLiBUmwioICxtBmAeRQgcFAABfsQZNXvKDKwAAAABJRU5ErkJggg=="},634:function(t,e,n){t.exports=n.p+"img/cart_null.663f237.png"},635:function(t,e,n){"use strict";n(576)},636:function(t,e,n){var r=n(17)((function(i){return i[1]}));r.push([t.i,".shop-cart[data-v-750ce260]{padding:24px 0}.shop-cart .cart-list[data-v-750ce260]{min-height:600px}.shop-cart .cart-list .cart-hd[data-v-750ce260]{color:#101010;height:50px;margin-bottom:10px;padding:10px}.shop-cart .cart-list .cart-con[data-v-750ce260]{padding:0 10px}.shop-cart .cart-list .cart-con .shop[data-v-750ce260]{border-bottom:1px solid #d7d7d7;padding:20px 10px}.shop-cart .cart-list .cart-con .item[data-v-750ce260]{border-bottom:1px dashed #e5e5e5;padding:20px 10px}.shop-cart .cart-list .cart-con .item[data-v-750ce260]:last-child{border-bottom:0}.shop-cart .cart-list .check-box[data-v-750ce260]{padding-left:10px;width:40px}.shop-cart .cart-list .info[data-v-750ce260]{width:450px}.shop-cart .cart-list .info .pictrue[data-v-750ce260]{margin-right:10px}.shop-cart .cart-list .info .pictrue img[data-v-750ce260]{height:72px;width:72px}.shop-cart .cart-list .info .name[data-v-750ce260]{margin-bottom:10px}.shop-cart .cart-list .price[data-v-750ce260]{width:150px}.shop-cart .cart-list .num[data-v-750ce260]{width:250px}.shop-cart .cart-list .money[data-v-750ce260]{width:150px}.shop-cart .cart-list .delete-btn[data-v-750ce260]{cursor:pointer}.shop-cart .cart-footer[data-v-750ce260]{padding:20px}.shop-cart .cart-footer .total .btn[data-v-750ce260]{border-radius:4px;cursor:pointer;height:50px;width:152px}.shop-cart .data-null[data-v-750ce260]{padding-top:170px;text-align:center}",""]),r.locals={},t.exports=r},714:function(t,e,n){"use strict";n.r(e);n(24),n(20),n(31),n(32);var r=n(8),o=n(10),c=(n(56),n(516),n(12),n(109),n(23),n(64),n(21),n(14));function l(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 d(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?l(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):l(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var h={head:function(){return{title:this.$store.getters.headTitle,link:[{rel:"icon",type:"image/x-icon",href:this.$store.getters.favicon}]}},data:function(){return{shopCartList:[],totalAmount:0,totalNum:0,isDataNull:!1}},mounted:function(){},computed:{isSelectedAll:{get:function(){return!!this.shopCartList.length&&(!this.allInvalid()&&-1==this.shopCartList.findIndex((function(t){return 0==t.is_selected})))},set:function(t){return t}},selected:{get:function(){return this.shopCartList.reduce((function(pre,t){return pre.concat(t.cart.filter((function(i){return 1==i.selected})))}),[]).length}}},methods:d(d({},Object(c.b)(["getPublicData"])),{},{getCartList:function(){var t=this;return Object(r.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.shopCartList.length>0?t.isDataNull=!1:t.isDataNull=!0);case 4:case"end":return e.stop()}}),e)})))()},onBoxClick:function(t,e,n){var r=[];switch(e){case 1:r=this.shopCartList[n].cart.map((function(t){return t.cart_id}));break;case 2:r.push(n);break;case 3:r=this.shopCartList.reduce((function(pre,t){return pre.concat(t.cart.map((function(i){return i.cart_id})))}),r)}this.changeSelected(r,t)},cartInvalid:function(t){return 0==t.goods_status||0!=t.goods_del},shopInvalid:function(t){var e=this;return t.cart.every((function(t){return e.cartInvalid(t)}))},allInvalid:function(){var t=this;return this.shopCartList.every((function(e){return t.shopInvalid(e)}))},changeSelected:function(t,e){var n=this;return Object(r.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(r.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(r.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.reduce((function(pre,t){return pre.concat(t.cart.filter((function(i){return 1==i.selected})))}),[]);if(t.length<=0)this.$message({message:"没有选择商品",type:"error"});else{var e=t.map((function(t){return t.cart_id}));this.goodsDelete(e)}},deleteAlldGoods:function(){var t=this.shopCartList.reduce((function(pre,t){return pre.concat(t.cart.filter((function(i){return i.cart_id})))}),[]);if(t.length<=0)this.$message({message:"没有商品",type:"error"});else{var e=t.map((function(t){return t.cart_id}));this.goodsDelete(e)}},getSelectCart:function(){var t=this;return this.shopCartList.reduce((function(pre,e){return pre.concat(e.cart.filter((function(i){return i.selected&&!t.cartInvalid(i)})).map((function(i){return i.cart_id})))}),[])},toOrderBuy:function(){var t=this.shopCartList,e=[],n=this.getSelectCart();if(0==n.length)return this.$message.err("您还没有选择商品哦");t.forEach((function(t){0!=t.cart.length&&t.cart.forEach((function(n,i){1==n.selected&&e.push({item_id:n.item_id,num:n.goods_num,goods_id:n.goods_id,shop_id:t.shop.shop_id})}))}));var r={carts:n,goods:e,type:"cart"};this.$router.push({path:"/confirm_order",query:{data:encodeURIComponent(JSON.stringify(r))}})},toIndex:function(){this.$router.push("/")}}),created:function(){this.getCartList()}},f=(n(635),n(9)),component=Object(f.a)(h,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"shop-cart"},[e("div",{staticClass:"cart-list"},[e("div",{directives:[{name:"show",rawName:"v-show",value:!t.isDataNull,expression:"!isDataNull"}]},[e("div",{staticClass:"cart-hd flex bg-white"},[e("div",{staticClass:"check-box"},[e("el-checkbox",{on:{change:function(e){return t.onBoxClick(e,3,"")}},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 bg-white"},t._l(t.shopCartList,(function(r,o){return e("div",{key:o,staticClass:"m-b-10 bg-white"},[e("div",{staticClass:"flex shop"},[e("el-checkbox",{attrs:{value:1==r.is_selected},on:{change:function(e){return t.onBoxClick(e,1,o)}}}),t._v(" "),e("div",{staticClass:"xs normal m-l-10"},[t._v("\n "+t._s(r.shop.shop_name)+"\n ")])],1),t._v(" "),t._l(r.cart,(function(r,o){return e("div",{key:o,staticClass:"item flex"},[e("div",{staticClass:"check-box"},[e("el-checkbox",{attrs:{value:1==r.selected},on:{change:function(e){return t.onBoxClick(e,2,r.cart_id)}}})],1),t._v(" "),e("nuxt-link",{staticClass:"info flex",attrs:{to:"/goods_details/"+r.goods_id}},[e("div",{staticClass:"pictrue flexnone"},[e("img",{attrs:{src:r.image,alt:""}})]),t._v(" "),e("div",[e("div",{staticClass:"name line2"},[t._v("\n "+t._s(r.goods_name)+"\n ")]),t._v(" "),e("div",{staticClass:"muted"},[t._v("\n "+t._s(r.spec_value_str)+"\n ")])])]),t._v(" "),e("div",{staticClass:"price flex row-center"},[t._v("\n ¥"+t._s(r.price)+"\n ")]),t._v(" "),e("div",{staticClass:"num flex row-center"},[e("number-box",{attrs:{min:1,"async-change":""},on:{change:function(e){return t.changeShopCartCount(e,r.cart_id)}},model:{value:r.goods_num,callback:function(e){t.$set(r,"goods_num",e)},expression:"item2.goods_num"}})],1),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.cart_id)}}},[e("div",{staticClass:"operate flex row-center delete-btn",attrs:{slot:"reference"},slot:"reference"},[e("img",{attrs:{src:n(633)}})])])],1)}))],2)})),0),t._v(" "),e("div",{staticClass:"cart-footer flex row-between bg-white"},[e("div",{staticClass:"lighter flex"},[e("div",{staticClass:"check-box"},[e("el-checkbox",{on:{change:function(e){return t.onBoxClick(e,3,"")}},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(" "),e("el-popconfirm",{attrs:{title:"确定删除选中商品吗?","confirm-button-text":"确定","cancel-button-text":"取消",icon:"el-icon-info","icon-color":"red"},on:{confirm:t.deleteSelectedGoods}},[e("div",{staticClass:"xs normal",staticStyle:{cursor:"pointer"},attrs:{slot:"reference"},slot:"reference"},[t._v("\n 删除选中商品\n ")])]),t._v(" "),e("el-popconfirm",{attrs:{title:"确定清空吗?","confirm-button-text":"确定","cancel-button-text":"取消",icon:"el-icon-info","icon-color":"red"},on:{confirm:t.deleteAlldGoods}},[e("div",{staticClass:"m-l-14 xs muted",staticStyle:{cursor:"pointer"},attrs:{slot:"reference"},slot:"reference"},[t._v("\n 清空购物车\n ")])])],1),t._v(" "),e("div",{staticClass:"total flex"},[e("div",{staticClass:"flex m-r-14"},[e("div",{staticClass:"xs"},[t._v("已选"+t._s(t.selected)+"件商品")]),t._v(" "),e("div",{staticClass:"primary m-l-20",staticStyle:{"font-size":"22px"}},[t._v("\n ¥"+t._s(t.totalAmount)+"\n ")])]),t._v(" "),e("div",{staticClass:"white lg btn flex row-center",style:{background:0==t.selected?"#A4ADB3":"#FF2C3C"},on:{click:t.toOrderBuy}},[t._v("\n 去结算\n ")])])])]),t._v(" "),e("div",{directives:[{name:"show",rawName:"v-show",value:t.isDataNull,expression:"isDataNull"}],staticClass:"column-center data-null"},[e("img",{staticStyle:{width:"150px",height:"150px"},attrs:{src:n(634)}}),t._v(" "),e("div",{staticClass:"muted xs m-t-10"},[t._v("购物车是空的~")]),t._v(" "),e("div",{staticClass:"m-t-30"},[e("el-button",{attrs:{round:"",type:"primary",size:"medium"},on:{click:t.toIndex}},[t._v("去逛逛~")])],1)])])])}),[],!1,null,"750ce260",null);e.default=component.exports;installComponents(component,{NumberBox:n(546).default})}}]);