From 9a23eaf6201c9d8cfeedd7244e56f6234fbea4d7 Mon Sep 17 00:00:00 2001 From: yuanjunzhe <1374457292@qq.com> Date: Thu, 28 Mar 2024 14:28:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Layout-shop/index.vue | 89 +++++++++ src/api/product/info.js | 10 + src/router/index.js | 15 +- src/views/product/info/detail/index.vue | 243 ++++++++++++++++++++++++ src/views/product/info/index.vue | 15 +- 5 files changed, 367 insertions(+), 5 deletions(-) create mode 100644 src/Layout-shop/index.vue create mode 100644 src/views/product/info/detail/index.vue diff --git a/src/Layout-shop/index.vue b/src/Layout-shop/index.vue new file mode 100644 index 0000000..8ba6e89 --- /dev/null +++ b/src/Layout-shop/index.vue @@ -0,0 +1,89 @@ + + + + 处理中心 + + 我的工作台 + 选项1 + 选项2 + 选项3 + + 选项4 + 选项1 + 选项2 + 选项3 + + + 消息中心 + 订单管理 + + + + + + + + + + + + + + diff --git a/src/api/product/info.js b/src/api/product/info.js index 80b02c2..4db015d 100644 --- a/src/api/product/info.js +++ b/src/api/product/info.js @@ -17,6 +17,16 @@ export function getInfo(id) { }) } + +// 查询商品信息详细 +export function getDetailInfo(id) { + return request({ + url: '/product/info/detail/' + id, + method: 'get' + }) +} + + // 新增商品信息 export function addInfo(data) { return request({ diff --git a/src/router/index.js b/src/router/index.js index 2afac71..3cce363 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,7 +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 +73,19 @@ export const constantRoutes = [ } ] }, + { + path: '', + component: LayoutShop, + redirect: 'product-detail', + children: [ + { + path: 'product-detail/:detailId(\\d+)', + 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..a6cde30 --- /dev/null +++ b/src/views/product/info/detail/index.vue @@ -0,0 +1,243 @@ + + + + 首页 + {{categoryInfo.name}} + + {{ projectDetail.projectInfo.name }} + + + + + + + + + + + + + + + + + + + + + + + + 456 + + + + + + + + + + + + + + + + {{projectDetail.brandInfo.name}} + + + + + + + + + + 商品名称 + ¥{{ checkSkuInfo.price }} + {{ checkSkuInfo.sku }} + 秒杀价格 + + + + + + + + + {{value}} + + + + + + + + + + + 加入购物车 + 立即购买 + + + + + + + + + + + 商品详情 + + + {{attributeMap[attribute.id]}} + + + {{attributeMap[attributeInfo.id]}} + + + + + + + + + + + + + diff --git a/src/views/product/info/index.vue b/src/views/product/info/index.vue index 4cef2ae..668f2b9 100644 --- a/src/views/product/info/index.vue +++ b/src/views/product/info/index.vue @@ -115,6 +115,9 @@ + + 商品详情 + - + 属性值填写 - + @@ -349,7 +352,7 @@ - + @@ -370,7 +373,7 @@ import {listBrand} from "@/api/product/brand"; import {getTemplateAttribute, listCategory} from "@/api/product/category"; import {listRule} from "@/api/product/rule"; import {addAttribute} from "@/api/product/attribute"; -import attribute from '@/views/product/attribute/index.vue' + export default { name: "Info", @@ -515,6 +518,10 @@ export default { this.getList(); }, methods: { + toProjectDetail(detailId){ + let url = `${window.location.origin}/product-detail/${detailId}`; + window.open(url) + }, oneSetting(){ this.skuList.forEach(skuInfo =>{ skuInfo.image = this.oneSettingForm.image