qauMaWeb/node_modules/.cache/babel-loader/4b978dd5849f8401dee2ca2e6ea...

1 line
5.9 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 \"core-js/modules/es.number.to-fixed.js\";\nimport \"core-js/modules/es.json.stringify.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//\nexport default {\n name: \"CartItem\",\n props: {\n cart: Object,\n countChangeFlag: false\n },\n created: function created() {},\n data: function data() {\n return {\n baseApi: this.$store.state.baseApi\n };\n },\n computed: {\n totalPrice: function totalPrice() {\n return (this.realPrice * this.cart.count).toFixed(2);\n },\n realPrice: function realPrice() {\n return this.cart.price * this.cart.discount;\n }\n },\n methods: {\n //从购物车移除\n del: function del(id) {\n var _this = this;\n\n this.request.delete(\"/api/cart/\" + this.cart.id).then(function (res) {\n if (res.code === '200') {\n _this.$message.success(\"删除成功\");\n\n _this.$emit('delete', _this.cart.id);\n }\n });\n },\n //跳转到支付页面\n pay: function pay() {\n var good = {\n id: this.cart.goodId,\n name: this.cart.goodName,\n imgs: this.cart.img,\n discount: this.cart.discount\n };\n this.$router.push({\n name: 'preOrder',\n query: {\n good: JSON.stringify(good),\n realPrice: this.realPrice,\n num: this.cart.count,\n standard: this.cart.standard,\n cartId: this.cart.id\n }\n });\n }\n }\n};","map":{"version":3,"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA;AACAA,kBADA;AAEAC;AACAC,gBADA;AAEAC;AAFA,GAFA;AAMAC,SANA,qBAMA,CAEA,CARA;AASAC,MATA,kBASA;AACA;AAEAC;AAFA;AAIA,GAdA;AAeAC;AACAC;AACA;AACA,KAHA;AAIAC;AACA;AACA;AANA,GAfA;AAuBAC;AACA;AACAC,OAFA,eAEAC,EAFA,EAEA;AAAA;;AACA;AACA;AACA;;AACA;AACA;AACA,OALA;AAMA,KATA;AAUA;AACAC,OAXA,iBAWA;AACA;AAAAD;AAAAZ;AAAAc;AAAAC;AAAA;AACA;AAAAf;AAAAgB;AAAAC;AAAAR;AAAAS;AAAAC;AAAAC;AAAA;AAAA;AACA;AAdA;AAvBA","names":["name","props","cart","countChangeFlag","created","data","baseApi","computed","totalPrice","realPrice","methods","del","id","pay","imgs","discount","query","good","num","standard","cartId"],"sourceRoot":"src/components","sources":["CartItem.vue"],"sourcesContent":["<template>\r\n <div>\r\n <div class=\"header\" style=\"padding-left: 25px;\">\r\n <span style=\"line-height: 40px;color: #42b983\">加入时间 </span>\r\n <span style=\"line-height: 40px\">{{ cart.createTime }}</span>\r\n </div>\r\n <div class=\"body\">\r\n<!-- 图片-->\r\n <div style=\"display: inline-block;margin-right: 20px\">\r\n <router-link :to=\"'goodview/'+cart.goodId\">\r\n <img :src=\"baseApi + cart.img\" style=\"width: 100px;height:100px\">\r\n </router-link>\r\n </div>\r\n<!-- 商品信息-->\r\n <div style=\"display: inline-block;line-height: 40px\" >\r\n <table>\r\n <tr>\r\n <th>商品</th>\r\n <th>规格</th>\r\n <th>价格</th>\r\n <th>数量</th>\r\n <th>总价</th>\r\n <th>操作</th>\r\n </tr>\r\n <tr>\r\n <a :href=\"'goodview/'+cart.goodId\">\r\n <td>{{ cart.goodName }}</td>\r\n </a>\r\n <td>{{cart.standard}}</td>\r\n <td>{{realPrice}}</td>\r\n <td>\r\n <el-button size=\"mini\" @click=\"countChangeFlag=true\" v-if=\"!countChangeFlag\">\r\n {{cart.count}}\r\n </el-button>\r\n <el-input-number v-model=\"cart.count\" :min=\"1\" :max=\"cart.store\" v-if=\"countChangeFlag\" style=\"width: 120px\" ></el-input-number>\r\n </td>\r\n <td>{{totalPrice}}</td>\r\n <td>\r\n <el-button size=\"mini\" type=\"success\" @click=\"pay\">支付</el-button>\r\n <el-popconfirm\r\n @confirm=\"del\"\r\n title=\"确定删除?\"\r\n >\r\n <el-button size=\"mini\" type=\"danger\" icon=\"el-icon-delete\" slot=\"reference\" style=\"margin-left: 10px\"></el-button>\r\n </el-popconfirm>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: \"CartItem\",\r\n props:{\r\n cart: Object,\r\n countChangeFlag: false,\r\n },\r\n created() {\r\n \r\n },\r\n data(){\r\n return{\r\n\r\n baseApi: this.$store.state.baseApi,\r\n }\r\n },\r\n computed:{\r\n totalPrice:function () {\r\n return (this.realPrice * this.cart.count).toFixed(2)\r\n },\r\n realPrice: function (){\r\n return (this.cart.price * this.cart.discount)\r\n }\r\n },\r\n methods:{\r\n //从购物车移除\r\n del(id){\r\n this.request.delete(\"/api/cart/\"+this.cart.id).then(res=>{\r\n if(res.code==='200'){\r\n this.$message.success(\"删除成功\")\r\n this.$emit('delete',this.cart.id)\r\n }\r\n })\r\n },\r\n //跳转到支付页面\r\n pay(){\r\n let good = {id: this.cart.goodId,name: this.cart.goodName,imgs: this.cart.img,discount: this.cart.discount}\r\n this.$router.push({name: 'preOrder',query: {good: JSON.stringify(good), realPrice: this.realPrice, num: this.cart.count, standard: this.cart.standard, cartId: this.cart.id}})\r\n },\r\n }\r\n}\r\n</script>\r\n\r\n<style scoped>\r\n.header{\r\n background-color: #daf3ff;\r\n height: 40px;\r\n}\r\n.body{\r\n background-color: white;\r\n padding: 20px;\r\n}\r\nth,td{\r\n\r\n width: 120px;\r\n text-align: center;\r\n}\r\nth{\r\n font-size: 15px;\r\n color: #00b7ff;\r\n font-weight: normal;\r\n}\r\n</style>"]},"metadata":{},"sourceType":"module"}