diff --git a/src/api/product/shop.js b/src/api/product/shop.js new file mode 100644 index 0000000..d8d2bd9 --- /dev/null +++ b/src/api/product/shop.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询购物车列表 +export function listShop(query) { + return request({ + url: '/product/shop/list', + method: 'get', + params: query + }) +} + +// 查询购物车详细 +export function getShop(id) { + return request({ + url: '/product/shop/' + id, + method: 'get' + }) +} + +// 新增购物车 +export function addShop(data) { + return request({ + url: '/product/shop', + method: 'post', + data: data + }) +} + +// 修改购物车 +export function updateShop(data) { + return request({ + url: '/product/shop/'+data.id, + method: 'put', + data: data + }) +} + +// 删除购物车 +export function delShop(id) { + return request({ + url: '/product/shop/' + id, + method: 'delete' + }) +} diff --git a/src/api/shopCart/shop.js b/src/api/shopCart/shop.js new file mode 100644 index 0000000..09f5a15 --- /dev/null +++ b/src/api/shopCart/shop.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 查询购物车列表 +export function listShop(query) { + return request({ + url: '/shopCart/shop/list', + method: 'get', + params: query + }) +} + + +export function testShop(query) { + return request({ + url: '/shopCart/shop/shopList', + method: 'get', + params: query + }) +} + +// 查询购物车详细 +export function getShop(id) { + return request({ + url: '/shopCart/shop/' + id, + method: 'get' + }) +} + +// 新增购物车 +export function addShop(data) { + return request({ + url: '/shopCart/shop', + method: 'post', + data: data + }) +} + +// 修改购物车 +export function updateShop(data) { + return request({ + url: '/shopCart/shop/'+data.id, + method: 'put', + data: data + }) +} + +// 删除购物车 +export function delShop(id) { + return request({ + url: '/shopCart/shop/' + id, + method: 'delete' + }) +} diff --git a/src/layouttest/index.vue b/src/layouttest/index.vue index 4ae0c16..3cf3d22 100644 --- a/src/layouttest/index.vue +++ b/src/layouttest/index.vue @@ -11,17 +11,34 @@ active-text-color="#ffd04b"> 处理中心 - - 我的工作台 - 选项1 - 选项2 - 选项3 - - 选项4 - 选项1 - 选项2 - 选项3 - + + 我的购物车 + + + + + + + {{ scope.row.projectInfo.name }} + {{ scope.row.detailSku }} + + + + + + + {{scope.row.num}} + + + + + 进入购物车 消息中心 订单管理 @@ -41,22 +58,36 @@ diff --git a/src/router/index.js b/src/router/index.js index d44abf0..7f430fe 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -3,7 +3,6 @@ import Router from 'vue-router' /* Layout */ import Layout from '@/layout' import Layouttest from "@/layouttest"; -import DetailsComponent from '@/views/a/detailsComponent.vue'; Vue.use(Router) @@ -91,18 +90,30 @@ export const constantRoutes = [ }, { path: '', - component: DetailsComponent, + component: Layouttest, redirect: 'test', children: [ { path: '/detailsComponent/:id', - component: () => import('@/views/a/detailsComponent'), + component: () => import('@/views/product/productInfo/detail/productDetails.vue'), name: 'Test', meta: {title: "商品详情", icon: 'dashboard', affix: true} } ] }, - + { + path: '', + component: Layouttest, + redirect: 'test', + children: [ + { + path: 'shopping', + component: () => import('@/views/product/productInfo/detail/shopping.vue'), + name: 'Test', + meta: {title: "购物车", icon: 'dashboard', affix: true} + } + ] + }, { path: '/user', component: Layout, @@ -117,11 +128,7 @@ export const constantRoutes = [ } ] }, - { - path:'/details', - name:'/details', - component: DetailsComponent - } + ] // 动态路由,基于用户权限动态去加载 diff --git a/src/views/a/detailsComponent.vue b/src/views/a/detailsComponent.vue deleted file mode 100644 index af6ac0e..0000000 --- a/src/views/a/detailsComponent.vue +++ /dev/null @@ -1,347 +0,0 @@ - - - - - - - - 处理中心 - - 我的工作台 - 选项1 - 选项2 - 选项3 - - 选项4 - 选项1 - 选项2 - 选项3 - - - 消息中心 - 订单管理 - - - - - - - 首页 - {{ breadcrumb }} - - - - - - - - - - - - - - - - - - - - - - 999 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ good.name }}{{ - namess - }} - ¥{{ price }} - - - - {{ value }} - - - - - - - - 库存{{ stock }} - 总价{{ sumPrice }} - - - 加入购物车 - 立即购买 - - - - - - - - 商品详情 - - - - 商品评论 - - - - - {{ detail.name }} - - {{ detail.value }} - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/views/product/productInfo/detail/productDetails.vue b/src/views/product/productInfo/detail/productDetails.vue new file mode 100644 index 0000000..1c64fe9 --- /dev/null +++ b/src/views/product/productInfo/detail/productDetails.vue @@ -0,0 +1,340 @@ + + + + + 首页 + 商城 + {{ breadcrumb }} + + + + + + + + + + + + + + + + + + + + + + + 999 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ good.name }}{{checkgood.goodname}} + 单价: ¥{{ checkgood.price }} + + + + {{ value }} + + + + + + + + 库存{{ checkgood.stock }} + 总价¥{{ checkgood.sumPrice }} + + + 加入购物车 + 立即购买 + + + + + + + + 商品详情 + + + + 商品评论 + + + + + {{ detail.name }} + + {{ detail.value }} + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/product/productInfo/detail/shopping.vue b/src/views/product/productInfo/detail/shopping.vue new file mode 100644 index 0000000..7093364 --- /dev/null +++ b/src/views/product/productInfo/detail/shopping.vue @@ -0,0 +1,183 @@ + + + + + + 首页 + 商城 + + {{shop}} + + + + + + + + + + + {{ scope.row.projectInfo.name }} + {{ scope.row.detailSku }} + + + + + + + + + + + + + + + + + + {{ scope.row.num *scope.row.price }} + + + + + 移入收藏夹 + 删除 + + + + + + 全选 + 删除选中商品 移入到收藏夹 + ¥ {{totalPrice}} + 下单结算 + + + + + + + + diff --git a/src/views/shopCart/shop/index.vue b/src/views/shopCart/shop/index.vue new file mode 100644 index 0000000..bc84a9a --- /dev/null +++ b/src/views/shopCart/shop/index.vue @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + 新增 + + + 修改 + + + 删除 + + + 导出 + + + + + + + + + + + + + + + + 修改 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ scope.row.detailSku }}