diff --git a/src/api/product/info.js b/src/api/product/info.js index 80b02c2..e15e6f7 100644 --- a/src/api/product/info.js +++ b/src/api/product/info.js @@ -16,6 +16,13 @@ export function getInfo(id) { method: 'get' }) } +// 查询商品信息详细 +export function getDetailInfo(id) { + return request({ + url: '/product/info/detail/' + id, + method: 'get' + }) +} // 新增商品信息 export function addInfo(data) { diff --git a/src/api/shopCart/Info.js b/src/api/shopCart/Info.js new file mode 100644 index 0000000..6eb4c49 --- /dev/null +++ b/src/api/shopCart/Info.js @@ -0,0 +1,59 @@ +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 getDetailInfo() { + return request({ + url: '/shopCart/Info/detail', + method: 'get' + }) +} + +// 新增购物车 +export function addInfo(data) { + return request({ + url: '/shopCart/Info', + method: 'post', + data: data + }) +} +export function cartInfoIsSelected(data) { + return request({ + url: '/shopCart/Info/selected', + 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/components/Editor/index.vue b/src/components/Editor/index.vue index 4d10bd8..dd3e1e0 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -124,6 +124,9 @@ export default { methods: { init() { const editor = this.$refs.editor; + if (this.readOnly){ + this.options.modules.toolbar = {}; + } this.Quill = new Quill(editor, this.options); // 如果设置了上传地址则自定义图片上传事件 if (this.type == 'url') { @@ -176,7 +179,7 @@ export default { }, handleUploadSuccess(res, file) { // 如果上传成功 - if (res.data.code == 200) { + if (res.code == 200) { // 获取富文本组件实例 let quill = this.Quill; // 获取光标所在位置 diff --git a/src/layout-shop/index.vue b/src/layout-shop/index.vue new file mode 100644 index 0000000..4739abf --- /dev/null +++ b/src/layout-shop/index.vue @@ -0,0 +1,74 @@ + + + + + 处理中心 + + 我的工作台 + 选项1 + 选项2 + 选项3 + + 选项4 + 选项1 + 选项2 + 选项3 + + + 消息中心 + 订单管理 + + + + + + + + + + + + + + + diff --git a/src/router/index.js b/src/router/index.js index 2afac71..ffd7807 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,6 +2,7 @@ import Vue from 'vue' import Router from 'vue-router' /* Layout */ import Layout from '@/layout' +import LayoutShop from "@/layout-shop"; Vue.use(Router) @@ -73,6 +74,32 @@ export const constantRoutes = [ } ] }, + { + path: '', + component: LayoutShop, + redirect: 'product-detail', + children: [ + { + path: 'product-detail/:detailId(\\d+)', + component: () => import('@/views/product/info/detail/index'), + name: 'productDetail', + meta: {title: '商品详情', icon: 'dashboard', affix: true} + } + ] + }, + { + path: '/cart', + component: LayoutShop, + redirect: 'cart-detail', + children: [ + { + path: '/cart/detail', + component: () => import('@/views/shopCart/detail/index'), + name: 'myCart', + meta: {title: '我的购物车', icon: 'dashboard', affix: true} + } + ] + }, { path: '/user', component: Layout, diff --git a/src/views/product/info/detail/index.vue b/src/views/product/info/detail/index.vue new file mode 100644 index 0000000..b53dbf3 --- /dev/null +++ b/src/views/product/info/detail/index.vue @@ -0,0 +1,203 @@ + + + + 首页 + {{categoryInfo.name}} + + {{projectDetail.projectInfo.name}} + + + + + + + + + + + + + + + + + + + + 456 + + + + + + + + + + + + + + + {{projectDetail.brandInfo.nam}} + + + + + + + + + 商品名称 + 商品规格({{checkSkuInfo.sku}}) + 库存:{{checkSkuInfo.stock}} + ¥{{checkSkuInfo.price}} + + + + {{value}} + + + + + + 加入购物车 + 立即购买 + + + + + + + + 商品详情 + + + {{attributeMap[attribute.id]}} + + + {{attributeMap[attributeInfo.id]}} + + + + + + + + + + + + + diff --git a/src/views/product/info/index.vue b/src/views/product/info/index.vue index 1346ecd..5e8c755 100644 --- a/src/views/product/info/index.vue +++ b/src/views/product/info/index.vue @@ -115,6 +115,9 @@ + + 商品详情 + { skuInfo.image = this.oneSettingForm.image; diff --git a/src/views/shopCart/Info/index.vue b/src/views/shopCart/Info/index.vue new file mode 100644 index 0000000..54eafde --- /dev/null +++ b/src/views/shopCart/Info/index.vue @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + 新增 + + + 修改 + + + 删除 + + + 导出 + + + + + + + + + + + + + + + + 修改 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..b59a730 --- /dev/null +++ b/src/views/shopCart/detail/index.vue @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + {{ 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 }} + + + + 下单 + + + + + + + + + + + + diff --git a/vue.config.js b/vue.config.js index 17d9a1d..92405cd 100644 --- a/vue.config.js +++ b/vue.config.js @@ -35,7 +35,7 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://127.0.0.1:8080`, + target: `http://10.1.123.97:8080`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''