qauMaWeb/node_modules/.cache/babel-loader/6e87eef18dfdd5cacdd056c8fb9...

1 line
14 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"ast":null,"code":"import _defineProperty from \"D:/Work/WorkSpace/GitWorkSpace/TenShop/resource/ElectronicMall/src/ElectronicMallVue/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport \"core-js/modules/es.array.slice.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//\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//\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: \"TopView\",\n data: function data() {\n return _defineProperty({\n //轮播图\n carousels: [],\n //推荐商品\n good: [],\n baseApi: this.$store.state.baseApi,\n //分类icon每个icon包含id、value、categories对象数组.categoryidname\n icons: [],\n //搜索内容\n searchText: \"\"\n }, \"baseApi\", this.$store.state.baseApi);\n },\n components: {\n search: search\n },\n created: function created() {\n var _this = this;\n\n this.request.get(\"/api/good\").then(function (res) {\n if (res.code === \"200\") {\n _this.good = res.data;\n } else {\n _this.$message.error(res.msg);\n }\n }).catch(function (e) {\n console.log(e);\n\n if (e.response == undefined || e.response.data == undefined) {\n _this.$message({\n showClose: true,\n message: e,\n type: \"error\",\n duration: 5000\n });\n } else {\n _this.$message({\n showClose: true,\n message: e.response.data,\n type: \"error\",\n duration: 5000\n });\n }\n });\n this.request.get(\"/api/icon\").then(function (res) {\n if (res.code === \"200\") {\n _this.icons = res.data;\n\n if (_this.icons.length > 6) {\n // 截取前六个分类\n _this.icons = _this.icons.slice(0, 6);\n }\n }\n }).catch(function (e) {\n console.log(e);\n\n if (e.response == undefined || e.response.data == undefined) {\n _this.$message({\n showClose: true,\n message: e,\n type: \"error\",\n duration: 5000\n });\n } else {\n _this.$message({\n showClose: true,\n message: e.response.data,\n type: \"error\",\n duration: 5000\n });\n }\n });\n this.request.get(\"/api/carousel\").then(function (res) {\n if (res.code === \"200\") {\n _this.carousels = res.data;\n }\n }).catch(function (e) {\n console.log(e);\n\n if (e.response == undefined || e.response.data == undefined) {\n _this.$message({\n showClose: true,\n message: e,\n type: \"error\",\n duration: 5000\n });\n } else {\n _this.$message({\n showClose: true,\n message: e.response.data,\n type: \"error\",\n duration: 5000\n });\n }\n });\n },\n methods: {\n handleSearch: function handleSearch(text) {\n this.searchText = text;\n this.$router.push({\n path: \"/goodList\",\n query: {\n searchText: this.searchText\n }\n });\n }\n }\n};","map":{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHA;AAEA;AACAA,iBADA;AAEAC,MAFA,kBAEA;AACA;AACA;AACAC,mBAFA;AAGA;AACAC,cAJA;AAKAC,wCALA;AAOA;AACAC,eARA;AASA;AACAC;AAVA,kBAWA,yBAXA;AAaA,GAhBA;AAiBAC;AACAC;AADA,GAjBA;AAoBAC,SApBA,qBAoBA;AAAA;;AACA,iBACAC,GADA,CACA,WADA,EAEAC,IAFA,CAEA;AACA;AACA;AACA,OAFA,MAEA;AACA;AACA;AACA,KARA,EASAC,KATA,CASA;AACAC;;AACA;AACA;AACAC,yBADA;AAEAC,oBAFA;AAGAC,uBAHA;AAIAC;AAJA;AAMA,OAPA,MAOA;AACA;AACAH,yBADA;AAEAC,kCAFA;AAGAC,uBAHA;AAIAC;AAJA;AAMA;AACA,KA1BA;AA2BA,iBACAP,GADA,CACA,WADA,EAEAC,IAFA,CAEA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA,KAVA,EAWAC,KAXA,CAWA;AACAC;;AACA;AACA;AACAC,yBADA;AAEAC,oBAFA;AAGAC,uBAHA;AAIAC;AAJA;AAMA,OAPA,MAOA;AACA;AACAH,yBADA;AAEAC,kCAFA;AAGAC,uBAHA;AAIAC;AAJA;AAMA;AACA,KA5BA;AA6BA,iBACAP,GADA,CACA,eADA,EAEAC,IAFA,CAEA;AACA;AACA;AACA;AAEA,KAPA,EAQAC,KARA,CAQA;AACAC;;AACA;AACA;AACAC,yBADA;AAEAC,oBAFA;AAGAC,uBAHA;AAIAC;AAJA;AAMA,OAPA,MAOA;AACA;AACAH,yBADA;AAEAC,kCAFA;AAGAC,uBAHA;AAIAC;AAJA;AAMA;AAEA,KA1BA;AA2BA,GAxGA;AAyGAC;AACAC,gBADA,wBACAC,IADA,EACA;AACA;AACA;AACAC,yBADA;AAEAC;AAAAhB;AAAA;AAFA;AAIA;AAPA;AAzGA","names":["name","data","carousels","good","baseApi","icons","searchText","components","search","created","get","then","catch","console","showClose","message","type","duration","methods","handleSearch","text","path","query"],"sourceRoot":"src/views/front","sources":["TopView.vue"],"sourcesContent":["<!--\r\n * @Description: \r\n * @Author: Rabbiter\r\n * @Date: 2023-03-26 15:27:05\r\n-->\r\n<template>\r\n <div>\r\n <search @search=\"handleSearch\"></search>\r\n\r\n <div class=\"main-box\">\r\n <div class=\"block\" style=\"margin: 10px auto\">\r\n <!-- 类别菜单-->\r\n <div class=\"good-menu\">\r\n <ul v-for=\"(item, index) in icons\" :key=\"index\">\r\n <li>\r\n <i class=\"iconfont\" v-html=\"item.value\"></i>\r\n <!-- 跳转到goodList页面参数为类别id-->\r\n <span\r\n v-for=\"(category, index2) in item.categories\"\r\n :key=\"index2\"\r\n >\r\n <router-link\r\n :to=\"{\r\n path: '/goodlist',\r\n query: { categoryId: category.id },\r\n }\"\r\n >\r\n <a href=\"/person\"\r\n ><span> {{ category.name }}</span></a\r\n >\r\n </router-link>\r\n <span\r\n v-if=\"index2 != item.categories.length - 1\"\r\n >\r\n /\r\n </span>\r\n </span>\r\n </li>\r\n </ul>\r\n </div>\r\n <!--轮播图-->\r\n <div>\r\n <el-carousel\r\n height=\"370px\"\r\n style=\"border-radius: 20px; width: 600px\"\r\n >\r\n <el-carousel-item\r\n v-for=\"carousel in carousels\"\r\n :key=\"carousel.id\"\r\n >\r\n <router-link :to=\"'/goodview/' + carousel.goodId\">\r\n <img\r\n style=\"\r\n height: 370px;\r\n width: 600px;\r\n object-fit: contain;\r\n background-color: black;\r\n \"\r\n :src=\"baseApi + carousel.img\"\r\n />\r\n </router-link>\r\n </el-carousel-item>\r\n </el-carousel>\r\n </div>\r\n </div>\r\n <!--推荐商品-->\r\n <div\r\n id=\"recommend\"\r\n style=\"\r\n margin-top: 30px;\r\n font-size: 28px;\r\n font-weight: 600;\r\n color: #ff5e5e;\r\n \"\r\n >\r\n 推荐商品\r\n </div>\r\n\r\n <div style=\"margin: 20px auto\">\r\n <el-row >\r\n <el-col\r\n :span=\"6\"\r\n v-for=\"good in good\"\r\n :key=\"good.id\"\r\n style=\"margin-bottom: 20px;height: 300px\"\r\n >\r\n <router-link :to=\"'goodview/' + good.id\">\r\n <el-card\r\n :body-style=\"{\r\n padding: '0px',\r\n background: '#e3f5f4',\r\n }\"\r\n >\r\n <img\r\n :src=\"baseApi + good.imgs\"\r\n style=\"width: 100%; height: 300px\"\r\n />\r\n <div style=\"padding: 5px 10px\">\r\n <span style=\"font-size: 18px\" class=\"ellipsis-title\"\r\n ><b>{{ good.name }}</b></span\r\n ><br />\r\n <span style=\"color: red; font-size: 15px\"\r\n ><b>¥{{ good.price }}</b></span\r\n >\r\n </div>\r\n </el-card>\r\n </router-link>\r\n </el-col>\r\n </el-row>\r\n </div>\r\n </div>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nimport search from \"../../components/Search\";\r\n\r\nexport default {\r\n name: \"TopView\",\r\n data() {\r\n return {\r\n //轮播图\r\n carousels: [],\r\n //推荐商品\r\n good: [],\r\n baseApi: this.$store.state.baseApi,\r\n\r\n //分类icon每个icon包含id、value、categories对象数组.categoryidname\r\n icons: [],\r\n //搜索内容\r\n searchText: \"\",\r\n baseApi: this.$store.state.baseApi,\r\n };\r\n },\r\n components: {\r\n search,\r\n },\r\n created() {\r\n this.request\r\n .get(\"/api/good\")\r\n .then((res) => {\r\n if (res.code === \"200\") {\r\n this.good = res.data;\r\n } else {\r\n this.$message.error(res.msg);\r\n }\r\n })\r\n .catch((e) => {\r\n console.log(e);\r\n if (e.response == undefined || e.response.data == undefined) {\r\n this.$message({\r\n showClose: true,\r\n message: e,\r\n type: \"error\",\r\n duration: 5000,\r\n });\r\n } else {\r\n this.$message({\r\n showClose: true,\r\n message: e.response.data,\r\n type: \"error\",\r\n duration: 5000,\r\n });\r\n }\r\n });\r\n this.request\r\n .get(\"/api/icon\")\r\n .then((res) => {\r\n if (res.code === \"200\") {\r\n this.icons = res.data;\r\n if (this.icons.length > 6) {\r\n // 截取前六个分类\r\n this.icons = this.icons.slice(0, 6);\r\n }\r\n }\r\n })\r\n .catch((e) => {\r\n console.log(e);\r\n if (e.response == undefined || e.response.data == undefined) {\r\n this.$message({\r\n showClose: true,\r\n message: e,\r\n type: \"error\",\r\n duration: 5000,\r\n });\r\n } else {\r\n this.$message({\r\n showClose: true,\r\n message: e.response.data,\r\n type: \"error\",\r\n duration: 5000,\r\n });\r\n }\r\n });\r\n this.request\r\n .get(\"/api/carousel\")\r\n .then((res) => {\r\n if (res.code === \"200\") {\r\n this.carousels = res.data;\r\n }\r\n \r\n })\r\n .catch((e) => {\r\n console.log(e);\r\n if (e.response == undefined || e.response.data == undefined) {\r\n this.$message({\r\n showClose: true,\r\n message: e,\r\n type: \"error\",\r\n duration: 5000,\r\n });\r\n } else {\r\n this.$message({\r\n showClose: true,\r\n message: e.response.data,\r\n type: \"error\",\r\n duration: 5000,\r\n });\r\n }\r\n \r\n });\r\n },\r\n methods: {\r\n handleSearch(text) {\r\n this.searchText = text;\r\n this.$router.push({\r\n path: \"/goodList\",\r\n query: { searchText: this.searchText },\r\n });\r\n },\r\n },\r\n};\r\n</script>\r\n\r\n<style scoped>\r\n.main-box {\r\n background-color: white;\r\n border: white 2px solid;\r\n border-radius: 40px;\r\n padding: 20px 40px;\r\n margin: 5px auto;\r\n}\r\n.good-menu {\r\n float: left;\r\n height: 370px;\r\n margin-right: 130px;\r\n}\r\n.good-menu li {\r\n list-style: none;\r\n overflow: hidden;\r\n margin-bottom: 35px;\r\n}\r\n.good-menu li a,\r\nspan {\r\n font-size: 20px;\r\n color: #6c6969;\r\n}\r\n.good-menu a span:hover {\r\n color: #00b7ff;\r\n}\r\n</style>"]},"metadata":{},"sourceType":"module"}