{"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//\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA;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":["\r\n\r\n\r\n\r\n"]},"metadata":{},"sourceType":"module"}