1 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/app_admin/goods-attr/goods-attr"],{"289a":function(t,e,n){"use strict";n.r(e);var i=n("3da2"),a=n("a68a");for(var o in a)"default"!==o&&function(t){n.d(e,t,(function(){return a[t]}))}(o);n("6c56");var r,s=n("f0c5"),u=Object(s["a"])(a["default"],i["b"],i["c"],!1,null,"1391729e",null,!1,i["a"],r);e["default"]=u.exports},"37b0":function(t,e,n){"use strict";(function(t){n("8748");i(n("66fd"));var e=i(n("289a"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"3da2":function(t,e,n){"use strict";var i,a=function(){var t=this,e=t.$createElement;t._self._c},o=[];n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}))},"6c56":function(t,e,n){"use strict";var i=n("e324"),a=n.n(i);a.a},"91aa":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("2f62");function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var s={data:function(){return{list:[],attr:[],iphone_x:!1,noDetail:!0,first:!0,index:-1}},computed:o({},(0,i.mapState)({theme:function(t){return t.mallConfig.theme}})),methods:{changeName:function(e){var n=this;if(n.attr.length>0){for(var i in n.attr)for(var a in n.attr[i].attr_list)e.attr_group_id==n.attr[i].attr_list[a].attr_group_id&&(n.attr[i].attr_list[a].attr_group_name=e.attr_group_name);t.setStorage({key:"temp_attr_info",data:n.attr,success:function(e){t.hideLoading()},fail:function(e){t.hideLoading(),t.showToast({title:e.errMsg,icon:"none",duration:1e3})}})}},pop:function(e){this.index=e,this.list[this.index].attr_group_name||0!=this.list[this.index].attr_list.length||(this.list.splice(this.index,1),this.index=-1,this.attr=[],t.removeStorage({key:"temp_attr_info",success:function(t){}}))},close:function(){this.index=-1},changeValue:function(e){t.setStorage({key:"temp_attr",data:this.list}),t.navigateTo({url:"/pages/app_admin/goods-attr-edit/goods-attr-edit?index="+e})},chooseDetail:function(){var e=this;if(0==e.list.length)return t.showToast({title:"请输入规格信息",icon:"none",duration:1e3}),!1;var n=1;for(var i in e.list)n*=+e.list[i].attr_list.length;if(n>1e3)return t.showToast({title:"规格组合超出1000,请删减规格值再继续操作",icon:"none",duration:1e3}),!1;for(var a in e.list)if(!e.list[a].attr_group_name||0==e.list[a].attr_list.length)return t.showToast({title:"请完善规格信息",icon:"none",duration:1e3}),!1;t.setStorage({key:"temp_attr",data:e.list}),t.navigateTo({url:"/pages/app_admin/goods-attr-info/goods-attr-info"})},toDelete:function(){this.list.splice(this.index,1),this.index=-1,this.attr=[],t.removeStorage({key:"temp_attr_info",success:function(t){}})},save:function(){var e=this;if(0==e.list.length)return t.showToast({title:"请输入规格信息",icon:"none",duration:1e3}),!1;for(var n in e.list)if(!e.list[n].attr_group_name||0==e.list[n].attr_list.length||0==e.attr.length)return t.showToast({title:"请完善规格信息",icon:"none",duration:1e3}),!1;t.setStorage({key:"goods_attr_groups",data:e.list}),t.showLoading({title:"保存中..."}),t.setStorage({key:"goods_attr",data:e.attr,success:function(e){t.hideLoading(),setTimeout((function(){t.navigateBack()}),500)},fail:function(e){t.hideLoading(),t.showToast({title:e.errMsg,icon:"none",duration:1e3})}})},add_attr:function(){var e=this,n={attr_group_id:e.list.length+1,attr_group_name:"",attr_list:[]};e.list.push(n),e.attr=[],t.removeStorage({key:"temp_attr_info",success:function(t){}})}},onLoad:function(e){var n=this;n.$showLoading({type:"global",text:"加载中..."});t.getStorage({key:"goods_attr_groups",success:function(e){n.list=e.data,t.setStorage({key:"temp_attr",data:n.list}),!0},fail:function(e){t.getStorage({key:"temp_attr",success:function(t){n.list=t.data}}),!0}}),t.getStorage({key:"goods_attr",success:function(e){n.attr=e.data,t.setStorage({key:"temp_attr_info",data:e.data}),n.$hideLoading(),n.first=!1},fail:function(e){t.getStorage({key:"temp_attr_info",success:function(t){n.attr=t.data,n.first=!1,n.$hideLoading()},fail:function(t){n.first=!1,n.$hideLoading()}})}}),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)&&(n.iphone_x=!0)}})},onShow:function(){var e=this;e.first||(t.getStorage({key:"temp_attr",success:function(t){e.list=t.data},fail:function(){e.list=[]}}),t.getStorage({key:"temp_attr_info",success:function(t){e.attr=t.data},fail:function(){e.attr=[]}}))}};e.default=s}).call(this,n("543d")["default"])},a68a:function(t,e,n){"use strict";n.r(e);var i=n("91aa"),a=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=a.a},e324:function(t,e,n){}},[["37b0","common/runtime","common/vendor"]]]);
|