{"ast":null,"code":"//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nexport default {\n name: \"AddGood\",\n data: function data() {\n return {\n baseApi: this.$store.state.baseApi,\n schoolId: '',\n schools: [],\n good: {\n img: '',\n goodName: '',\n description: '',\n price: ''\n },\n user: localStorage.getItem(\"user\") ? JSON.parse(localStorage.getItem(\"user\")) : {}\n };\n },\n methods: {\n //图片上传成功钩子\n handleAvatarSuccess: function handleAvatarSuccess(res) {\n this.good.img = res.data;\n },\n //提交事件\n save: function save() {\n var _this = this;\n\n this.request.post(\"/api/market/good?schoolId=\" + this.schoolId, this.good).then(function (res) {\n if (res.code === '200') {\n _this.$message.success(\"发布成功\");\n }\n\n console.log(res);\n });\n }\n },\n created: function created() {\n var _this2 = this;\n\n this.request.get(\"/api/market/schools\").then(function (res) {\n if (res.code === '200') {\n var schools = res.data;\n _this2.schools = schools;\n }\n });\n },\n computed: {\n token: function token() {\n return {\n token: this.user.token\n };\n }\n }\n};","map":{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA;AACAA,iBADA;AAEAC,MAFA,kBAEA;AACA;AACAC,wCADA;AAEAC,kBAFA;AAGAC,iBAHA;AAIAC;AACAC,eADA;AAEAC,oBAFA;AAGAC,uBAHA;AAIAC;AAJA,OAJA;AAUAC;AAVA;AAYA,GAfA;AAgBAC;AACA;AACAC,uBAFA,+BAEAC,GAFA,EAEA;AACA;AACA,KAJA;AAKA;AACAC,QANA,kBAMA;AAAA;;AACA;AACA;AACA;AACA;;AACAC;AACA,OALA;AAMA;AAbA,GAhBA;AA+BAC,SA/BA,qBA+BA;AAAA;;AACA;AACA;AACA;AACA;AACA;AACA,KALA;AAMA,GAtCA;AAuCAC;AACAC,SADA,mBACA;AACA;AAAAA;AAAA;AACA;AAHA;AAvCA","names":["name","data","baseApi","schoolId","schools","good","img","goodName","description","price","user","methods","handleAvatarSuccess","res","save","console","created","computed","token"],"sourceRoot":"src/views/front/market","sources":["AddGood.vue"],"sourcesContent":["\r\n\r\n\r\n\r\n"]},"metadata":{},"sourceType":"module"}