From 59913537a62361b2b44e679c03382ae6f43dceee Mon Sep 17 00:00:00 2001 From: rouchen <3133657697@qq.com> Date: Tue, 26 Mar 2024 20:22:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=202.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/product/shoppingcard.js | 44 +++ src/api/shopCart/info.js | 44 +++ src/router/index.js | 12 +- src/views/product/info/detail/index.vue | 139 +++++--- src/views/product/info/index.vue | 36 ++- src/views/product/shoppingcard/index.vue | 392 +++++++++++++++++++++++ src/views/shopCart/info/index.vue | 331 +++++++++++++++++++ 7 files changed, 938 insertions(+), 60 deletions(-) create mode 100644 src/api/product/shoppingcard.js create mode 100644 src/api/shopCart/info.js create mode 100644 src/views/product/shoppingcard/index.vue create mode 100644 src/views/shopCart/info/index.vue diff --git a/src/api/product/shoppingcard.js b/src/api/product/shoppingcard.js new file mode 100644 index 0000000..d25bd52 --- /dev/null +++ b/src/api/product/shoppingcard.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询【请填写功能名称】列表 +export function listShoppingcard(query) { + return request({ + url: '/product/shoppingcard/list', + method: 'get', + params: query + }) +} + +// 查询【请填写功能名称】详细 +export function getShoppingcard(id) { + return request({ + url: '/product/shoppingcard/' + id, + method: 'get' + }) +} + +// 新增【请填写功能名称】 +export function addShoppingcard(data) { + return request({ + url: '/product/shoppingcard', + method: 'post', + data: data + }) +} + +// 修改【请填写功能名称】 +export function updateShoppingcard(data) { + return request({ + url: '/product/shoppingcard/'+data.id, + method: 'put', + data: data + }) +} + +// 删除【请填写功能名称】 +export function delShoppingcard(id) { + return request({ + url: '/product/shoppingcard/' + id, + method: 'delete' + }) +} diff --git a/src/api/shopCart/info.js b/src/api/shopCart/info.js new file mode 100644 index 0000000..789708f --- /dev/null +++ b/src/api/shopCart/info.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询购物车列表 +export function listInfo(query) { + return request({ + url: '/shopCart/info/list', + method: 'get', + params: query + }) +} + +// 查询购物车详细 +export function getInfo(id) { + return request({ + url: '/shopCart/info/' + id, + method: 'get' + }) +} + +// 新增购物车 +export function addInfo(data) { + return request({ + url: '/shopCart/info', + method: 'post', + data: data + }) +} + +// 修改购物车 +export function updateInfo(data) { + return request({ + url: '/shopCart/info/'+data.id, + method: 'put', + data: data + }) +} + +// 删除购物车 +export function delInfo(id) { + return request({ + url: '/shopCart/info/' + id, + method: 'delete' + }) +} diff --git a/src/router/index.js b/src/router/index.js index 74d3068..a35c89a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -80,17 +80,17 @@ export const constantRoutes = [ redirect: 'product-detail', children: [ { - path: 'product-detail', - component: () => import('@/views/product/shop/index'), + path: 'product-detail/:detailId(\\d+)', + component: () => import('@/views/product/info/detail/index'), name: 'ShopProduct', meta: {title: '商品详情', icon: 'dashboard', affix: true} } ] }, - { - path: '/gb', - component: detail - }, + // { + // path: '/gb', + // component: detail + // }, { path: '/user', component: Layout, diff --git a/src/views/product/info/detail/index.vue b/src/views/product/info/detail/index.vue index a2c943e..f4a99f0 100644 --- a/src/views/product/info/detail/index.vue +++ b/src/views/product/info/detail/index.vue @@ -92,47 +92,57 @@ :label="value" :key="value" :value="value" border>{{value}} - + 加入购物车 立即购买 - + 总价格{{num}}
商品详情 -
- - kooriookami - 18100000000 - 苏州市 - 江苏省苏州市吴中区吴中大道 1188 号 - - - kooriookami - 18100000000 - 苏州市 - - 学校 - - 江苏省苏州市吴中区吴中大道 1188 号 - + + + + {{attributeMap[attribute.id]}} + + + + + + + {{attributeMap[attributeInfo.id]}} + + + + + + {{attributeMap[attributeInfo.id]}} + + + + +
diff --git a/src/views/shopCart/info/index.vue b/src/views/shopCart/info/index.vue new file mode 100644 index 0000000..4915af0 --- /dev/null +++ b/src/views/shopCart/info/index.vue @@ -0,0 +1,331 @@ + + +