|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-cart-cart"],{"071b":function(t,e,n){"use strict";n.r(e);var i=n("36cb"),a=n("70ad");for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("7645");var r,s=n("f0c5"),u=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,"1f875ce7",null,!1,i["a"],r);e["default"]=u.exports},"0ba2":function(t,e,n){"use strict";var i=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("734f")),o={components:{PageCtx:a.default},onShow:function(){this.$refs.page&&this.$refs.page.open()},mounted:function(){this.$refs.page.open()}};e.default=o},"0ddb":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 透明度 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 间距 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */uni-page-body[data-v-529a9cda]{background:#f5f5f5;padding-bottom:%?120?%}body.?%PAGE?%[data-v-529a9cda]{background:#f5f5f5}',""]),t.exports=e},"2f5d":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,"uni-page-body[data-v-49ac35f6]{background:#f5f5f5;padding-bottom:%?240?%}body.?%PAGE?%[data-v-49ac35f6]{background:#f5f5f5}",""]),t.exports=e},"36cb":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var i={uIcon:n("a653").default},a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"u-number-box"},[t.showMinus&&t.$slots.minus?n("v-uni-view",{staticClass:"u-number-box__slot",on:{touchstart:function(e){arguments[0]=e=t.$handleEvent(e),t.onTouchStart("minus")},touchend:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.clearTimeout.apply(void 0,arguments)},click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.clickHandler("minus")}}},[t._t("minus")],2):t.showMinus?n("v-uni-view",{staticClass:"u-number-box__minus",class:{"u-number-box__minus--disabled":t.isDisabled("minus")},style:[t.buttonStyle("minus")],attrs:{"hover-class":"u-number-box__minus--hover","hover-stay-time":"150"},on:{touchstart:function(e){arguments[0]=e=t.$handleEvent(e),t.onTouchStart("minus")},touchend:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.clearTimeout.apply(void 0,arguments)},click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.clickHandler("minus")}}},[n("u-icon",{attrs:{name:"minus",color:t.isDisabled("minus")?"#c8c9cc":"#323233",size:"15",bold:!0,customStyle:t.iconStyle}})],1):t._e(),t._t("input",[n("v-uni-input",{staticClass:"u-number-box__input",class:{"u-number-box__input--disabled":t.disabled||t.disabledInput},style:[t.inputStyle],attrs:{disabled:t.disabledInput||t.disabled,"cursor-spacing":t.getCursorSpacing,type:"number"},on:{blur:function(e){arguments[0]=e=t.$handleEvent(e),t.onBlur.apply(void 0,arguments)},focus:function(e){arguments[0]=e=t.$handleEvent(e),t.onFocus.apply(void 0,arguments)},input:function(e){arguments[0]=e=t.$handleEvent(e),t.onInput.apply(void 0,arguments)}},model:{value:t.currentValue,callback:function(e){t.currentValue=e},expression:"currentValue"}})]),t.showPlus&&t.$slots.plus?n("v-uni-view",{staticClass:"u-number-box__slot",on:{touchstart:function(e){arguments[0]=e=t.$handleEvent(e),t.onTouchStart("plus")},touchend:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.clearTimeout.apply(void 0,arguments)},click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.clickHandler("plus")}}},[t._t("plus")],2):t.showPlus?n("v-uni-view",{staticClass:"u-number-box__plus",class:{"u-number-box__minus--disabled":t.isDisabled("plus")},style:[t.buttonStyle("plus")],attrs:{"hover-class":"u-number-box__plus--hover","hover-stay-time":"150"},on:{touchstart:function(e){arguments[0]=e=t.$handleEvent(e),t.onTouchStart("plus")},touchend:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.clearTimeout.apply(void 0,arguments)},click:function(e){e.stopPropagation(),arguments[0]=e=t.$handleEvent(e),t.clickHandler("plus")}}},[n("u-icon",{attrs:{name:"plus",color:t.isDisabled("plus")?"#c8c9cc":"#323233",size:"15",bold:!0,customStyle:t.iconStyle}})],1):t._e()],2)},o=[]},"4a3c":function(t,e,n){"use strict";var i=n("c267"),a=n.n(i);a.a},"4abc":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ApiGetCartList=e.ApiDeleteCartGoods=e.ApiPutAddCart=e.ApiPutCartNum=void 0;var i=n("5767"),a="/mall/product",o=function(t){return(0,i.ToAsyncAwait)(i.MsbRequestTk.put("".concat(a,"/shoppingCart/number"),t))};e.ApiPutCartNum=o;var r=function(t){return(0,i.ToAsyncAwait)(i.MsbRequestTk.put("".concat(a,"/shoppingCart/increase"),t))};e.ApiPutAddCart=r;var s=function(t){return(0,i.ToAsyncAwait)(i.MsbRequestTk.delete("".concat(a,"/shoppingCart?idList=").concat(t.idList),t))};e.ApiDeleteCartGoods=s;var u=function(){return(0,i.ToAsyncAwait)(i.MsbRequestTk.get("".concat(a,"/shoppingCart")))};e.ApiGetCartList=u},"4b84":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 透明度 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 间距 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */uni-view[data-v-1f875ce7], uni-scroll-view[data-v-1f875ce7], uni-swiper-item[data-v-1f875ce7]{display:flex;flex-direction:column;flex-shrink:0;flex-grow:0;flex-basis:auto;align-items:stretch;align-content:flex-start}.u-number-box[data-v-1f875ce7]{display:flex;flex-direction:row;align-items:center}.u-number-box__slot[data-v-1f875ce7]{touch-action:none}.u-number-box__plus[data-v-1f875ce7], .u-number-box__minus[data-v-1f875ce7]{width:35px;display:flex;flex-direction:row;justify-content:center;align-items:center;touch-action:none}.u-number-box__plus--hover[data-v-1f875ce7], .u-number-box__minus--hover[data-v-1f875ce7]{background-color:#e6e6e6!important}.u-number-box__plus--disabled[data-v-1f875ce7], .u-number-box__minus--disabled[data-v-1f875ce7]{color:#c8c9cc;background-color:#f7f8fa}.u-number-box__plus[data-v-1f875ce7]{border-top-right-radius:4px;border-bottom-right-radius:4px}.u-number-box__minus[data-v-1f875ce7]{border-top-left-radius:4px;border-bottom-left-radius:4px}.u-number-box__input[data-v-1f875ce7]{position:relative;text-align:center;font-size:15px;padding:0;margin:0 2px;display:flex;flex-direction:row;align-items:center;justify-content:center}.u-number-box__input--disabled[data-v-1f875ce7]{color:#c8c9cc;background-color:#f2f3f5}',""]),t.exports=e},"6d5d":function(t,e,n){"use strict";n.r(e);var i=n("7dbe"),a=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},"70ad":function(t,e,n){"use strict";n.r(e);var i=n("8b14"),a=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},"734f":function(t,e,n){"use strict";n.r(e);var i=n("7ac9"),a=n("6d5d");for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("e8cc"),n("d245");var r,s=n("f0c5"),u=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,"49ac35f6",null,!1,i["a"],r);e["default"]=u.exports},7645:function(t,e,n){"use strict";var i=n("b402"),a=n.n(i);a.a},"7ac9":function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var i={uLoadmore:n("c153").default,uNumberBox:n("071b").default},a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"container"},[i("UiPageHeader",{class:"head__"+t.type,attrs:{back:"inner"==t.type}},[i("template",{slot:"custom"},[i("v-uni-view",{class:"head--title"},[i("v-uni-text",[t._v("购物车")]),t.list.length?i("v-uni-text",[t._v("("+t._s(t.list.length)+")")]):t._e()],1),"normal"==t.mode?i("v-uni-view",{staticClass:"head--edit",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleToggleMode.apply(void 0,arguments)}}},[t._v("编辑")]):i("v-uni-view",{staticClass:"head--finish",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleToggleMode.apply(void 0,arguments)}}},[t._v("完成")])],1)],2),t.isLoading?i("u-loadmore",{attrs:{status:"loading"}}):t._e(),t.list.length||t.isLoading?i("v-uni-view",{staticClass:"cart-list"},t._l(t.list,(function(e,n){return i("v-uni-view",{key:n,staticClass:"cart-item",on:{click:function(n){arguments[0]=n=t.$handleEvent(n),t.$Router.push("goodsDetail?id="+e.id)}}},[i("v-uni-label",{staticClass:"cart-item--radio",on:{click:function(n){n.stopPropagation(),arguments[0]=n=t.$handleEvent(n),t.handleCheckItem(e.id)}}},[i("v-uni-radio",{staticClass:"radio",attrs:{color:"#FF875B",checked:!!t.checkedIds.length&&t.checkedIds.includes(e.id)}})],1),i("v-uni-image",{staticClass:"cart-item--image",attrs:{src:e.product.mainPicture,mode:"scaleToFill"}}),i("v-uni-view",{staticClass:"cart-item--content"},[i("v-uni-view",{staticClass:"cart-item--title"},[i("v-uni-text",[t._v(t._s(e.product.name))])],1),i("v-uni-view",{staticClass:"cart-item--props"},[i("v-uni-view",{staticClass:"cart-item--props-item"},[i("v-uni-text",[t._v(t._s(e.productSku.name))])],1)],1),i("v-uni-view",{staticClass:"cart-item--footer"},[i("v-uni-view",{staticClass:"cart-item--price"},[i("v-uni-text",{staticClass:"unit"},[t._v("¥")]),i("v-uni-text",{staticClass:"value"},[t._v(t._s(e.productSku.sellPrice))])],1),i("v-uni-view",{staticClass:"cart-item--stepper"},[i("u-number-box",{attrs:{min:1,"button-size":"40rpx",bgColor:"#F5F6FA",value:e.number,max:e.maxBuyNum},on:{change:function(n){arguments[0]=n=t.$handleEvent(n),t.onChangeStepper(n,e)}}},[i("v-uni-text",{staticClass:"cart-item--stepper-icon",attrs:{slot:"minus"},slot:"minus"},[t._v("-")]),i("v-uni-text",{staticClass:"cart-item--stepper-icon",attrs:{slot:"plus"},slot:"plus"},[t._v("+")])],1)],1)],1)],1)],1)})),1):i("BsEmpty",{staticClass:"empty",attrs:{tips:"去挑点喜欢的好货吧~"}},[i("v-uni-image",{staticClass:"empty--icon",attrs:{slot:"icon",src:n("d7da")},slot:"icon"}),i("v-uni-view",{staticClass:"empty--btn",attrs:{slot:"btn"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.$Router.push("/")}},slot:"btn"},[t._v("去逛逛")])],1),t.isLoading?t._e():[i("v-uni-view",{staticClass:"title"},[t._v("为您推荐")]),i("BsChoiceGoods")],t.list.length?i("v-uni-view",{class:"footer footer__"+t.type},[i("v-uni-label",{staticClass:"all-radio",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleCheckAll.apply(void 0,arguments)}}},[i("v-uni-radio",{staticClass:"radio",attrs:{color:"#FF875B",checked:t.checkedIds.length>0&&t.checkedIds.length===t.list.length}}),i("v-uni-text",[t._v("全选")])],1),i("v-uni-view",{staticClass:"total-info"},[i("v-uni-text",[t._v("合计:")]),i("v-uni-view",{staticClass:"goods-price"},[i("v-uni-text",{staticClass:"unit"},[t._v("¥")]),i("v-uni-text",{staticClass:"value"},[t._v(t._s(t.totalPrice))])],1)],1),i("v-uni-view",{staticClass:"cart-action"},[i("v-uni-view",{staticClass:"btn-wrapper"},["normal"==t.mode?i("v-uni-view",{staticClass:"btn-item btn-main",class:{disabled:0===t.checkedIds.length},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleOrder()}}},[i("v-uni-text",[t._v("去结算 "+t._s(t.checkedIds.length>0?"("+t.checkedIds.length+")":""))])],1):t._e(),"edit"==t.mode?i("v-uni-view",{staticClass:"btn-item btn-main",class:{disabled:!t.checkedIds.length},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleDelete()}}},[i("v-uni-text",[t._v("删除")])],1):t._e()],1)],1)],1):t._e()],2)},o=[]},"7b59":function(t,e,n){var i=n("24fb");e=i(!1),e.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 文字基本颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 透明度 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 间距 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */.head[data-v-49ac35f6]{height:%?88?%;display:flex;justify-content:space-between;align-items:center;padding:0 %?30?%;background-color:#fff;position:-webkit-sticky;position:sticky;top:var(--window-top);z-index:999}.head--totla[data-v-49ac35f6]{font-size:%?36?%;color:#333}.head--edit[data-v-49ac35f6], .head--finish[data-v-49ac35f6]{font-size:%?28?%;color:#999}.head--finish[data-v-49ac35f6]{color:#ff512b}.head__tabBar[data-v-49ac35f6]{justify-content:center}.head__tabBar .head--edit[data-v-49ac35f6], .head__tabBar .head--finish[data-v-49ac35f6]{position:absolute;right:%?30?%}.cart-list[data-v-49ac35f6]{background:#fff}.cart-item[data-v-49ac35f6]{width:%?690?%;display:flex;align-items:center;padding:%?30?% 0;margin:0 auto %?24?% auto;border-bottom:1px solid #eee}.cart-item--radio[data-v-49ac35f6]{width:%?56?%;height:%?80?%;line-height:%?80?%;margin-right:%?10?%;text-align:center}.cart-item--radio .radio[data-v-49ac35f6]{-webkit-transform:scale(.76);transform:scale(.76)}.cart-item--image[data-v-49ac35f6]{width:%?170?%;height:%?170?%;display:block;border-radius:%?12?%}.cart-item--content[data-v-49ac35f6]{flex:1;padding-left:%?24?%}.cart-item--title[data-v-49ac35f6]{font-size:%?28?%;line-height:%?39?%;max-height:%?76?%;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.cart-item--props[data-v-49ac35f6]{margin-top:%?14?%;height:%?40?%;color:#ababab;font-size:%?24?%;overflow:hidden}.cart-item--props-item[data-v-49ac35f6]{display:inline-block;margin-right:%?14?%}.cart-item--footer[data-v-49ac35f6]{display:flex;justify-content:space-between;align-items:center;margin-top:%?20?%}.cart-item--price[data-v-49ac35f6]{vertical-align:bottom;color:#ff512b}.cart-item--price .unit[data-v-49ac35f6]{font-size:%?20?%}.cart-item--price .value[data-v-49ac35f6]{font-size:%?22?%;font-weight:700}.cart-item--stepper-icon[data-v-49ac35f6]{font-size:%?38?%;color:#ccc;margin:0 %?14?%}.cart-item--stepper-input[data-v-49ac35f6]{height:%?40?%;margin:0 %?14?%}.empty[data-v-49ac35f6]{background:#fff}.empty--btn[data-v-49ac35f6]{width:%?220?%;margin:0 auto %?10?% auto;font-size:%?28?%;height:%?64?%;line-height:%?64?%;text-align:center;color:#333;border-radius:%?50?%;border:1px solid #c0b9b9}.empty--icon[data-v-49ac35f6]{width:%?304?%;height:%?192?%}.title[data-v-49ac35f6]{font-size:%?32?%;text-align:center;margin:%?51?% auto %?30?% auto;display:flex;align-items:center;justify-content:space-between;width:%?500?%}.title[data-v-49ac35f6]::after, .title[data-v-49ac35f6]::before{display:inline-block;content:"";width:%?160?%;height:%?2?%;background:linear-gradient(90deg,#ccc,hsla(0,0%,80%,0))}.title[data-v-49ac35f6]::before{background:linear-gradient(270deg,#ccc,hsla(0,0%,80%,0))}.footer[data-v-49ac35f6]{display:flex;align-items:center;height:%?96?%;background:#fff;padding:0 %?30?%;position:fixed;bottom:%?120?%;left:0;right:0;z-index:11}.footer__inner[data-v-49ac35f6]{bottom:0}.footer .all-radio[data-v-49ac35f6]{width:%?140?%;display:flex;align-items:center;color:#666;font-size:%?24?%}.footer .all-radio .radio[data-v-49ac35f6]{margin-bottom:%?-4?%;-webkit-transform:scale(.76);transform:scale(.76)}.footer .total-info[data-v-49ac35f6]{flex:1;display:flex;align-items:center;justify-content:flex-end;padding-right:%?30?%;font-size:%?24?%;color:#666}.footer .total-info .goods-price[data-v-49ac35f6]{vertical-align:bottom;color:#ff875b}.footer .total-info .goods-price .unit[data-v-49ac35f6]{font-size:%?24?%}.footer .total-info .goods-price .value[data-v-49ac35f6]{font-size:%?32?%}.footer .cart-action[data-v-49ac35f6]{width:%?200?%}.footer .cart-action .btn-wrapper[data-v-49ac35f6]{height:100%;display:flex;align-items:center}.footer .cart-action .btn-item[data-v-49ac35f6]{flex:1;font-size:%?28?%;height:%?72?%;line-height:%?72?%;text-align:center;border-radius:%?50?%}.footer .cart-action .btn-item uni-text[data-v-49ac35f6]{color:#fff}.footer .cart-action .btn-main[data-v-49ac35f6]{background:#ff875b}.footer .cart-action .btn-main.disabled[data-v-49ac35f6]{background:rgba(255,135,91,.7)}',""]),t.exports=e},"7dbe":function(t,e,n){"use strict";var i=n("4ea4");n("4de4"),n("c740"),n("4160"),n("caad"),n("d81d"),n("a434"),n("2532"),n("159b"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("5530"));n("96cf");var o=i(n("1da1")),r=n("5767"),s=i(n("8832")),u=i(n("91cc")),c=i(n("1014")),l=n("4abc"),d="CartIds",f={components:{BsEmpty:s.default,BsChoiceGoods:u.default,UiPageHeader:c.default},props:{type:{type:String,default:"inner"}},data:function(){return{isLoading:!0,mode:"normal",list:[],total:null,checkedIds:[]}},watch:{checkedIds:{handler:function(t){uni.setStorageSync(d,t)},immediate:!1}},computed:{totalPrice:function(){var t=this,e=this.list.filter((function(e){return t.checkedIds.includes(e.id)})),n=0;return e.forEach((function(t){var e=100*t.productSku.sellPrice;n+=e*t.number})),(n/100).toFixed(2)}},methods:{open:function(t){this.getCartList(),this.isLoading=!1,this.checkedIds=uni.getStorageSync(d)},getCartList:function(){var t=this;return(0,o.default)(regeneratorRuntime.mark((function e(){var n,i,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,(0,l.ApiGetCartList)();case 3:if(n=e.sent,i=n.error,o=n.result,!i){e.next=9;break}return uni.$u.toast(i.message),e.abrupt("return",!1);case 9:t.list=o.map((function(t){var e=t.product.singleBuyLimit,n=t.productSku.stock,i=e?Math.min(e,n||1):n;return(0,a.default)((0,a.default)({},t),{},{maxBuyNum:i})})),t.onClearInvalidId(),t.isLoading=!1;case 12:case"end":return e.stop()}}),e)})))()},onClearInvalidId:function(){var t=this;this.checkedIds=this.checkedIds.filter((function(e){return t.list.findIndex((function(t){return t.id===e}))>-1}))},handleToggleMode:function(){this.mode="normal"==this.mode?"edit":"normal"},onChangeStepper:function(t,e){var n=t.value;if(e.number==n)return uni.$u.toast("数量不能再少了"),!1;e.debounceHandle||(e.oldValue=e.number,e.debounceHandle=(0,r.Debounce)(this.updateCartNum,500)),e.number=n,e.debounceHandle(e,e.oldValue,n)},updateCartNum:function(t,e,n){var i=this;return(0,o.default)(regeneratorRuntime.mark((function e(){var n,a,o;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,l.ApiPutCartNum)({id:t.id,number:t.number});case 2:if(n=e.sent,a=n.error,o=n.result,!a){e.next=9;break}return i.$toast(a.message),t.number=t.sku,e.abrupt("return",!1);case 9:if(!o.isBeyondMaxLimit){e.next=13;break}return uni.$u.toast("数量超出范围"),t.number=o.canSetShoppingCartNumber,e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e)})))()},handleCheckItem:function(t){var e=this.checkedIds,n=e.findIndex((function(e){return e===t}));n<0?e.push(t):e.splice(n,1)},handleCheckAll:function(){var t=this.checkedIds,e=this.list;this.checkedIds=t.length===e.length?[]:e.map((function(t){return t.id}))},handleOrder:function(){var t=this.checkedIds;t.length&&this.$Router.push({path:"/orderSubmit",query:{mode:"cart",ids:t.join(",")}})},handleDelete:function(){var t=this,e=this.checkedIds;if(!e.length)return!1;uni.showModal({title:"友情提示",content:"您确定要删除该商品吗?",showCancel:!0,success:function(){var n=(0,o.default)(regeneratorRuntime.mark((function n(){var i,a;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,(0,l.ApiDeleteCartGoods)({idList:e.join(",")});case 2:if(i=n.sent,a=i.error,!a){n.next=7;break}return uni.$u.toast(a.message),n.abrupt("return",!1);case 7:t.list=t.list.filter((function(t){return!e.includes(t.id)})),t.onClearInvalidId();case 9:case"end":return n.stop()}}),n)})));function i(){return n.apply(this,arguments)}return i}()})}}};e.default=f},"8b14":function(t,e,n){"use strict";var i=n("4ea4");n("99af"),n("4de4"),n("c975"),n("fb6a"),n("d3b7"),n("ac1f"),n("25f0"),n("5319"),n("1276"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("5530")),o=i(n("f5d7")),r={name:"u-number-box",mixins:[uni.$u.mpMixin,uni.$u.mixin,o.default],data:function(){return{currentValue:"",longPressTimer:null}},watch:{watchChange:function(t){this.check()},value:function(t){t!==this.currentValue&&(this.currentValue=this.format(this.value))}},computed:{getCursorSpacing:function(){return uni.$u.getPx(this.cursorSpacing)},buttonStyle:function(){var t=this;return function(e){var n={backgroundColor:t.bgColor,height:uni.$u.addUnit(t.buttonSize),color:t.color};return t.isDisabled(e)&&(n.backgroundColor="#f7f8fa"),n}},inputStyle:function(){this.disabled||this.disabledInput;var t={color:this.color,backgroundColor:this.bgColor,height:uni.$u.addUnit(this.buttonSize),width:uni.$u.addUnit(this.inputWidth)};return t},watchChange:function(){return[this.integer,this.decimalLength,this.min,this.max]},isDisabled:function(){var t=this;return function(e){return"plus"===e?t.disabled||t.disablePlus||t.currentValue>=t.max:t.disabled||t.disableMinus||t.currentValue<=t.min}}},mounted:function(){this.init()},methods:{init:function(){this.currentValue=this.format(this.value)},format:function(t){return t=this.filter(t),t=""===t?0:+t,t=Math.max(Math.min(this.max,t),this.min),null!==this.decimalLength&&(t=t.toFixed(this.decimalLength)),t},filter:function(t){return t=String(t).replace(/[^0-9.-]/g,""),this.integer&&-1!==t.indexOf(".")&&(t=t.split(".")[0]),t},check:function(){var t=this.format(this.currentValue);t!==this.currentValue&&(this.currentValue=t)},onFocus:function(t){this.$emit("focus",(0,a.default)((0,a.default)({},t.detail),{},{name:this.name}))},onBlur:function(t){this.format(t.detail.value);this.$emit("blur",(0,a.default)((0,a.default)({},t.detail),{},{name:this.name}))},onInput:function(t){var e=t.detail||{},n=e.value,i=void 0===n?"":n;if(""!==i){var a=this.filter(i);if(null!==this.decimalLength&&-1!==a.indexOf(".")){var o=a.split(".");a="".concat(o[0],".").concat(o[1].slice(0,this.decimalLength))}a=this.format(a),this.emitChange(a)}},emitChange:function(t){var e=this;this.asyncChange||this.$nextTick((function(){e.$emit("input",t),e.currentValue=t,e.$forceUpdate()})),this.$emit("change",{value:t,name:this.name})},onChange:function(){var t=this.type;if(this.isDisabled(t))return this.$emit("overlimit",t);var e="minus"===t?-this.step:+this.step,n=this.format(this.add(+this.currentValue,e));this.emitChange(n),this.$emit(t)},add:function(t,e){var n=Math.pow(10,10);return Math.round((t+e)*n)/n},clickHandler:function(t){this.type=t,this.onChange()},longPressStep:function(){var t=this;this.clearTimeout(),this.longPressTimer=setTimeout((function(){t.onChange(),t.longPressStep()}),250)},onTouchStart:function(t){var e=this;this.longPress&&(this.clearTimeout(),this.type=t,this.longPressTimer=setTimeout((function(){e.onChange(),e.longPressStep()}),600))},onTouchEnd:function(){this.longPress&&this.clearTimeout()},clearTimeout:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){clearTimeout(this.longPressTimer),this.longPressTimer=null}))}};e.default=r},"8ea5":function(t,e,n){var i=n("7b59");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("6cf96ffd",i,!0,{sourceMap:!1,shadowMode:!1})},b402:function(t,e,n){var i=n("4b84");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("d5a876ee",i,!0,{sourceMap:!1,shadowMode:!1})},b408:function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("PageCtx",{ref:"page",staticClass:"page",attrs:{type:"inner"}})},o=[]},c267:function(t,e,n){var i=n("0ddb");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("1edb3d4a",i,!0,{sourceMap:!1,shadowMode:!1})},d07f:function(t,e,n){var i=n("2f5d");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var a=n("4f06").default;a("3e2ea54e",i,!0,{sourceMap:!1,shadowMode:!1})},d245:function(t,e,n){"use strict";var i=n("8ea5"),a=n.n(i);a.a},d7da:function(t,e,n){t.exports=n.p+"static/img/cart.5b9fd199.png"},e81f:function(t,e,n){"use strict";n.r(e);var i=n("0ba2"),a=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},e8cc:function(t,e,n){"use strict";var i=n("d07f"),a=n.n(i);a.a},f5d7:function(t,e,n){"use strict";n("a9e3"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={props:{name:{type:[String,Number],default:uni.$u.props.numberBox.name},value:{type:[String,Number],default:uni.$u.props.numberBox.value},min:{type:[String,Number],default:uni.$u.props.numberBox.min},max:{type:[String,Number],default:uni.$u.props.numberBox.max},step:{type:[String,Number],default:uni.$u.props.numberBox.step},integer:{type:Boolean,default:uni.$u.props.numberBox.integer},disabled:{type:Boolean,default:uni.$u.props.numberBox.disabled},disabledInput:{type:Boolean,default:uni.$u.props.numberBox.disabledInput},asyncChange:{type:Boolean,default:uni.$u.props.numberBox.asyncChange},inputWidth:{type:[String,Number],default:uni.$u.props.numberBox.inputWidth},showMinus:{type:Boolean,default:uni.$u.props.numberBox.showMinus},showPlus:{type:Boolean,default:uni.$u.props.numberBox.showPlus},decimalLength:{type:[String,Number,null],default:uni.$u.props.numberBox.decimalLength},longPress:{type:Boolean,default:uni.$u.props.numberBox.longPress},color:{type:String,default:uni.$u.props.numberBox.color},buttonSize:{type:[String,Number],default:uni.$u.props.numberBox.buttonSize},bgColor:{type:String,default:uni.$u.props.numberBox.bgColor},cursorSpacing:{type:[String,Number],default:uni.$u.props.numberBox.cursorSpacing},disablePlus:{type:Boolean,default:uni.$u.props.numberBox.disablePlus},disableMinus:{type:Boolean,default:uni.$u.props.numberBox.disableMinus},iconStyle:{type:[Object,String],default:uni.$u.props.numberBox.iconStyle}}};e.default=i},f662:function(t,e,n){"use strict";n.r(e);var i=n("b408"),a=n("e81f");for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("4a3c");var r,s=n("f0c5"),u=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,"529a9cda",null,!1,i["a"],r);e["default"]=u.exports}}]); |