From 24ea545cecc4288eadad35eebdc3522239b0f417 Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Mon, 8 Apr 2024 14:33:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/shopCart/Info.js | 8 ++ src/router/index.js | 13 ++ src/views/shopCart/detail/dataStructure | 30 +++++ src/views/shopCart/detail/index.vue | 158 ++++++++++++++++++++++++ 4 files changed, 209 insertions(+) create mode 100644 src/views/shopCart/detail/dataStructure create mode 100644 src/views/shopCart/detail/index.vue diff --git a/src/api/shopCart/Info.js b/src/api/shopCart/Info.js index be8e70c..e2675f3 100644 --- a/src/api/shopCart/Info.js +++ b/src/api/shopCart/Info.js @@ -17,6 +17,14 @@ export function getInfo(id) { }) } +// 查询购物车详细 +export function getDetailInfo() { + return request({ + url: '/shopCart/Info/detail', + method: 'get' + }) +} + // 新增购物车 export function addInfo(data) { return request({ diff --git a/src/router/index.js b/src/router/index.js index 2fa4ea6..20b2aaa 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -87,6 +87,19 @@ export const constantRoutes = [ } ] }, + { + path: '/cart', + component: LayoutShop, + redirect: 'cart-detail', + children: [ + { + path: '/cart/detail', + component: () => import('@/views/shopCart/detail/index'), + name: 'Demo', + meta: {title: '我的购物车', icon: 'dashboard', affix: true} + } + ] + }, { path: '/user', component: Layout, diff --git a/src/views/shopCart/detail/dataStructure b/src/views/shopCart/detail/dataStructure new file mode 100644 index 0000000..592188c --- /dev/null +++ b/src/views/shopCart/detail/dataStructure @@ -0,0 +1,30 @@ +{ + 购物车商品集合: [ + { + 购物车ID: 1, + 商品SKU图片: "url", + 商品名称: "", + 商品规格SKU集合: [ + { + 规格名称:"", + 规格属性:"" + } + ], + 商品单价:125.36, + 商品购物车数量:1, + 商品小计:125.36, + 是否选中: Y/N + } + ], + // 购物车统计 + statisticsCart: { + // 商品总数 + total: 0, + // 选择总数 + selectTotal: 0, + // 商品总价 + priceTotal: 0.00, + // 实际总价 + actualTotal: 0.00 + } +} diff --git a/src/views/shopCart/detail/index.vue b/src/views/shopCart/detail/index.vue new file mode 100644 index 0000000..4e091c6 --- /dev/null +++ b/src/views/shopCart/detail/index.vue @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + {{scope.row.name}} + + + + {{skuRule.ruleName}}:{{skuRule.ruleValue}} + + + + + + + + {{ scope.row.price }} + + + + + + + + {{ scope.row.subtotal }} + + + {{ scope.row.date }} + + + + 已失效 + + + + + + + + + {{ scope.row.date }} + + + + + + + + + + + 全选 + 删除选中商品 + + + + 共 {{statisticsCart.total}} 件商品,已选择 {{statisticsCart.selectTotal}} 件 + + 商品合计 : ¥{{statisticsCart.priceTotal}} + + 应付总额:¥{{statisticsCart.actualTotal}} + + + + 下单 + + + + + + + + + + + +