{"ast":null,"code":"import \"core-js/modules/es.number.constructor.js\";\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//\nimport search from \"../../../components/Search\";\nexport default {\n name: \"GoodList\",\n data: function data() {\n return {\n total: 0,\n pageSize: 9,\n currentPage: 1,\n //选择的分类\n categoryId: Number,\n //搜索的内容\n searchText: '',\n good: []\n };\n },\n components: {\n search: search\n },\n created: function created() {\n //二者一般不同时存在\n this.searchText = this.$route.query.searchText;\n this.categoryId = this.$route.query.categoryId;\n console.log(this.searchText);\n console.log(this.categoryId);\n this.load();\n },\n methods: {\n handleCurrentPage: function handleCurrentPage(currentPage) {\n this.currentPage = currentPage;\n this.load();\n },\n handleSearch: function handleSearch(text) {\n this.searchText = text;\n this.load();\n },\n load: function load() {\n var _this = this;\n\n this.request.get(\"/api/good/page\", {\n params: {\n pageNum: this.currentPage,\n pageSize: this.pageSize,\n searchText: this.searchText,\n categoryId: this.categoryId\n }\n }).then(function (res) {\n if (res.code === '200') {\n _this.total = res.data.total;\n _this.good = res.data.records;\n console.log(_this.good);\n }\n });\n }\n }\n};","map":{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA;AACA;AACAA,kBADA;AAEAC,MAFA,kBAEA;AACA;AACAC,cADA;AAEAC,iBAFA;AAGAC,oBAHA;AAIA;AACAC,wBALA;AAMA;AACAC,oBAPA;AAQAC;AARA;AAUA,GAbA;AAcAC;AACAC;AADA,GAdA;AAiBAC,SAjBA,qBAiBA;AACA;AACA;AACA;AACAC;AACAA;AACA;AACA,GAxBA;AAyBAC;AACAC,qBADA,6BACAT,WADA,EACA;AACA;AACA;AACA,KAJA;AAKAU,gBALA,wBAKAC,IALA,EAKA;AACA;AACA;AACA,KARA;AASAC,QATA,kBASA;AAAA;;AACA;AACAC;AACAC,mCADA;AAEAf,iCAFA;AAGAG,qCAHA;AAIAD;AAJA;AADA,SAOAc,IAPA,CAOA;AACA;AACA;AACA;AACAR;AACA;AACA,OAbA;AAcA;AAxBA;AAzBA","names":["name","data","total","pageSize","currentPage","categoryId","searchText","good","components","search","created","console","methods","handleCurrentPage","handleSearch","text","load","params","pageNum","then"],"sourceRoot":"src/views/front/good","sources":["GoodList.vue"],"sourcesContent":["\r\n\r\n\r\n\r\n"]},"metadata":{},"sourceType":"module"}