1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-be337ac0"],{2103:function(t,a,e){var s=e("5ede");s.__esModule&&(s=s.default),"string"===typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);var i=e("499e").default;i("29970b4e",s,!0,{sourceMap:!1,shadowMode:!1})},"5ede":function(t,a,e){var s=e("24fb");a=s(!1),a.push([t.i,"#goods-class[data-v-737bfaae]{background-color:#fff;margin-bottom:3.75rem}#goods-class .list .box-a[data-v-737bfaae]{padding-left:.875rem;border-top:.0625rem solid #ebebeb;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;position:relative}#goods-class .list .box-a[data-v-737bfaae],#goods-class .list .box-a .left[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}#goods-class .list .box-a .left[data-v-737bfaae]{padding:.625rem 0;font-size:16px}#goods-class .list .box-a .left .img[data-v-737bfaae]{width:2.5rem;height:2.5rem;overflow:hidden;background-color:#ccc;margin:0 .625rem}#goods-class .list .box-a .left .img img[data-v-737bfaae]{width:100%;overflow:hidden}#goods-class .list .box-a .left span[data-v-737bfaae]{line-height:2.5rem}#goods-class .list .box-a .right[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:.625rem 0;margin-right:.625rem}#goods-class .list .box-a .right i[data-v-737bfaae]{font-size:1.5rem;color:#c9c9c9;width:2.5rem;line-height:2.5rem;position:relative;z-index:3}#goods-class .list .box-a .more[data-v-737bfaae]{z-index:2;background:rgba(51,51,51,.9);border-radius:.25rem;color:#f0f0f0;width:7.5rem;position:absolute;right:3rem;top:2.625rem}#goods-class .list .box-a .more ul[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}#goods-class .list .box-a .more ul li[data-v-737bfaae]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:center}#goods-class .list .box-a .more ul li i[data-v-737bfaae]{display:block;margin-top:.125rem}#goods-class .list .box-a .more .icon[data-v-737bfaae]{position:absolute;right:.625rem;top:-.95rem}#goods-class .list .box-a .more .icon i[data-v-737bfaae]{color:rgba(51,51,51,.9)}#goods-class .list .box-b[data-v-737bfaae]{background:#fafafa;padding-left:.875rem;border-top:.0625rem solid #ebebeb;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;position:relative}#goods-class .list .box-b[data-v-737bfaae],#goods-class .list .box-b .left[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}#goods-class .list .box-b .left[data-v-737bfaae]{margin-left:1.25rem;padding:.625rem 0;font-size:16px}#goods-class .list .box-b .left .img[data-v-737bfaae]{width:2.5rem;height:2.5rem;overflow:hidden;background-color:#ccc;margin:0 .625rem}#goods-class .list .box-b .left .img img[data-v-737bfaae]{width:100%;overflow:hidden}#goods-class .list .box-b .left span[data-v-737bfaae]{line-height:2.5rem}#goods-class .list .box-b .right[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:.625rem 0;margin-right:.625rem}#goods-class .list .box-b .right i[data-v-737bfaae]{font-size:1.5rem;color:#c9c9c9;width:2.5rem;line-height:2.5rem;position:relative;z-index:3}#goods-class .list .box-b .more[data-v-737bfaae]{z-index:2;background:rgba(51,51,51,.9);border-radius:.25rem;color:#f0f0f0;width:7.5rem;position:absolute;right:3rem;top:2.625rem}#goods-class .list .box-b .more ul[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}#goods-class .list .box-b .more ul li[data-v-737bfaae]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:center}#goods-class .list .box-b .more ul li i[data-v-737bfaae]{display:block;margin-top:.125rem}#goods-class .list .box-b .more .icon[data-v-737bfaae]{position:absolute;right:.625rem;top:-.95rem}#goods-class .list .box-b .more .icon i[data-v-737bfaae]{color:rgba(51,51,51,.9)}#goods-class .list .box-c[data-v-737bfaae]{padding-left:.875rem;background:#fafafa;border-top:.0625rem solid #ebebeb;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;position:relative}#goods-class .list .box-c[data-v-737bfaae],#goods-class .list .box-c .left[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}#goods-class .list .box-c .left[data-v-737bfaae]{margin-left:2.5rem;padding:.625rem 0;font-size:16px}#goods-class .list .box-c .left .img[data-v-737bfaae]{width:2.5rem;height:2.5rem;overflow:hidden;background-color:#ccc;margin:0 .625rem}#goods-class .list .box-c .left .img img[data-v-737bfaae]{width:100%;overflow:hidden}#goods-class .list .box-c .left span[data-v-737bfaae]{line-height:2.5rem}#goods-class .list .box-c .right[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;padding:.625rem 0;margin-right:.625rem}#goods-class .list .box-c .right i[data-v-737bfaae]{font-size:1.5rem;color:#c9c9c9;width:2.5rem;line-height:2.5rem;position:relative;z-index:3}#goods-class .list .box-c .more[data-v-737bfaae]{z-index:2;background:rgba(51,51,51,.9);border-radius:.25rem;color:#f0f0f0;width:5.5rem;position:absolute;right:3rem;top:2.625rem}#goods-class .list .box-c .more ul[data-v-737bfaae]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center}#goods-class .list .box-c .more ul li[data-v-737bfaae]{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:center}#goods-class .list .box-c .more ul li i[data-v-737bfaae]{display:block;margin-top:.125rem}#goods-class .list .box-c .more .icon[data-v-737bfaae]{position:absolute;right:.625rem;top:-.95rem}#goods-class .list .box-c .more .icon i[data-v-737bfaae]{color:rgba(51,51,51,.9)}#goods-class #bottom[data-v-737bfaae]{border-top:.0625rem solid #ebebeb;width:100%;position:fixed;bottom:0;background-color:#fff;padding:0 .875rem;font-size:16px}#goods-class #bottom button[data-v-737bfaae]{color:#fff;width:100%;height:2.5rem;line-height:2.5rem;border-radius:.1875rem;background-color:#f15353;border:none;margin:.375rem 0}",""]),t.exports=a},c9cf:function(t,a,e){"use strict";e.r(a);var s=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("section",{attrs:{id:"goods-class"}},[e("c-title",{attrs:{hide:!1,text:"商品分类",popClose:!0},on:{onGoBack:t.goback}}),t._l(t.classify_data,(function(a,s){return e("section",{key:s,staticClass:"list"},[e("ul",{staticClass:"box-a",on:{click:function(a){return t.oneLevel(1,s)}}},[e("li",{staticClass:"left"},[e("span",[t._v(t._s(a.name))])]),e("li",{staticClass:"right"},[e("i",{staticClass:"iconfont icon-more",staticStyle:{color:"#c9c9c9"},on:{click:function(a){return a.stopPropagation(),t.levelMore(1,s)}}}),0==a.level_active?e("i",{staticClass:"iconfont icon-member-bottom",staticStyle:{color:"#c9c9c9"}}):t._e(),1==a.level_active?e("i",{staticClass:"iconfont icon-member-top",staticStyle:{color:"#c9c9c9"}}):t._e()]),a.btn_active?e("div",{staticClass:"more"},[e("ul",[e("li",{on:{click:function(a){return a.stopPropagation(),t.classifyRoute(1,2,s)}}},[e("van-icon",{staticClass:"iconfont icon-add",attrs:{color:"#fff",size:"1.125rem"}}),e("span",[t._v("添加")])],1),e("li",{on:{click:function(a){return a.stopPropagation(),t.classifyRoute(2,1,s)}}},[e("van-icon",{staticClass:"iconfont icon-edit",attrs:{color:"#fff",size:"1.125rem"}}),e("span",[t._v("编辑")])],1),e("li",{on:{click:function(a){return a.stopPropagation(),t.deleteClassify(1,s)}}},[e("van-icon",{staticClass:"iconfont icon-delete",attrs:{color:"#fff",size:"1.125rem"}}),e("span",[t._v("删除")])],1)]),e("div",{staticClass:"icon"},[e("van-icon",{staticClass:"iconfont icon-up",attrs:{custom:"",size:"1.5rem"}})],1)]):t._e()]),t._l(a.childrens,(function(i,o){return e("section",{directives:[{name:"show",rawName:"v-show",value:a.level_active,expression:"item.level_active"}],key:o},[e("ul",{staticClass:"box-b"},[e("li",{staticClass:"left"},[e("span",[t._v(t._s(i.name))])]),e("li",{staticClass:"right"},[e("i",{staticClass:"iconfont icon-more",staticStyle:{color:"#c9c9c9"},on:{click:function(a){return a.stopPropagation(),t.levelMore(2,s,o)}}}),e("i",{staticClass:"iconfont icon-member-top",staticStyle:{color:"#c9c9c9"}})]),i.btn_active?e("div",{staticClass:"more"},[e("ul",[e("li",{on:{click:function(a){return a.stopPropagation(),t.classifyRoute(2,2,s,o)}}},[e("van-icon",{staticClass:"iconfont icon-edit",attrs:{color:"#fff",size:"1.125rem"}}),e("span",[t._v("编辑")])],1),e("li",{on:{click:function(a){return a.stopPropagation(),t.deleteClassify(2,s,o)}}},[e("van-icon",{staticClass:"iconfont icon-delete",attrs:{color:"#fff",size:"1.125rem"}}),e("span",[t._v("删除")])],1)]),e("div",{staticClass:"icon"},[e("van-icon",{staticClass:"iconfont icon-up",attrs:{size:"1.5rem"}})],1)]):t._e()])])}))],2)})),e("section",{style:{width:3==this.fun.getPhoneEnv()?"375px":"100%"},attrs:{id:"bottom"}},[e("button",{attrs:{type:"button"},on:{click:t.addClassify}},[e("i",{staticClass:"iconfont icon-life-game-plus"}),t._v("添加分类 ")])])],2)},i=[],o=(e("ac1f"),e("5319"),e("14d9"),e("a434"),e("6968")),l={components:{cTitle:o["a"]},data:function(){return{classify_data:[]}},activated:function(){this.getJson(),this.emptyMore()},methods:{goback:function(){this.$router.replace({path:"/o2o/store_manage",query:this.$route.query})},getJson:function(){var t=this,a={store_id:parseInt(t.$route.params.store_id)};$http.post("plugin.store-cashier.frontend.store.goods-category.get-category-by-store-id",a).then((function(a){if(1==a.result){t.classify_data=[];for(var e=0;e<a.data.list.length;e++){a.data.list[e].btn_active=!1,a.data.list[e].level_active=!1;for(var s=0;s<a.data.list[e].childrens.length;s++)a.data.list[e].childrens[s].btn_active=!1,a.data.list[e].childrens[s].level_active=!1}t.classify_data=a.data.list}else{if(a.data.url)return t.$notify(a.msg),window.location.href=a.data.url,0;t.$notify("暂无商品分类,请添加分类")}}),(function(t){}))},classifyRoute:function(t,a,e,s,i){1==t?2==a?this.$router.push(this.fun.getUrl("AddClassify",{store_id:this.$route.params.store_id,classify_id:this.classify_data[e].id,level:a})):3==a&&this.$router.push(this.fun.getUrl("AddClassify",{store_id:this.$route.params.store_id,classify_id:this.classify_data[e].childrens[s].id,level:a})):2==t&&(1==a?this.$router.push(this.fun.getUrl("FirstEdit",{store_id:this.$route.params.store_id,classify_id:this.classify_data[e].id,level:a})):2==a?this.$router.push(this.fun.getUrl("FirstEdit",{store_id:this.$route.params.store_id,classify_id:this.classify_data[e].childrens[s].id,level:a})):3==a&&this.$router.push(this.fun.getUrl("FirstEdit",{store_id:this.$route.params.store_id,classify_id:this.classify_data[e].childrens[s].thirds[i].id,level:a})))},addClassify:function(){this.$router.push(this.fun.getUrl("AddClassify",{store_id:this.$route.params.store_id,classify_id:"add",level:1}))},oneLevel:function(t,a,e){1==t?1==this.classify_data[a].level_active?this.emptyMore():0!=this.classify_data[a].childrens.length?(this.emptyMore(),this.classify_data[a].level_active=!0):this.$notify("此类暂无数据"):2==t&&(1==this.classify_data[a].childrens[e].level_active?(this.emptyMore(),this.classify_data[a].level_active=!0):0!=this.classify_data[a].childrens[e].thirds.length?(this.emptyMore(),this.classify_data[a].level_active=!0,this.classify_data[a].childrens[e].level_active=!0):this.$notify("此类暂无数据"))},levelMore:function(t,a,e,s){1==t?1==this.classify_data[a].btn_active?this.emptyMore():(this.emptyMore(),this.classify_data[a].btn_active=!0):2==t?1==this.classify_data[a].childrens[e].btn_active?(this.emptyMore(),this.classify_data[a].level_active=!0):(this.emptyMore(),this.classify_data[a].level_active=!0,this.classify_data[a].childrens[e].btn_active=!0):3==t&&(1==this.classify_data[a].childrens[e].thirds[s].btn_active?(this.emptyMore(),this.classify_data[a].level_active=!0,this.classify_data[a].childrens[e].level_active=!0):(this.emptyMore(),this.classify_data[a].level_active=!0,this.classify_data[a].childrens[e].level_active=!0,this.classify_data[a].childrens[e].thirds[s].btn_active=!0))},emptyMore:function(){for(var t=0;t<this.classify_data.length;t++){this.classify_data[t].btn_active=!1,this.classify_data[t].level_active=!1;for(var a=0;a<this.classify_data[t].childrens.length;a++)this.classify_data[t].childrens[a].btn_active=!1,this.classify_data[t].childrens[a].level_active=!1}},deleteClassify:function(t,a,e,s){var i=this;this.$dialog.confirm({title:"提示",message:"此操作将永久删除该分类, 是否继续?"}).then((function(){var o="";if(1==t){if(o=i.classify_data[a].id,0!=i.classify_data[a].childrens.length)return void i.$notify("先清空二级分类")}else 2==t?o=i.classify_data[a].childrens[e].id:3==t&&(o=i.classify_data[a].childrens[e].thirds[s].id);var l={id:o};$http.post("plugin.store-cashier.frontend.store.goods-category.del-category",l).then((function(o){1==o.result?(1==t?i.classify_data.splice(a,1):2==t?i.classify_data[a].childrens.splice(e,1):3==t&&i.classify_data[a].childrens[e].thirds.splice(s,1),i.$notify({background:"#f0f9eb",message:"删除成功",color:"#67c23a"})):i.$notify(o.msg)}),(function(t){}))})).catch((function(){i.$notify({background:"#edf2fc",message:"已取消删除",color:"#909399"})}))}}},c=l,r=c,n=(e("da17"),e("2877")),d=Object(n["a"])(r,s,i,!1,null,"737bfaae",null);a["default"]=d.exports},da17:function(t,a,e){"use strict";e("2103")}}]); |