You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/h5/static/js/pages-cart-cart~pages-cart-...

1 line
18 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-cart-cart~pages-cart-tabBarCart"],{"04a6":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAMAAABmiH5zAAAAAXNSR0IArs4c6QAAAHhQTFRFAAAAAAAAICAgKioqMDAwKioqLi4uNDQ0MzMzMjIyMDAwMzMzMTExNDQ0NDQ0NDQ0MjIyMzMzMzMzMjIyMzMzMjIyMzMzMjIyMjIyMzMzMjIyMjIyMzMzMzMzMjIyMzMzMjIyMzMzMzMzMzMzMjIyMjIyMzMzMzMzaWTzlAAAACd0Uk5TAAQIDBAYHCcoODs8P1NUY2dvc3+Lj5ufp6uzt8PHy9fb4+fr7/P7SlyCtgAAAIxJREFUGNNd0FEbgUAQheFJVikhhIjVUt///4fuZmebu/dmnnOOSLzq2xsVgV/UJsBe5Ty0qvwNZ9VqgE6V9WC+3uCZqToYctUJ/Fp1hI9TNTOhVO1mpigZmWpJWBnWM1NhvJ8J1gfwzrgFnxtfkpAiV3jECsuCkiX1RfKXHWc5nYgboTEuk9lFtuH+ByUHDZC4eEb4AAAAAElFTkSuQmCC"},1014:function(t,e,a){"use strict";a.r(e);var n=a("f74c"),i=a("f341");for(var r in i)"default"!==r&&function(t){a.d(e,t,(function(){return i[t]}))}(r);a("e84f");var c,o=a("f0c5"),s=Object(o["a"])(i["default"],n["b"],n["c"],!1,null,"1cbadadd",null,!1,n["a"],c);e["default"]=s.exports},"2f5d":function(t,e,a){var n=a("24fb");e=n(!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},"6d5d":function(t,e,a){"use strict";a.r(e);var n=a("7dbe"),i=a.n(n);for(var r in n)"default"!==r&&function(t){a.d(e,t,(function(){return n[t]}))}(r);e["default"]=i.a},"734f":function(t,e,a){"use strict";a.r(e);var n=a("7ac9"),i=a("6d5d");for(var r in i)"default"!==r&&function(t){a.d(e,t,(function(){return i[t]}))}(r);a("e8cc"),a("d245");var c,o=a("f0c5"),s=Object(o["a"])(i["default"],n["b"],n["c"],!1,null,"49ac35f6",null,!1,n["a"],c);e["default"]=s.exports},"7ac9":function(t,e,a){"use strict";a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return r})),a.d(e,"a",(function(){return n}));var n={uLoadmore:a("c153").default,uNumberBox:a("071b").default},i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"container"},[n("UiPageHeader",{class:"head__"+t.type,attrs:{back:"inner"==t.type}},[n("template",{slot:"custom"},[n("v-uni-view",{class:"head--title"},[n("v-uni-text",[t._v("购物车")]),t.list.length?n("v-uni-text",[t._v("("+t._s(t.list.length)+")")]):t._e()],1),"normal"==t.mode?n("v-uni-view",{staticClass:"head--edit",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleToggleMode.apply(void 0,arguments)}}},[t._v("编辑")]):n("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?n("u-loadmore",{attrs:{status:"loading"}}):t._e(),t.list.length||t.isLoading?n("v-uni-view",{staticClass:"cart-list"},t._l(t.list,(function(e,a){return n("v-uni-view",{key:a,staticClass:"cart-item",on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.$Router.push("goodsDetail?id="+e.id)}}},[n("v-uni-label",{staticClass:"cart-item--radio",on:{click:function(a){a.stopPropagation(),arguments[0]=a=t.$handleEvent(a),t.handleCheckItem(e.id)}}},[n("v-uni-radio",{staticClass:"radio",attrs:{color:"#FF875B",checked:!!t.checkedIds.length&&t.checkedIds.includes(e.id)}})],1),n("v-uni-image",{staticClass:"cart-item--image",attrs:{src:e.product.mainPicture,mode:"scaleToFill"}}),n("v-uni-view",{staticClass:"cart-item--content"},[n("v-uni-view",{staticClass:"cart-item--title"},[n("v-uni-text",[t._v(t._s(e.product.name))])],1),n("v-uni-view",{staticClass:"cart-item--props"},[n("v-uni-view",{staticClass:"cart-item--props-item"},[n("v-uni-text",[t._v(t._s(e.productSku.name))])],1)],1),n("v-uni-view",{staticClass:"cart-item--footer"},[n("v-uni-view",{staticClass:"cart-item--price"},[n("v-uni-text",{staticClass:"unit"},[t._v("¥")]),n("v-uni-text",{staticClass:"value"},[t._v(t._s(e.productSku.sellPrice))])],1),n("v-uni-view",{staticClass:"cart-item--stepper"},[n("u-number-box",{attrs:{min:1,"button-size":"40rpx",bgColor:"#F5F6FA",value:e.number,max:e.maxBuyNum},on:{change:function(a){arguments[0]=a=t.$handleEvent(a),t.onChangeStepper(a,e)}}},[n("v-uni-text",{staticClass:"cart-item--stepper-icon",attrs:{slot:"minus"},slot:"minus"},[t._v("-")]),n("v-uni-text",{staticClass:"cart-item--stepper-icon",attrs:{slot:"plus"},slot:"plus"},[t._v("+")])],1)],1)],1)],1)],1)})),1):n("BsEmpty",{staticClass:"empty",attrs:{tips:"去挑点喜欢的好货吧~"}},[n("v-uni-image",{staticClass:"empty--icon",attrs:{slot:"icon",src:a("d7da")},slot:"icon"}),n("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():[n("v-uni-view",{staticClass:"title"},[t._v("为您推荐")]),n("BsChoiceGoods")],t.list.length?n("v-uni-view",{class:"footer footer__"+t.type},[n("v-uni-label",{staticClass:"all-radio",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.handleCheckAll.apply(void 0,arguments)}}},[n("v-uni-radio",{staticClass:"radio",attrs:{color:"#FF875B",checked:t.checkedIds.length>0&&t.checkedIds.length===t.list.length}}),n("v-uni-text",[t._v("全选")])],1),n("v-uni-view",{staticClass:"total-info"},[n("v-uni-text",[t._v("合计:")]),n("v-uni-view",{staticClass:"goods-price"},[n("v-uni-text",{staticClass:"unit"},[t._v("¥")]),n("v-uni-text",{staticClass:"value"},[t._v(t._s(t.totalPrice))])],1)],1),n("v-uni-view",{staticClass:"cart-action"},[n("v-uni-view",{staticClass:"btn-wrapper"},["normal"==t.mode?n("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()}}},[n("v-uni-text",[t._v("去结算 "+t._s(t.checkedIds.length>0?"("+t.checkedIds.length+")":""))])],1):t._e(),"edit"==t.mode?n("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()}}},[n("v-uni-text",[t._v("删除")])],1):t._e()],1)],1)],1):t._e()],2)},r=[]},"7b59":function(t,e,a){var n=a("24fb");e=n(!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,a){"use strict";var n=a("4ea4");a("4de4"),a("c740"),a("4160"),a("caad"),a("d81d"),a("a434"),a("2532"),a("159b"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n(a("5530"));a("96cf");var r=n(a("1da1")),c=a("5767"),o=n(a("8832")),s=n(a("91cc")),d=n(a("1014")),u=a("4abc"),l="CartIds",f={components:{BsEmpty:o.default,BsChoiceGoods:s.default,UiPageHeader:d.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(l,t)},immediate:!1}},computed:{totalPrice:function(){var t=this,e=this.list.filter((function(e){return t.checkedIds.includes(e.id)})),a=0;return e.forEach((function(t){var e=100*t.productSku.sellPrice;a+=e*t.number})),(a/100).toFixed(2)}},methods:{open:function(t){this.getCartList(),this.isLoading=!1,this.checkedIds=uni.getStorageSync(l)},getCartList:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isLoading=!0,e.next=3,(0,u.ApiGetCartList)();case 3:if(a=e.sent,n=a.error,r=a.result,!n){e.next=9;break}return uni.$u.toast(n.message),e.abrupt("return",!1);case 9:t.list=r.map((function(t){var e=t.product.singleBuyLimit,a=t.productSku.stock,n=e?Math.min(e,a||1):a;return(0,i.default)((0,i.default)({},t),{},{maxBuyNum:n})})),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 a=t.value;if(e.number==a)return uni.$u.toast("数量不能再少了"),!1;e.debounceHandle||(e.oldValue=e.number,e.debounceHandle=(0,c.Debounce)(this.updateCartNum,500)),e.number=a,e.debounceHandle(e,e.oldValue,a)},updateCartNum:function(t,e,a){var n=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a,i,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,u.ApiPutCartNum)({id:t.id,number:t.number});case 2:if(a=e.sent,i=a.error,r=a.result,!i){e.next=9;break}return n.$toast(i.message),t.number=t.sku,e.abrupt("return",!1);case 9:if(!r.isBeyondMaxLimit){e.next=13;break}return uni.$u.toast("数量超出范围"),t.number=r.canSetShoppingCartNumber,e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e)})))()},handleCheckItem:function(t){var e=this.checkedIds,a=e.findIndex((function(e){return e===t}));a<0?e.push(t):e.splice(a,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 a=(0,r.default)(regeneratorRuntime.mark((function a(){var n,i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,(0,u.ApiDeleteCartGoods)({idList:e.join(",")});case 2:if(n=a.sent,i=n.error,!i){a.next=7;break}return uni.$u.toast(i.message),a.abrupt("return",!1);case 7:t.list=t.list.filter((function(t){return!e.includes(t.id)})),t.onClearInvalidId();case 9:case"end":return a.stop()}}),a)})));function n(){return a.apply(this,arguments)}return n}()})}}};e.default=f},"80b3":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n={props:{title:{type:String,default:""},back:{type:Boolean,default:!0}}};e.default=n},"8ea5":function(t,e,a){var n=a("7b59");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("4f06").default;i("6cf96ffd",n,!0,{sourceMap:!1,shadowMode:!1})},a73e:function(t,e,a){var n=a("dfc9");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("4f06").default;i("aaaa1502",n,!0,{sourceMap:!1,shadowMode:!1})},d07f:function(t,e,a){var n=a("2f5d");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var i=a("4f06").default;i("3e2ea54e",n,!0,{sourceMap:!1,shadowMode:!1})},d245:function(t,e,a){"use strict";var n=a("8ea5"),i=a.n(n);i.a},d7da:function(t,e,a){t.exports=a.p+"static/img/cart.5b9fd199.png"},dfc9:function(t,e,a){var n=a("24fb");e=n(!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/* 垂直间距 */.header[data-v-1cbadadd]{height:%?88?%;padding:0 %?40?%;display:flex;justify-content:space-between;align-items:center;background:#fff;position:-webkit-sticky;position:sticky;top:var(--window-top);z-index:999}.header--back[data-v-1cbadadd]{width:%?14?%;height:%?28?%;margin-right:%?20?%}.header--title[data-v-1cbadadd]{flex:1;text-align:center;font-size:%?32?%}.header--operation[data-v-1cbadadd]{position:absolute;right:%?40?%;top:0}',""]),t.exports=e},e84f:function(t,e,a){"use strict";var n=a("a73e"),i=a.n(n);i.a},e8cc:function(t,e,a){"use strict";var n=a("d07f"),i=a.n(n);i.a},f341:function(t,e,a){"use strict";a.r(e);var n=a("80b3"),i=a.n(n);for(var r in n)"default"!==r&&function(t){a.d(e,t,(function(){return n[t]}))}(r);e["default"]=i.a},f74c:function(t,e,a){"use strict";var n;a.d(e,"b",(function(){return i})),a.d(e,"c",(function(){return r})),a.d(e,"a",(function(){return n}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{staticClass:"header"},[t.back?n("v-uni-image",{staticClass:"header--back",attrs:{src:a("04a6")},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.$Router.back()}}}):t._e(),t._t("custom",[n("v-uni-text",{staticClass:"header--title"},[t._v(t._s(t.title))]),n("v-uni-view",{staticClass:"header--operation"},[t._t("operation")],2)])],2)},r=[]}}]);