1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-cart-cart"],{"0f44":function(t,e,i){var a=i("93b8");"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("4f06").default;n("d344bae8",a,!0,{sourceMap:!1,shadowMode:!1})},"397f":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,".uni-numbox[data-v-699ee27c]{\n\t/* position:absolute; */\n\t/* left: 30rpx; */\n\t/* bottom: 0; */display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-align:center;-webkit-align-items:center;align-items:center;width:%?180?%;height:%?52?%;background:#f5f5f5\n\t/* border: 1px solid #C7C7C7; */\n\t/* border-radius: 4rpx 4rpx 4rpx 4rpx; */\n\t/* z-index: 999; */}.uni-numbox-minus[data-v-699ee27c],\n.uni-numbox-plus[data-v-699ee27c]{border:1px solid #c7c7c7;margin:0;background-color:#f5f5f5;width:%?60?%;height:%?52?%;line-height:%?52?%;text-align:center;position:relative}.uni-numbox-minus .yticon[data-v-699ee27c],\n.uni-numbox-plus .yticon[data-v-699ee27c]{font-size:%?36?%;color:#555}.uni-numbox-minus[data-v-699ee27c]{border-right:none;border-top-left-radius:%?4?%;border-bottom-left-radius:%?4?%}.uni-numbox-plus[data-v-699ee27c]{border-left:none;border-top-right-radius:%?4?%;border-bottom-right-radius:%?4?%}.uni-numbox-value[data-v-699ee27c]{position:relative;background-color:#f5f5f5;width:%?60?%;height:%?52?%;text-align:center;padding:0;font-size:%?30?%;border:1px solid #c7c7c7}.uni-numbox-disabled[data-v-699ee27c]{color:#d6d6d6!important}",""]),t.exports=e},"39e8":function(t,e,i){"use strict";var a=i("4ea4");i("4160"),i("a15b"),i("d81d"),i("26e9"),i("a434"),i("a9e3"),i("b680"),i("159b"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("96cf");var n=a(i("1da1")),o=a(i("5530")),r=i("735f"),c=i("2f62"),s=a(i("a592")),d=i("3034"),l={components:{uniNumberBox:s.default},data:function(){return{total:0,allChecked:!1,empty:!1,cartList:[]}},onShow:function(){this.hasLogin&&this.loadData()},watch:{cartList:function(t){var e=0===t.length;this.empty!==e&&(this.empty=e)}},computed:(0,o.default)({},(0,c.mapState)("user",["hasLogin"])),methods:{loadData:function(){var t=this;return(0,n.default)(regeneratorRuntime.mark((function e(){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=t,(0,r.getCartList)({}).then((function(t){i.cartList.length;var e=i.cartList.reverse(),a=t.data.valid.reverse();i.cartList=a.map((function(t,i){t.checked=!0;var a=e[i];return a&&"loaded"==a.loaded&&(t.loaded="loaded"),t})).reverse(),i.calcTotal()})).catch((function(t){console.log(t)}));case 2:case"end":return e.stop()}}),e)})))()},onImageLoad:function(t,e){this.$set(this[t][e],"loaded","loaded")},onImageError:function(t,e){this[t][e].image="/static/error/errorImage.jpg"},navToLogin:function(){(0,d.saveUrl)(),(0,d.interceptor)()},check:function(t,e){if("item"===t)this.cartList[e].checked=!this.cartList[e].checked;else{var i=!this.allChecked,a=this.cartList;a.forEach((function(t){t.checked=i})),this.allChecked=i}this.calcTotal(t)},numberChange:function(t){var e=this.cartList[t.index];e.cart_num=t.number,(0,r.getCartNum)({id:e.id,number:t.number}).then((function(t){console.log(t)})).catch((function(t){console.log(t)})),this.calcTotal()},deleteCartItem:function(t){var e=this.cartList,i=e[t],a=i.id;(0,r.cartDel)({ids:a}),this.cartList.splice(t,1),uni.hideLoading(),this.calcTotal()},clearCart:function(){var t=this;uni.showModal({content:"清空购物车?",success:function(e){if(e.confirm){var i=t.cartList.map((function(t){return t.id}));(0,r.cartDel)({ids:i.join(",")}).then((function(t){console.log(t)})),t.cartList=[]}}})},calcTotal:function(){var t=this.cartList;if(0!==t.length){var e=0,i=!0;t.forEach((function(t){!0===t.checked?e+=t.productInfo.price*t.cart_num:!0===i&&(i=!1)})),this.allChecked=i,this.total=Number(e.toFixed(2))}else this.empty=!0},createOrder:function(){var t=this.cartList,e=[];t.forEach((function(t){t.checked&&e.push(t.id)})),uni.navigateTo({url:"/pages/order/createOrder?id="+e.join(",")})}}};e.default=l},"735f":function(t,e,i){"use strict";var a=i("dbce");Object.defineProperty(e,"__esModule",{value:!0}),e.edit=o,e.orderData=r,e.getUserInfo=c,e.spreadBanner=s,e.getAddressList=d,e.addressEdit=l,e.addressDel=u,e.setAddressDefault=f,e.getCartList=h,e.getCartNum=p,e.cartDel=b,e.getcollectList=m,e.delcollect=v,e.upload=g,e.getSpreadPeople=x,e.getSpreadCount=k,e.bindAdmin=w,e.orderVerific=y,e.getOrderList=C,e.getAllList=_,e.getPoint=L,e.delPoint=D,e.editPoint=I;var n=a(i("bc58"));function o(t){return(0,n.default)({url:"/api/user/edit",method:"post",data:t})}function r(t){return(0,n.default)({url:"/api/order/data",method:"get",data:t})}function c(t){return(0,n.default)({url:"/api/userinfo",method:"get",data:t})}function s(t){return(0,n.default)({url:"/api/spread/banner",method:"get",data:t})}function d(t){return(0,n.default)({url:"/api/address/list",method:"get",data:t})}function l(t){return(0,n.default)({url:"/api/address/edit",method:"post",data:t})}function u(t){return(0,n.default)({url:"/api/address/del",method:"post",data:t})}function f(t){return(0,n.default)({url:"/api/address/default/set",method:"post",data:t})}function h(t){return(0,n.default)({url:"/api/cart/list",method:"get",data:t})}function p(t){return(0,n.default)({url:"/api/cart/num",method:"post",data:t})}function b(t){return(0,n.default)({url:"/api/cart/del",method:"post",data:t})}function m(t){return(0,n.default)({url:"/api/collect/user",method:"get",data:t})}function v(t){return(0,n.default)({url:"/api/collect/del",method:"post",data:t})}function g(t){return(0,n.upFilse)({url:"/api/upload/image",method:"post",data:t})}function x(t){return(0,n.default)({url:"/api/spread/people",method:"post",data:t})}function k(t,e){return(0,n.default)({url:"/api/spread/count/"+e,method:"get",data:t})}function w(t){return(0,n.default)({url:"/api/bind_admin",method:"post",data:t})}function y(t){return(0,n.default)({url:"/api/order/order_verific",method:"post",data:t})}function C(t){return(0,n.default)({url:"/api/order/order_verific",method:"post",data:t})}function _(t){return(0,n.default)({url:"/api/admin/order/list",method:"get",data:t})}function L(t){return(0,n.default)({url:"/api/admin/point",method:"get",data:t})}function D(t,e){return(0,n.default)({url:"/api/admin/point/"+e,method:"delete",data:t})}function I(t,e){return(0,n.default)({url:"/api/admin/point/"+e,method:"post",data:t})}},"860e":function(t,e,i){"use strict";i.r(e);var a=i("ae17"),n=i.n(a);for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);e["default"]=n.a},"8a0c":function(t,e,i){"use strict";var a;i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return a}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"uni-numbox"},[i("v-uni-view",{staticClass:"uni-numbox-minus",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t._calcValue("subtract")}}},[i("v-uni-text",{staticClass:"iconfont iconmove",class:t.minDisabled?"uni-numbox-disabled":""})],1),i("v-uni-input",{staticClass:"uni-numbox-value",attrs:{type:"number",disabled:!0,value:t.inputValue},on:{blur:function(e){arguments[0]=e=t.$handleEvent(e),t._onBlur.apply(void 0,arguments)}}}),i("v-uni-view",{staticClass:"uni-numbox-plus",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t._calcValue("add")}}},[i("v-uni-text",{staticClass:"iconfont iconadd",class:t.maxDisabled?"uni-numbox-disabled":""})],1)],1)},o=[]},"933d":function(t,e,i){"use strict";var a;i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return a}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"container"},[t.hasLogin&&!0!==t.empty?i("v-uni-view",[i("v-uni-view",{staticClass:"cart-list"},[t._l(t.cartList,(function(e,a){return[i("v-uni-view",{staticClass:"cart-item",class:{"b-b":a!==t.cartList.length-1}},[i("v-uni-view",{staticClass:"image-wrapper"},[i("v-uni-image",{class:[e.loaded],attrs:{src:e.productInfo.image,mode:"aspectFill","lazy-load":!0},on:{load:function(e){arguments[0]=e=t.$handleEvent(e),t.onImageLoad("cartList",a)},error:function(e){arguments[0]=e=t.$handleEvent(e),t.onImageError("cartList",a)}}}),i("v-uni-view",{staticClass:"iconfont iconroundcheckfill checkbox",class:{checked:e.checked},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.check("item",a)}}})],1),i("v-uni-view",{staticClass:"item-right"},[i("v-uni-text",{staticClass:"clamp title"},[t._v(t._s(e.productInfo.store_name))]),i("v-uni-text",{staticClass:"attr"},[t._v("已选: "+t._s(e.productInfo.attrInfo.suk))]),i("v-uni-text",{staticClass:"price"},[t._v("¥"+t._s(e.productInfo.price)),i("v-uni-text",{staticClass:"oldprice"},[t._v("¥"+t._s(e.productInfo.ot_price))])],1),i("uni-number-box",{staticClass:"step",attrs:{min:1,max:e.productInfo.stock,value:e.cart_num>e.productInfo.stock?e.productInfo.stock:e.cart_num,isMax:e.cart_num>=e.productInfo.stock,isMin:1===e.cart_num,index:a},on:{eventChange:function(e){arguments[0]=e=t.$handleEvent(e),t.numberChange.apply(void 0,arguments)}}}),i("v-uni-text",{staticClass:"del-btn iconfont iconclose",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.deleteCartItem(a)}}})],1)],1),i("v-uni-view",{staticClass:"jg"})]}))],2),i("v-uni-view",{staticClass:"action-section"},[i("v-uni-view",{staticClass:"checkbox"},[i("v-uni-view",{staticClass:"iconfont iconroundcheckfill icon-checked-box",class:{"icon-checked":t.allChecked},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.check("all")}}}),i("v-uni-view",{staticClass:"clear-btn",class:{show:t.allChecked},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.allChecked&&t.clearCart()}}},[i("v-uni-text",[t._v("清空")])],1)],1),i("v-uni-view",{staticClass:"total-box"},[i("v-uni-text",{staticClass:"price"},[t._v("¥"+t._s(t.total))])],1),i("v-uni-button",{staticClass:"no-border confirm-btn",attrs:{type:"primary"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.createOrder.apply(void 0,arguments)}}},[t._v("去结算")])],1)],1):i("v-uni-view",{staticClass:"empty"},[i("v-uni-image",{staticClass:"emptyImg",attrs:{src:"/static/error/emptyCart.png",mode:"aspectFit"}}),t.hasLogin?i("v-uni-view",{staticClass:"empty-tips"},[t._v("空空如也"),t.hasLogin?i("v-uni-navigator",{staticClass:"navigator",attrs:{url:"../index/index","open-type":"switchTab"}},[t._v("随便逛逛>")]):t._e()],1):i("v-uni-view",{staticClass:"empty-tips"},[t._v("空空如也"),i("v-uni-view",{staticClass:"navigator",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.navToLogin.apply(void 0,arguments)}}},[t._v("去登陆>")])],1)],1)],1)},o=[]},"93b8":function(t,e,i){var a=i("24fb");e=a(!1),e.push([t.i,'@charset "UTF-8";\n/* 页面左右间距 */\n/* 文字尺寸 */\n/*文字颜色*/\n/* 边框颜色 */\n/*颜色*/\n/* 图片加载中颜色 */\n/* 行为相关颜色 */\n/* 功能栏字体大小 */\n/*功能栏左侧小图标*/.container[data-v-522be4f5]{padding-bottom:%?134?%;background-color:#f8f6f6\n /* 空白页 */}.container .empty[data-v-522be4f5]{position:fixed;left:0;top:0;width:100%;height:100vh;padding-bottom:%?100?%;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-align:center;-webkit-align-items:center;align-items:center;background:#fff}.container .empty .emptyImg[data-v-522be4f5]{width:%?300?%;height:%?250?%;margin-bottom:%?30?%}.container .empty .empty-tips[data-v-522be4f5]{display:-webkit-box;display:-webkit-flex;display:flex;font-size:%?26?%;color:#c0c4cc}.container .empty .empty-tips .navigator[data-v-522be4f5]{margin-left:%?16?%;color:#901b21}\n/* 购物车列表项 */.cart-item[data-v-522be4f5]{display:-webkit-box;display:-webkit-flex;display:flex;position:relative;padding:%?30?% %?38?% %?27?% %?92?%}.cart-item .image-wrapper[data-v-522be4f5]{width:%?160?%;height:%?160?%;-webkit-flex-shrink:0;flex-shrink:0;position:relative}.cart-item .image-wrapper uni-image[data-v-522be4f5]{border-radius:%?8?%}.cart-item .checkbox[data-v-522be4f5]{position:absolute;left:%?-67?%;top:%?57?%;margin:auto 0;z-index:8;font-size:%?44?%;line-height:1;padding:%?4?%;color:#c0c4cc;background:#fff;border-radius:50px}.cart-item .item-right[data-v-522be4f5]{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:hidden;position:relative;padding-left:%?30?%}.cart-item .item-right .ex-addr[data-v-522be4f5]{height:%?22?%;font-size:%?22?%;font-weight:500;color:#dcb876}.cart-item .item-right .ex-addr uni-image[data-v-522be4f5]{height:%?22?%}.cart-item .item-right .ex-addr .name-img[data-v-522be4f5]{width:%?26?%;margin:0 %?4?% %?-3?% 0}.cart-item .item-right .ex-addr .point-img[data-v-522be4f5]{width:%?16?%;margin:0 %?4?% %?-3?% %?14?%}.cart-item .item-right .title[data-v-522be4f5],\n.cart-item .item-right .price[data-v-522be4f5]{font-size:%?30?%;color:#303133;height:%?40?%;line-height:%?40?%;font-weight:700;color:#333}.cart-item .item-right .title .oldprice[data-v-522be4f5],\n.cart-item .item-right .price .oldprice[data-v-522be4f5]{font-size:%?24?%;color:#9a9a9a;text-decoration:line-through;display:inline-block;padding-left:%?10?%}.cart-item .item-right .title[data-v-522be4f5]{width:%?350?%}.cart-item .item-right .attr[data-v-522be4f5]{font-size:%?26?%;color:#909399;height:%?50?%;line-height:%?50?%}.cart-item .item-right .price[data-v-522be4f5]{position:absolute;bottom:0;height:%?50?%;line-height:%?50?%}.cart-item .item-right .step[data-v-522be4f5]{position:absolute;bottom:0;right:%?0?%}.cart-item .item-right .del-btn[data-v-522be4f5]{padding:%?4?% %?10?%;font-size:%?34?%;height:%?50?%;color:#909399;position:absolute;top:0;right:0}\n/* 底部栏 */.action-section[data-v-522be4f5]{margin-bottom:%?100?%;position:fixed;left:%?30?%;bottom:%?30?%;z-index:95;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;width:%?690?%;height:%?100?%;padding:0 %?30?%;background:hsla(0,0%,100%,.9);-webkit-box-shadow:0 0 %?20?% 0 rgba(0,0,0,.5);box-shadow:0 0 %?20?% 0 rgba(0,0,0,.5);border-radius:%?16?%}.action-section .checkbox[data-v-522be4f5]{height:%?52?%;position:relative}.action-section .checkbox .icon-checked-box[data-v-522be4f5]{border-radius:%?50?%;background-color:#fff;width:%?52?%;height:100%;position:relative;z-index:5;font-size:%?53?%;line-height:1;color:#909399}.action-section .checkbox .icon-checked[data-v-522be4f5]{color:#921a23}.action-section .clear-btn[data-v-522be4f5]{position:absolute;left:%?26?%;top:0;z-index:4;width:0;height:%?52?%;line-height:%?52?%;padding-left:%?38?%;font-size:%?28?%;color:#fff;background:#c0c4cc;border-radius:0 50px 50px 0;opacity:0;-webkit-transition:.2s;transition:.2s}.action-section .clear-btn.show[data-v-522be4f5]{opacity:1;width:%?120?%}.action-section .total-box[data-v-522be4f5]{-webkit-box-flex:1;-webkit-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;text-align:right;padding-right:%?40?%}.action-section .total-box .price[data-v-522be4f5]{font-size:%?32?%;color:#303133}.action-section .total-box .coupon[data-v-522be4f5]{font-size:%?24?%;color:#909399}.action-section .total-box .coupon uni-text[data-v-522be4f5]{color:#303133}.action-section .confirm-btn[data-v-522be4f5]{padding:0 %?38?%;margin:0;border-radius:100px;height:%?76?%;line-height:%?76?%;font-size:%?30?%;background:#921a23}\n/* 复选框选中状态 */.action-section .checkbox.checked[data-v-522be4f5],\n.cart-item .checkbox.checked[data-v-522be4f5]{color:#921a23}',""]),t.exports=e},"98ae":function(t,e,i){"use strict";i.r(e);var a=i("933d"),n=i("aabf");for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);i("e9f4");var r,c=i("f0c5"),s=Object(c["a"])(n["default"],a["b"],a["c"],!1,null,"522be4f5",null,!1,a["a"],r);e["default"]=s.exports},a592:function(t,e,i){"use strict";i.r(e);var a=i("8a0c"),n=i("860e");for(var o in n)"default"!==o&&function(t){i.d(e,t,(function(){return n[t]}))}(o);i("f288");var r,c=i("f0c5"),s=Object(c["a"])(n["default"],a["b"],a["c"],!1,null,"699ee27c",null,!1,a["a"],r);e["default"]=s.exports},aabf:function(t,e,i){"use strict";i.r(e);var a=i("39e8"),n=i.n(a);for(var o in a)"default"!==o&&function(t){i.d(e,t,(function(){return a[t]}))}(o);e["default"]=n.a},ae17:function(t,e,i){"use strict";i("a9e3"),i("ac1f"),i("1276"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a={name:"uni-number-box",props:{isMax:{type:Boolean,default:!1},isMin:{type:Boolean,default:!1},index:{type:Number,default:0},value:{type:Number,default:0},min:{type:Number,default:-1/0},max:{type:Number,default:1/0},step:{type:Number,default:1},disabled:{type:Boolean,default:!1}},data:function(){return{inputValue:this.value,minDisabled:!1,maxDisabled:!1}},created:function(){this.maxDisabled=this.isMax,this.minDisabled=this.isMin},computed:{},watch:{inputValue:function(t){var e={number:t,index:this.index};this.$emit("eventChange",e)}},methods:{_calcValue:function(t){var e=this._getDecimalScale(),i=this.inputValue*e,a=0,n=this.step*e;console.log(this.min,this.max),"subtract"===t?(a=i-n,a<=this.min&&(this.minDisabled=!0),a<this.min&&(a=this.min),a<this.max&&!0===this.maxDisabled&&(this.maxDisabled=!1)):"add"===t&&(a=i+n,a>=this.max&&(this.maxDisabled=!0),a>this.max&&(a=this.max),a>this.min&&!0===this.minDisabled&&(this.minDisabled=!1)),a!==i&&(this.inputValue=a/e)},_getDecimalScale:function(){var t=1;return~~this.step!==this.step&&(t=Math.pow(10,(this.step+"").split(".")[1].length)),t},_onBlur:function(t){var e=t.detail.value;e?(e=+e,e>this.max?e=this.max:e<this.min&&(e=this.min),this.inputValue=e):this.inputValue=0}}};e.default=a},cc88:function(t,e,i){var a=i("397f");"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=i("4f06").default;n("b72efcf8",a,!0,{sourceMap:!1,shadowMode:!1})},e9f4:function(t,e,i){"use strict";var a=i("0f44"),n=i.n(a);n.a},f288:function(t,e,i){"use strict";var a=i("cc88"),n=i.n(a);n.a}}]);
|