You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SRuml/SuperRice/vue/node_modules/.cache/babel-loader/c5ddcdf00ef7bd4c0ce026edc3d...

1 line
8.8 KiB

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":"export default {\n data() {\n return {\n user: JSON.parse(localStorage.getItem('xm-user') || '{}'),\n ordersData: [],\n pageNum: 1,\n // 当前的页码\n pageSize: 10,\n // 每页显示的个数\n total: 0,\n form: {}\n };\n },\n mounted() {\n this.loadOrders(1);\n },\n // methods本页面所有的点击事件或者其他函数定义区\n methods: {\n loadOrders(pageNum) {\n if (pageNum) this.pageNum = pageNum;\n this.$request.get('/orders/selectPage', {\n params: {\n pageNum: this.pageNum,\n pageSize: this.pageSize\n }\n }).then(res => {\n if (res.code === '200') {\n this.ordersData = res.data?.list;\n this.total = res.data?.total;\n } else {\n this.$message.error(res.msg);\n }\n });\n },\n navTo(url) {\n location.href = url;\n },\n del(id) {\n this.$request.delete('/orders/delete/' + id).then(res => {\n if (res.code === '200') {\n this.$message.success('删除成功');\n this.loadOrders(1);\n } else {\n this.$message.error(res.msg);\n }\n });\n },\n handleCurrentChange(pageNum) {\n this.loadOrders(pageNum);\n },\n updateStatus(row, status) {\n this.form = row;\n this.form.status = status;\n this.$request.put('/orders/update', this.form).then(res => {\n if (res.code === '200') {\n this.$message.success('操作成功');\n } else {\n this.$message.error(res.msg);\n }\n });\n },\n addComment() {}\n }\n};","map":{"version":3,"names":["data","user","JSON","parse","localStorage","getItem","ordersData","pageNum","pageSize","total","form","mounted","loadOrders","methods","$request","get","params","then","res","code","list","$message","error","msg","navTo","url","location","href","del","id","delete","success","handleCurrentChange","updateStatus","row","status","put","addComment"],"sources":["src/views/front/Orders.vue"],"sourcesContent":["<template>\r\n <div class=\"main-content\">\r\n <div style=\"width: 80%; background-color: white; margin: 30px auto; border-radius: 20px\">\r\n <div style=\"padding-bottom: 10px\">\r\n <div style=\"font-size: 18px; color: #000000FF; line-height: 80px; border-bottom: #cccccc 1px solid;\">\r\n <div style=\"margin-left: 20px\">我的订单({{ ordersData.length }} 个)</div>\r\n </div>\r\n <div style=\"margin: 20px 0; padding: 0 50px\">\r\n <div class=\"table\">\r\n <el-table :data=\"ordersData\" strip>\r\n <el-table-column label=\"商品图片\" width=\"120px\">\r\n <template v-slot=\"scope\">\r\n <el-image style=\"width: 80px; height: 60px; border-radius: 3px\" v-if=\"scope.row.goodsImg\"\r\n :src=\"scope.row.goodsImg\" :preview-src-list=\"[scope.row.goodsImg]\"></el-image>\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"orderId\" label=\"订单编号\"></el-table-column>\r\n <el-table-column prop=\"goodsName\" label=\"商品名称\" :show-overflow-tooltip=\"true\">\r\n <template v-slot=\"scope\">\r\n <a :href=\"'/front/detail?id=' + scope.row.goodsId\">{{scope.row.goodsName}}</a>\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"businessName\" label=\"店铺名称\">\r\n <template v-slot=\"scope\">\r\n <a :href=\"'/front/business?id=' + scope.row.businessId\">{{scope.row.businessName}}</a>\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"goodsPrice\" label=\"商品价格\">\r\n <template v-slot=\"scope\">\r\n {{scope.row.goodsPrice}} / {{scope.row.goodsUnit}}\r\n </template>\r\n </el-table-column>\r\n <el-table-column prop=\"num\" label=\"商品数量\"></el-table-column>\r\n <el-table-column prop=\"price\" label=\"订单总价\"></el-table-column>\r\n <el-table-column prop=\"username\" label=\"收货人\"></el-table-column>\r\n <el-table-column prop=\"useraddress\" label=\"收货地址\"></el-table-column>\r\n <el-table-column prop=\"phone\" label=\"联系电话\"></el-table-column>\r\n <el-table-column prop=\"status\" label=\"订单状态\"></el-table-column>\r\n <el-table-column label=\"操作\" align=\"center\" width=\"180\">\r\n <template v-slot=\"scope\">\r\n <el-button size=\"mini\" type=\"primary\" v-if=\"scope.row.status === '待收货'\" plain @click=\"updateStatus(scope.row, '已完成')\">确认收货</el-button>\r\n <el-button size=\"mini\" type=\"primary\" v-if=\"scope.row.status === '已完成'\" plain @click=\"addComment(scope.row)\">评价</el-button>\r\n <el-button size=\"mini\" type=\"danger\" plain @click=\"del(scope.row.id)\">删除</el-button>\r\n </template>\r\n </el-table-column>\r\n </el-table>\r\n\r\n <div class=\"pagination\" style=\"margin-top: 20px\">\r\n <el-pagination\r\n background\r\n @current-change=\"handleCurrentChange\"\r\n :current-page=\"pageNum\"\r\n :page-sizes=\"[5, 10, 20]\"\r\n :page-size=\"pageSize\"\r\n layout=\"total, prev, pager, next\"\r\n :total=\"total\">\r\n </el-pagination>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n \r\n </div>\r\n</template>\r\n\r\n<script>\r\n\r\nexport default {\r\n\r\n data() {\r\n return {\r\n user: JSON.parse(localStorage.getItem('xm-user') || '{}'),\r\n ordersData: [],\r\n pageNum: 1, // 当前的页码\r\n pageSize: 10, // 每页显示的个数\r\n total: 0,\r\n form: {}\r\n }\r\n },\r\n mounted() {\r\n this.loadOrders(1)\r\n },\r\n // methods本页面所有的点击事件或者其他函数定义区\r\n methods: {\r\n loadOrders(pageNum) {\r\n if (pageNum) this.pageNum = pageNum\r\n this.$request.get('/orders/selectPage', {\r\n params: {\r\n pageNum: this.pageNum,\r\n pageSize: this.pageSize,\r\n }\r\n }).then(res => {\r\n if (res.code === '200') {\r\n this.ordersData = res.data?.list\r\n this.total = res.data?.total\r\n } else {\r\n this.$message.error(res.msg)\r\n }\r\n })\r\n },\r\n navTo(url) {\r\n location.href = url\r\n },\r\n del(id) {\r\n this.$request.delete('/orders/delete/' + id).then(res => {\r\n if (res.code === '200') {\r\n this.$message.success('删除成功')\r\n this.loadOrders(1)\r\n } else {\r\n this.$message.error(res.msg)\r\n }\r\n })\r\n },\r\n handleCurrentChange(pageNum) {\r\n this.loadOrders(pageNum)\r\n },\r\n updateStatus(row, status) {\r\n this.form = row\r\n this.form.status = status\r\n this.$request.put('/orders/update', this.form).then(res => {\r\n if (res.code === '200') {\r\n this.$message.success('操作成功')\r\n } else {\r\n this.$message.error(res.msg)\r\n }\r\n })\r\n },\r\n addComment() {\r\n\r\n }\r\n }\r\n}\r\n</script>"],"mappings":"AAoEA;EAEAA,KAAA;IACA;MACAC,IAAA,EAAAC,IAAA,CAAAC,KAAA,CAAAC,YAAA,CAAAC,OAAA;MACAC,UAAA;MACAC,OAAA;MAAA;MACAC,QAAA;MAAA;MACAC,KAAA;MACAC,IAAA;IACA;EACA;EACAC,QAAA;IACA,KAAAC,UAAA;EACA;EACA;EACAC,OAAA;IACAD,WAAAL,OAAA;MACA,IAAAA,OAAA,OAAAA,OAAA,GAAAA,OAAA;MACA,KAAAO,QAAA,CAAAC,GAAA;QACAC,MAAA;UACAT,OAAA,OAAAA,OAAA;UACAC,QAAA,OAAAA;QACA;MACA,GAAAS,IAAA,CAAAC,GAAA;QACA,IAAAA,GAAA,CAAAC,IAAA;UACA,KAAAb,UAAA,GAAAY,GAAA,CAAAlB,IAAA,EAAAoB,IAAA;UACA,KAAAX,KAAA,GAAAS,GAAA,CAAAlB,IAAA,EAAAS,KAAA;QACA;UACA,KAAAY,QAAA,CAAAC,KAAA,CAAAJ,GAAA,CAAAK,GAAA;QACA;MACA;IACA;IACAC,MAAAC,GAAA;MACAC,QAAA,CAAAC,IAAA,GAAAF,GAAA;IACA;IACAG,IAAAC,EAAA;MACA,KAAAf,QAAA,CAAAgB,MAAA,qBAAAD,EAAA,EAAAZ,IAAA,CAAAC,GAAA;QACA,IAAAA,GAAA,CAAAC,IAAA;UACA,KAAAE,QAAA,CAAAU,OAAA;UACA,KAAAnB,UAAA;QACA;UACA,KAAAS,QAAA,CAAAC,KAAA,CAAAJ,GAAA,CAAAK,GAAA;QACA;MACA;IACA;IACAS,oBAAAzB,OAAA;MACA,KAAAK,UAAA,CAAAL,OAAA;IACA;IACA0B,aAAAC,GAAA,EAAAC,MAAA;MACA,KAAAzB,IAAA,GAAAwB,GAAA;MACA,KAAAxB,IAAA,CAAAyB,MAAA,GAAAA,MAAA;MACA,KAAArB,QAAA,CAAAsB,GAAA,wBAAA1B,IAAA,EAAAO,IAAA,CAAAC,GAAA;QACA,IAAAA,GAAA,CAAAC,IAAA;UACA,KAAAE,QAAA,CAAAU,OAAA;QACA;UACA,KAAAV,QAAA,CAAAC,KAAA,CAAAJ,GAAA,CAAAK,GAAA;QACA;MACA;IACA;IACAc,WAAA,GAEA;EACA;AACA"},"metadata":{},"sourceType":"module","externalDependencies":[]}