1 line
7.1 KiB
JavaScript
1 line
7.1 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-dc96bb66","chunk-2d0d83d6"],{2670:function(t,e,o){"use strict";o("bb2e")},"79db":function(t,e,o){t.exports=o.p+"static/app/img/empty-image-search.ef236a93.png"},bb2e:function(t,e,o){var a=o("e5e8");a.__esModule&&(a=a.default),"string"===typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);var n=o("499e").default;n("690bf9da",a,!0,{sourceMap:!1,shadowMode:!1})},da07:function(t,e,o){"use strict";o.r(e);var a=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"goods-catgory"},[o("c-title",{attrs:{hide:!1,text:"商品分类"}}),t.treeData.length>0?o("div",{staticClass:"catgory-list"},[o("el-tree",{staticClass:"custom-tree",attrs:{data:t.treeData,indent:0,props:t.defaultProps,"expand-on-click-node":!0},on:{"node-expand":t.nodeExpand,"node-collapse":t.nodeCollapse},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.node,n=e.data;return o("div",{class:["custom-tree-node",t.nodeTitlCalss(a.level)]},[o("span",{staticClass:"node-title"},[t._v(t._s(a.label))]),o("div",{staticClass:"node-opt-icons"},[o("van-icon",{staticClass:"ellipsis",attrs:{name:"ellipsis"},on:{click:function(e){return e.stopPropagation(),t.showOptionNode(a,n)}}}),a.expanded?o("van-icon",{staticClass:"arrow",attrs:{name:"arrow-up"}}):o("van-icon",{staticClass:"arrow",attrs:{name:"arrow"}})],1)])}}],null,!1,4252951992)}),t.finished?o("div",{staticClass:"not-more"},[o("span",[t._v("没有更多了")])]):o("div",{staticClass:"load-more",on:{click:t.loadMore}},[o("span",[t._v("点击加载更多")]),o("van-icon",{attrs:{name:"arrow-down"}})],1)],1):t._e(),o("yz-blank",{attrs:{datas:t.treeData,text:"空空如也"}}),o("div",{staticClass:"bottom-btn"},[o("div",{staticClass:"btn-add-category",on:{click:function(e){return t.toAddCategory(0)}}},[t._v("创建分类")])]),o("van-action-sheet",{attrs:{actions:t.actions},on:{select:t.select},model:{value:t.optNodePop,callback:function(e){t.optNodePop=e},expression:"optNodePop"}})],1)},n=[],s=(o("99af"),o("b0c0"),o("eb17")),i={data:function(){return{optNodePop:!1,optionNode:{},treeData:[],maxLevel:1,page:1,loading:!1,finished:!1,defaultProps:{children:"has_many_children",label:"name"},actions:[{name:"添加子类",disabled:!1},{name:"编辑",disabled:!1},{name:"删除",disabled:!1},{name:"取消"}]}},computed:{nodeTitlCalss:function(){return function(t){return 1==t?"level-1":2==t?"level-2":"level-3"}}},activated:function(){this.initData(),this.getData()},methods:{getData:function(){var t=this;if(this.loading&&this.finished)return!1;this.loading=!0,$http.get("plugin.shop-assistant.frontend.category.get-list",{page:this.page},"loading").then((function(e){if(t.loading=!1,1!==e.result)return t.$toast(e.msg);t.maxLevel=e.data.setLevel;var o=e.data.list;o.current_page>=o.last_page&&o.data.length<o.per_page&&(t.finished=!0),t.page++,t.treeData=o.current_page>1?t.treeData.concat(o.data):o.data}))},loadMore:function(){this.getData()},nodeExpand:function(t,e){this.$set(e,"expanded",!0)},nodeCollapse:function(t,e){this.$set(e,"expanded",!1)},showOptionNode:function(t,e){var o=[{name:"添加子类"},{name:"编辑"},{name:"删除"},{name:"取消"}];(2==this.maxLevel&&2===t.level||3===t.level)&&o.shift(),this.optionNode=e,this.actions=o,this.optNodePop=!0},select:function(t){if(this.optNodePop=!1,"取消"===t.name)return!1;this.categoryId=this.optionNode.id,"添加子类"===t.name?this.toAddCategory(this.categoryId):"编辑"===t.name?this.toDditCategory(this.categoryId):this.deleteCategory(this.categoryId)},toDditCategory:function(t){this.$router.push(this.fun.getUrl("editGoodsCatgory",{id:t}))},toAddCategory:function(t){this.$router.push(this.fun.getUrl("addGoodsCatgory",{parentId:t}))},deleteCategory:function(t){var e=this;this.$dialog.confirm({title:"正在删除改分类,请确认操作"}).then((function(){$http.post("plugin.shop-assistant.frontend.category.delete",{id:t},"loading").then((function(t){e.$toast(t.msg),1===t.result&&(e.initData(),e.getData())}))})).catch((function(){e.$toast("您取消了操作")}))},initData:function(){this.optNodePop=!1,this.optionNode={},this.treeData=[],this.maxLevel=1,this.page=1,this.loading=!1,this.finished=!1}},components:{yzBlank:s["default"]}},r=i,d=r,l=(o("2670"),o("2877")),c=Object(l["a"])(d,a,n,!1,null,"562167b0",null);e["default"]=c.exports},e5e8:function(t,e,o){var a=o("24fb");e=a(!1),e.push([t.i,".goods-catgory[data-v-562167b0]{position:relative;height:100vh;background-color:#f6f6f6;padding-bottom:2.3rem}.goods-catgory .catgory-list[data-v-562167b0]{overflow-y:auto;padding-bottom:2rem}.goods-catgory .load-more[data-v-562167b0]{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;margin:2rem 0;color:#f15353}.goods-catgory .not-more[data-v-562167b0]{margin:3rem 0;color:#a0a0a0}.goods-catgory[data-v-562167b0] .custom-tree{overflow-y:auto}.goods-catgory[data-v-562167b0] .custom-tree .el-icon-caret-right{display:none}.goods-catgory[data-v-562167b0] .custom-tree .el-tree-node__content{height:auto}.goods-catgory[data-v-562167b0] .custom-tree .custom-tree-node{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;padding:.5rem 1rem}.goods-catgory[data-v-562167b0] .custom-tree .custom-tree-node .node-title{-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;text-align:left}.goods-catgory[data-v-562167b0] .custom-tree .custom-tree-node .node-opt-icons{width:3rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;color:#a0a0a0}.goods-catgory[data-v-562167b0] .custom-tree .custom-tree-node .node-opt-icons .van-icon-weapp-nav{margin-right:1rem}.goods-catgory[data-v-562167b0] .custom-tree .custom-tree-node .node-opt-icons .ellipsis{font-size:1.2rem}.goods-catgory[data-v-562167b0] .custom-tree .level-1 .node-title{color:#1e1e1e;font-size:15px}.goods-catgory[data-v-562167b0] .custom-tree .level-1 .arrow{font-size:1rem}.goods-catgory[data-v-562167b0] .custom-tree .level-2{background-color:#fbfbfb}.goods-catgory[data-v-562167b0] .custom-tree .level-2 .node-title{color:#373737;font-size:13px}.goods-catgory[data-v-562167b0] .custom-tree .level-2 .arrow{font-size:.825rem}.goods-catgory[data-v-562167b0] .custom-tree .level-3{position:relative}.goods-catgory[data-v-562167b0] .custom-tree .level-3 .node-title{color:#686868;font-size:12px}.goods-catgory[data-v-562167b0] .custom-tree .level-3 .arrow{font-size:.625rem}.goods-catgory .bottom-btn[data-v-562167b0]{position:fixed;bottom:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);width:100%;max-width:350px;height:2.3rem;background-color:#f6f6f6;text-align:center}.goods-catgory .bottom-btn .btn-add-category[data-v-562167b0]{width:80%;margin:0 auto;color:#fff;background-color:#f15353;border-radius:1.156rem;padding:.5rem}",""]),t.exports=e}}]); |