| 1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/shop_cart/shop_cart"],{"1d65":function(t,e,n){"use strict";(function(t){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i(n("7eb4")),s=i(n("ee10")),c=i(n("7ca3")),r=n("dc70"),u=n("704d"),o=n("7398"),l={name:"ShopCart",data:function(){var t;return t={pagesData:[],total_amount:"",cartLists:[],cartListsId:[]},(0,c.default)(t,"total_amount",""),(0,c.default)(t,"delPopup",!1),(0,c.default)(t,"cart_id",0),(0,c.default)(t,"isSelectedAll",!1),(0,c.default)(t,"isChangeLoading",!1),(0,c.default)(t,"option",[{text:"删除",style:{backgroundColor:"#dd524d"}}]),(0,c.default)(t,"activeIndex",-1),(0,c.default)(t,"activeLists",[]),(0,c.default)(t,"inactiveLists",[]),(0,c.default)(t,"admin",!0),(0,c.default)(t,"adminCheckAll",!1),t},methods:{handlereCheck:function(t,e){this.$Router.push({path:"/pages/goods_detail/goods_detail?id=".concat(t,"&cart_id=").concat(e,"&reCheck=1")})},getCartList:function(){var t=this;return(0,r.apiCartLists)().then((function(e){return t.total_amount=e.total_amount,e.lists.forEach((function(t,n){e.lists[n].selected=1==t.selected})),t.cartLists=e.lists,t.baseSelect(e.lists),t.$store.dispatch("getCartNum"),t.isChangeLoading=!1,Promise.resolve()}))},baseSelect:function(t){var e=this;this.cartListsId=[];t.filter((function(t){return e.cartListsId.push(t.id),0==t.selected}));this.isSelectedAll=!0,this.goodsListActive.map((function(t){t.selected||(e.isSelectedAll=!1)}))},countChange:function(t,e){var n=this,i=t.value;this.isChangeLoading=!0,(0,r.apiCartCountChange)({cart_id:e,goods_num:i}).then((function(t){n.$store.dispatch("getCartNum")})).finally((function(){n.getCartList()}))},changeDelPopup:function(t){this.delPopup=!0,this.cart_id=t},goodsDelete:function(){var t=this;return(0,s.default)(a.default.mark((function e(){return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isChangeLoading=!0,e.next=3,(0,r.apiCartDel)({cart_id:t.cart_id});case 3:return e.next=5,t.getCartList();case 5:t.$toast({title:"删除成功"});case 6:case"end":return e.stop()}}),e)})))()},changeGoodsStatus:function(t,e){var n=this;this.isChangeLoading=!0,t=1==t?0:1,(0,r.apiCartSelectChange)({cart_id:[e],selected:t}).then((function(t){n.getCartList()}))},adminGoodsStatus:function(){var t=this;return(0,s.default)(a.default.mark((function e(){var n;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return console.log(t.cartLists),e.next=3,t.$nextTick();case 3:n=t.cartLists.filter((function(t){return 1==t.adminCheck})),n.length==t.cartLists.length?t.adminCheckAll=!0:t.adminCheckAll=!1;case 5:case"end":return e.stop()}}),e)})))()},changeAllSelect:function(){var t=this;this.isChangeLoading=!0;var e=1==this.isSelectedAll?0:1,n=this.goodsListActive.map((function(t){return t.id}));(0,r.apiCartSelectChange)({cart_id:n,selected:e}).then((function(e){t.getCartList()}))},adminAllSelect:function(){var t=this;this.cartLists.forEach((function(e){e.adminCheck=!t.adminCheckAll}))},goShoping:function(){this.$Router.replaceAll("/pages/index/index")},goToConfirm:function(){var t=this.cartLists.filter((function(t){return t.selected})).map((function(t){return t.id}));if(0==t.length)return this.$toast({title:"请选择商品"});this.$Router.push({path:"/pages/goods_order/goods_order",query:{from:u.OrderTypeEnum["GOODS"],payload:{source:"cart",cart_id:t}}})},changeTab:function(){this.$Router.replaceAll({path:"/pages/index/index"})},getPage:function(){var e=this;(0,r.apiGetPage)({type:4}).then((function(n){var i=n.common.title,a=(n.common,n.content);t.setNavigationBarTitle({title:i}),e.pagesData=a}))},handleactionOpen:function(t){this.activeIndex=this.activeLists[t].id},handledisaactionOpen:function(t){this.activeIndex=this.inactiveLists[t].id},handleactionClick:function(t){this.changeDelPopup(this.activeLists[t].id)},handledisactionClick:function(t){this.changeDelPopup(this.inactiveLists[t].id)},handleClearAll:function(){var t=this;return(0,s.default)(a.default.mark((function e(){var n;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.isChangeLoading=!0,n=t.inactiveLists.map((function(t){return t.id})),e.next=4,(0,r.apiclearAll)({cart_ids:n});case 4:t.getCartList();case 5:case"end":return e.stop()}}),e)})))()},handleAdminDel:function(){var t=this;return(0,s.default)(a.default.mark((function e(){var n,i;return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.isChangeLoading=!0,console.log(t.cartLists),n=t.cartLists.filter((function(t){return 1==t.adminCheck})),i=n.map((function(t){return t.id})),0!=i.length){e.next=6;break}return e.abrupt("return",t.isChangeLoading=!1);case 6:return e.next=8,(0,r.apiclearAll)({cart_ids:i});case 8:t.getCartList();case 9:case"end":return e.stop()}}),e)})))()}},computed:{cartNum:function(){return this.$store.state.cart.cartNum},getResultBtn:function(){var t=this.cartLists.filter((function(t){return t.selected})).map((function(t){return t.id}));return 0!=t.length||(this.isSelectedAll=!1,!1)},goodsListActive:function(){return this.cartLists.filter((function(t){return 0==t.cart_status&&0==t.sku_is_delete&&0==t.sku_stock_none}))||[]},selectAllDisabled:function(){return!this.goodsListActive.length}},watch:{cartLists:function(){var t=this;this.cartLists.forEach((function(e){t.$set(e,"adminCheck",!1)})),this.activeLists=this.cartLists.filter((function(t){return!(1==t.cart_status||1==t.goods.spec_type&&0==t.goods_item.stock)})),this.inactiveLists=this.cartLists.filter((function(t){return 1==t.cart_status||1==t.goods.spec_type&&0==t.goods_item.stock}))}},onShow:function(){var t=this;return(0,s.default)(a.default.mark((function e(){return a.default.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.getCartList();case 2:t.isLogin&&t.getPage();case 3:case"end":return e.stop()}}),e)})))()},created:function(){this.countChange=(0,o.trottle)(this.countChange,200)}};e.default=l}).call(this,n("df3c")["default"])},3639:function(t,e,n){"use strict";var i=n("a1db"),a=n.n(i);a.a},"36b8":function(t,e,n){"use strict";(function(t,e){var i=n("47a9");n("b46f");i(n("3240"));var a=i(n("632e"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(a.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"632e":function(t,e,n){"use strict";n.r(e);var i=n("7413"),a=n("8b38");for(var s in a)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return a[t]}))}(s);n("3639");var c=n("828b"),r=Object(c["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=r.exports},7413:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return i}));var i={uSticky:function(){return n.e("components/uview-ui/components/u-sticky/u-sticky").then(n.bind(null,"3420"))},uNavbar:function(){return n.e("components/uview-ui/components/u-navbar/u-navbar").then(n.bind(null,"6331"))},uSwipeAction:function(){return n.e("components/uview-ui/components/u-swipe-action/u-swipe-action").then(n.bind(null,"574e"))},uCheckbox:function(){return n.e("components/uview-ui/components/u-checkbox/u-checkbox").then(n.bind(null,"8007"))},uImage:function(){return n.e("components/uview-ui/components/u-image/u-image").then(n.bind(null,"566d"))},price:function(){return n.e("components/price/price").then(n.bind(null,"1266"))},uNumberBox:function(){return n.e("components/uview-ui/components/u-number-box/u-number-box").then(n.bind(null,"0662"))},wGoodsrecom:function(){return n.e("components/widgets/goodsrecom/goodsrecom").then(n.bind(null,"ef69"))},uModal:function(){return n.e("components/uview-ui/components/u-modal/u-modal").then(n.bind(null,"e709"))},tabbar:function(){return n.e("components/tabbar/tabbar").then(n.bind(null,"c5d1"))},uMask:function(){return n.e("components/uview-ui/components/u-mask/u-mask").then(n.bind(null,"aaa3"))},uLoading:function(){return n.e("components/uview-ui/components/u-loading/u-loading").then(n.bind(null,"527f"))}},a=function(){var t=this,e=t.$createElement,n=(t._self._c,t.isLogin&&0!=t.activeLists.length),i=n?t.activeLists.length:null,a=t.isLogin&&0!=t.inactiveLists.length,s=a?t.inactiveLists.length:null,c=t.isLogin&&0==t.cartLists.length,r=t.admin?null:t.cartLists.filter((function(t){return 1==t.adminCheck})).length;t._isMounted||(t.e0=function(e){t.admin=!t.admin},t.e1=function(e){t.admin=!t.admin}),t.$mp.data=Object.assign({},{$root:{g0:n,g1:i,g2:a,g3:s,g4:c,g5:r}})},s=[]},"8b38":function(t,e,n){"use strict";n.r(e);var i=n("1d65"),a=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(s);e["default"]=a.a},a1db:function(t,e,n){t.exports={red_theme:"#FF2C3C",orange_theme:"#f7971e",pink_theme:"#fa444d",gold_theme:"#e0a356",blue_theme:"#2f80ed",green_theme:"#2ec840"}}},[["36b8","common/runtime","common/vendor"]]]);
|