(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/goods-edit/cat-setting/cat-setting"],{1708:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n("2f62");function i(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return c=t.done,t},e:function(t){u=!0,a=t},f:function(){try{c||null==n.return||n.return()}finally{if(u)throw a}}}}function o(t,e){if(t){if("string"===typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function u(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l={data:function(){return{mch_id:null,type:"",first:!0,value:-1,color:"",list:[]}},computed:u({},(0,r.mapState)({userInfo:function(t){return t.user.info},adminImg:function(t){return t.mallConfig.__wxapp_img.app_admin}})),methods:{editCat:function(e){var n=e.value?e.value:null;t.navigateTo({url:"/pages/goods-edit/cat-edit/cat-edit?mch_id="+this.mch_id+"&type="+this.type+"&id="+n})},toggle:function(t){t.show=!t.show,this.$forceUpdate()},getCat:function(){var e=this,n=0==this.mch_id?e.$api.app_admin.cat:"mall"==e.type?e.$api.mch.cat:e.$api.mch.mch_cat;e.$request({url:n,data:{mch_id:e.mch_id}}).then((function(n){if(e.first=!1,e.$hideLoading(),t.hideLoading(),0==n.code){e.list=n.data.list;var r,o=i(e.list);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.show=!1,a.children){var c,u=i(a.children);try{for(u.s();!(c=u.n()).done;){var f=c.value;f.show=!1}}catch(l){u.e(l)}finally{u.f()}}}}catch(l){o.e(l)}finally{o.f()}}else t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(n){e.$hideLoading(),t.hideLoading()}))},pop:function(t){this.value=t},close:function(){this.value=-1},toDelete:function(){var e=this,n=this;t.showLoading({mask:!0,title:"删除中..."});var r=0==this.mch_id?n.$api.app_admin.cat_destroy:n.$api.mch.mch_cat_destroy;n.$request({url:r,data:{id:this.value,mch_id:n.mch_id},method:"post"}).then((function(n){t.hideLoading(),0==n.code?(e.value=-1,e.getCat()):t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(e){t.hideLoading()}))}},onShow:function(){this.first||(t.showLoading({mask:!0}),this.getCat())},onLoad:function(t){var e=this;e.$showLoading({type:"global",text:"加载中..."}),this.type=t.type?t.type:"",this.mch_id=t.mch_id?t.mch_id:0,this.color=this.mch_id>0?"#ff4544":"#446dfd",e.getCat()}};e.default=l}).call(this,n("543d")["default"])},4025:function(t,e,n){"use strict";n.r(e);var r=n("1708"),i=n.n(r);for(var o in r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);e["default"]=i.a},"63ee":function(t,e,n){"use strict";var r;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return r}));var i=function(){var t=this,e=t.$createElement;t._self._c},o=[]},"7fab":function(t,e,n){"use strict";(function(t){n("2d0a");r(n("66fd"));var e=r(n("ee34"));function r(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},ae0b:function(t,e,n){},d9ae:function(t,e,n){"use strict";var r=n("ae0b"),i=n.n(r);i.a},ee34:function(t,e,n){"use strict";n.r(e);var r=n("63ee"),i=n("4025");for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);n("d9ae");var a,c=n("f0c5"),u=Object(c["a"])(i["default"],r["b"],r["c"],!1,null,"37e044cc",null,!1,r["a"],a);e["default"]=u.exports}},[["7fab","common/runtime","common/vendor"]]]);