text: (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/publish/subPages/publish-goods/publish-goods"],{"0858":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=a(n("a34a")),i=(n("8a52"),n("c360")),s=n("25d2"),r=n("2f62");function a(t){return t&&t.__esModule?t:{default:t}}function u(t,e,n,o,i,s,r){try{var a=t[s](r),u=a.value}catch(c){return void n(c)}a.done?e(u):Promise.resolve(u).then(o,i)}function c(t){return function(){var e=this,n=arguments;return new Promise(function(o,i){var s=t.apply(e,n);function r(t){u(s,o,i,r,a,"next",t)}function a(t){u(s,o,i,r,a,"throw",t)}r(void 0)})}}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},o=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),o.forEach(function(e){l(t,e,n[e])})}return t}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f=function(){return n.e("components/upload").then(n.bind(null,"0318"))},h={name:"",data:function(){return{fixedTop:0,imgList1:[],imgList2:[],baseList1:[],baseList2:[],name:"",price:"",category:"请选择分类",sortId:"",num:"",desc:"",goodsId:""}},onBackPress:function(t){},onLoad:function(e){e&&(this.category=e.name,this.sortId=e.id),e.goodsId&&(this.goodsId=e.goodsId,this._reqGetGoodsDetail()),this.fixedTop=t.getSystemInfoSync().screenHeight-45-44-t.getSystemInfoSync().statusBarHeight+"px"},computed:d({},(0,r.mapState)(["sort_type","goods_detail","all_demand_type"])),onShow:function(){this.$hideTabbarButton(),this.category=this.sort_type.name,this.sortId=this.sort_type.id},onHide:function(){this.SORT_TYPE({})},methods:d({},(0,r.mapActions)(["reqGetGoodsDetail"]),(0,r.mapMutations)(["SORT_TYPE"]),{onAddGoodsClick:function(){var e=c(o.default.mark(function e(){var n;return o.default.wrap(function(e){while(1)switch(e.prev=e.next){case 0:if(!(this.imgList1.length<=0)){e.next=3;break}return t.showToast({title:"至少上传一张图片",icon:"none"}),e.abrupt("return");case 3:if(""!=this.name){e.next=6;break}return t.showToast({title:"请输入商品名称",icon:"none"}),e.abrupt("return");case 6:if(""!=this.num){e.next=9;break}return t.showToast({title:"请输入商品库存",icon:"none"}),e.abrupt("return");case 9:if(""!=this.category){e.next=12;break}return t.showToast({title:"请选择商品分类",icon:"none"}),e.abrupt("return");case 12:if(""!=this.desc){e.next=15;break}return t.showToast({title:"请输入商品介绍",icon:"none"}),e.abrupt("return");case 15:if(!(this.imgList2.length<=0)){e.next=18;break}return t.showToast({title:"至少上传一张详情图片",icon:"none"}),e.abrupt("return");case 18:return e.next=20,(0,s.publishGoods)({token:t.getStorageSync("token"),images:this.baseList1.join("|"),title:this.name,price:this.price,details:this.baseList2.join("|"),sort:this.sortId,stock:this.num,described:this.desc,commodity_id:this.goodsId});case 20:n=e.sent,2e3==n.code&&(t.showToast({title:"保存成功"}),setTimeout(function(){t.navigateBack()},1500));case 22:case"end":return e.stop()}},e,this)}));function n(){return e.apply(this,arguments)}return n}(),onChoseTypeClick:function(){t.navigateTo({url:"/pages/home/subPages/publish-type/publish-type?type=2"})},onAddImgEvent:function(t){1==t&&(0,i.uploadImg)(this.baseList1,this.imgList1),2==t&&(0,i.uploadImg)(this.baseList2,this.imgList2)},onDelImgEvent:function(t,e){1==t&&(0,i.delUploadImg)(this.baseList1,this.imgList1,e),2==t&&(0,i.delUploadImg)(this.baseList2,this.imgList2,e)}}),components:{upload:f}};e.default=h}).call(this,n("6e42")["default"])},"32ac":function(t,e,n){"use strict";n.r(e);var o=n("747e"),i=n("68d3");for(var s in i)"default"!==s&&function(t){n.d(e,t,function(){return i[t]})}(s);n("b6f2");var r=n("2877"),a=Object(r["a"])(i["default"],o["a"],o["b"],!1,null,"d156f5a4",null);e["default"]=a.exports},"68d3":function(t,e,n){"use strict";n.r(e);var o=n("0858"),i=n.n(o);for(var s in o)"default"!==s&&function(t){n.d(e,t,function(){return o[t]})}(s);e["default"]=i.a},"747e":function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement;t._self._c},i=[];n.d(e,"a",function(){return o}),n.d(e,"b",function(){return i})},b6f2:function(t,e,n){"use strict";var o=n("bb91"),i=n.n(o);i.a},bb91:function(t,e,n){}},[["d5bc","common/runtime","common/vendor"]]]);