(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/app_admin/goods-attr-edit/goods-attr-edit"],{"0c6a":function(t,e,i){"use strict";i.r(e);var n=i("804e"),r=i("ea56");for(var a in r)"default"!==a&&function(t){i.d(e,t,(function(){return r[t]}))}(a);i("13cc");var o,s=i("f0c5"),c=Object(s["a"])(r["default"],n["b"],n["c"],!1,null,"5be6b7e8",null,!1,n["a"],o);e["default"]=c.exports},"13cc":function(t,e,i){"use strict";var n=i("d920"),r=i.n(n);r.a},"703a":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("2f62");function r(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function a(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?r(Object(i),!0).forEach((function(e){o(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function o(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var s={data:function(){return{iphone_x:!1,detail:{},index:-1,list:[],idx:-1,attrList:[],attr:[]}},computed:a({},(0,n.mapState)({theme:function(t){return t.mallConfig.theme},userInfo:function(t){return t.user.info},adminImg:function(t){return t.mallConfig.__wxapp_img.app_admin}})),methods:{pop:function(t){this.index=t},close:function(){this.index=-1},add_attr:function(){var t=this,e={attr_id:t.list.length>0?+t.list[t.list.length-1].attr_id+1:1,attr_name:"",pic_url:[]};t.list.push(e)},toDelete:function(){var t=this,e=[];for(var i in t.attrList)for(var n in t.attrList[i].attr_list)t.attrList[i].attr_list[n].attr_group_id==t.attr[t.idx].attr_group_id&&t.attrList[i].attr_list[n].attr_id==t.list[t.index].attr_id&&e.unshift(i);for(var r in e)t.attrList.splice(e[r],1);t.list.splice(t.index,1),t.index=-1},save:function(){var e=this;for(var i in e.list){if(!e.list[i].attr_name)return t.showToast({title:"请输入规格值",icon:"none",duration:1e3}),!1;for(var n in e.list)if(i!=n&&e.list[i].attr_name==e.list[n].attr_name)return t.showToast({title:"同一规格组下，规格名不能重复",icon:"none",duration:1e3}),!1}var r=!1;for(var a in e.list.length>e.attr[e.idx].attr_list.length&&(r=!0),e.attrList)for(var o in e.attrList[a].attr_list)for(var s in e.list)e.attrList[a].attr_list[o].attr_group_id==e.attr[e.idx].attr_group_id&&e.attrList[a].attr_list[o].attr_id==e.list[s].attr_id&&(e.attrList[a].attr_list[o].attr_name=e.list[s].attr_name);t.showLoading({title:"保存中..."}),r?t.removeStorage({key:"temp_attr_info",success:function(t){}}):0==e.attrList.length?t.removeStorage({key:"temp_attr_info",success:function(t){console.log(t)}}):t.setStorage({key:"temp_attr_info",data:e.attrList,success:function(t){},fail:function(e){t.hideLoading(),t.showToast({title:e.errMsg,icon:"none",duration:1e3})}}),e.attr[e.idx].attr_list=e.list,t.setStorage({key:"temp_attr",data:e.attr}),setTimeout((function(){t.navigateBack()}),500)}},onLoad:function(e){var i=this;i.idx=e.index,t.getStorage({key:"temp_attr",success:function(t){i.attr=t.data,i.detail=i.attr[e.index],i.list=JSON.parse(JSON.stringify(i.detail.attr_list))}}),t.getStorage({key:"temp_attr_info",success:function(t){i.attrList=t.data}}),t.getSystemInfo({success:function(t){(t.model.indexOf("iPhone X")>-1||t.model.indexOf("iPhone 11")>-1||t.model.indexOf("iPhone11")>-1||t.model.indexOf("iPhone12")>-1||t.model.indexOf("Unknown Device")>-1)&&(i.iphone_x=!0)}})}};e.default=s}).call(this,i("543d")["default"])},"7c8b":function(t,e,i){"use strict";(function(t){i("8748");n(i("66fd"));var e=n(i("0c6a"));function n(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,i("543d")["createPage"])},"804e":function(t,e,i){"use strict";var n,r=function(){var t=this,e=t.$createElement;t._self._c},a=[];i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}))},d920:function(t,e,i){},ea56:function(t,e,i){"use strict";i.r(e);var n=i("703a"),r=i.n(n);for(var a in n)"default"!==a&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=r.a}},[["7c8b","common/runtime","common/vendor"]]]);