From 9c60ed86997cfbd3af534bc33d41d9528fbfa230 Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Mon, 25 Mar 2024 11:46:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/product/info.js | 7 + src/components/Editor/index.vue | 3 + src/layout-shop/index.vue | 74 ++++++++++ src/router/index.js | 14 ++ src/views/product/info/detail/index.vue | 186 ++++++++++++++++++++++++ 5 files changed, 284 insertions(+) create mode 100644 src/layout-shop/index.vue create mode 100644 src/views/product/info/detail/index.vue 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/components/Editor/index.vue b/src/components/Editor/index.vue index 4d10bd8..9d4a8d3 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') { 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..182d438 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,19 @@ export const constantRoutes = [ } ] }, + { + path: '', + component: LayoutShop, + redirect: 'product-detail', + children: [ + { + path: 'product-detail', + component: () => import('@/views/product/info/detail/index'), + name: 'Demo', + 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..d4fc254 --- /dev/null +++ b/src/views/product/info/detail/index.vue @@ -0,0 +1,186 @@ + + + + +