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 @@ + + + + + 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 @@ + + + + + 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 @@