|
@ -1,34 +1,14 @@ |
|
|
<template> |
|
|
<template> |
|
|
<!-- Banner --> |
|
|
|
|
|
<Banner :data="form" /> |
|
|
|
|
|
|
|
|
<div class="flex flex-col w-full md:w-3/4 m-auto pt-[70px]"> |
|
|
|
|
|
|
|
|
<div v-if="goods" class="flex flex-col w-full md:w-3/4 m-auto my-3"> |
|
|
|
|
|
<Breadcrumb :data="goods" /> |
|
|
|
|
|
<div class="bg-white p-3 mt-3 flex items-center justify-between"> |
|
|
|
|
|
<div class="left flex gap-xs items-center"> |
|
|
|
|
|
<el-avatar shape="square" :size="55" /> |
|
|
|
|
|
<div class="shop-name flex flex-col"> |
|
|
|
|
|
<div class="shop-name cursor-pointer"> |
|
|
|
|
|
<div class="flex items-center"> |
|
|
|
|
|
<text class="text-xl">南宁市网宿信息科技有限公司</text> |
|
|
|
|
|
<el-tag type="success" size="small" class="ml-2">官网</el-tag> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<el-rate |
|
|
|
|
|
v-model="rate" |
|
|
|
|
|
show-score |
|
|
|
|
|
text-color="#ff9900" |
|
|
|
|
|
score-template="{value}"> |
|
|
|
|
|
</el-rate> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<el-button>进入店铺</el-button> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
<Breadcrumb :data="form" /> |
|
|
|
|
|
|
|
|
<div class="bg-white p-4 mt-4 flex gap-xl"> |
|
|
|
|
|
|
|
|
<ProductShopInfo :data="goods?.merchant" /> |
|
|
|
|
|
|
|
|
|
|
|
<div class="bg-white p-4 mt-4 flex gap-xl rounded-xl"> |
|
|
<div class="goods-image flex gap-xl"> |
|
|
<div class="goods-image flex gap-xl"> |
|
|
<div class="gap-xs flex flex-col"> |
|
|
<div class="gap-xs flex flex-col"> |
|
|
<el-avatar v-for="item in goods.files" :src="item.url" size="large" shape="square" /> |
|
|
|
|
|
|
|
|
<el-avatar v-for="item in JSON.parse(goods.files)" :src="item.url" size="large" shape="square" /> |
|
|
</div> |
|
|
</div> |
|
|
<el-image :src="goods.image" fit="contain" class="w-2xl h-2xl bg-gray-100 border-radius:30px"></el-image> |
|
|
<el-image :src="goods.image" fit="contain" class="w-2xl h-2xl bg-gray-100 border-radius:30px"></el-image> |
|
|
</div> |
|
|
</div> |
|
@ -63,7 +43,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="content p-4 bg-white"> |
|
|
|
|
|
|
|
|
<div class="content p-4 bg-white mt-4 rounded-xl"> |
|
|
<el-tabs v-model="activeName" :lazy="true" @tab-click="handleClick"> |
|
|
<el-tabs v-model="activeName" :lazy="true" @tab-click="handleClick"> |
|
|
<el-tab-pane label="参数信息" name="parameter"> |
|
|
<el-tab-pane label="参数信息" name="parameter"> |
|
|
<el-descriptions class="margin-top" title="参数信息" :column="1" border> |
|
|
<el-descriptions class="margin-top" title="参数信息" :column="1" border> |
|
@ -78,7 +58,7 @@ |
|
|
</el-tab-pane> |
|
|
</el-tab-pane> |
|
|
<el-tab-pane label="图文详情" name="content"> |
|
|
<el-tab-pane label="图文详情" name="content"> |
|
|
<div class="files flex flex-col w-3/4"> |
|
|
<div class="files flex flex-col w-3/4"> |
|
|
<el-image v-for="item in goods.files" :src="item.url" /> |
|
|
|
|
|
|
|
|
<el-image v-for="item in JSON.parse(goods.files)" :src="item.url" /> |
|
|
</div> |
|
|
</div> |
|
|
</el-tab-pane> |
|
|
</el-tab-pane> |
|
|
<el-tab-pane label="用户评价" name="reviews">用户评价</el-tab-pane> |
|
|
<el-tab-pane label="用户评价" name="reviews">用户评价</el-tab-pane> |
|
@ -94,6 +74,7 @@ import type {ApiResult} from "~/api"; |
|
|
import {useServerRequest} from "~/composables/useServerRequest"; |
|
|
import {useServerRequest} from "~/composables/useServerRequest"; |
|
|
import type {Goods} from "~/api/shop/goods/model"; |
|
|
import type {Goods} from "~/api/shop/goods/model"; |
|
|
import Breadcrumb from "~/components/Breadcrumb.vue"; |
|
|
import Breadcrumb from "~/components/Breadcrumb.vue"; |
|
|
|
|
|
import type {Navigation} from "~/api/cms/navigation/model"; |
|
|
|
|
|
|
|
|
const route = useRoute(); |
|
|
const route = useRoute(); |
|
|
const { query, params } = route; |
|
|
const { query, params } = route; |
|
@ -103,17 +84,26 @@ const rate = ref(4); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 页面信息 |
|
|
// 页面信息 |
|
|
const form = ref<Goods | any>(); |
|
|
|
|
|
|
|
|
const form = ref<Navigation>(); |
|
|
// 商品信息 |
|
|
// 商品信息 |
|
|
const goods = ref<Goods>(); |
|
|
const goods = ref<Goods>(); |
|
|
|
|
|
|
|
|
// 请求数据 |
|
|
|
|
|
|
|
|
// TODO 请求导航页面数据 |
|
|
|
|
|
const pathName = window.location.pathname; |
|
|
|
|
|
console.log(pathName) |
|
|
|
|
|
const split = pathName.split('/'); |
|
|
|
|
|
const { data: nav } = await useServerRequest<ApiResult<Navigation>>('/cms/navigation/getNavigationByPath',{ |
|
|
|
|
|
query: { |
|
|
|
|
|
path: pathName |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
if(nav.value?.data){ |
|
|
|
|
|
form.value = nav.value.data; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO 获取商品详情 |
|
|
const { data: info } = await useServerRequest<ApiResult<Goods>>('/shop/goods/' + productName) |
|
|
const { data: info } = await useServerRequest<ApiResult<Goods>>('/shop/goods/' + productName) |
|
|
goods.value = info.value?.data; |
|
|
goods.value = info.value?.data; |
|
|
// form.value.files = JSON.parse(form.value.files); |
|
|
|
|
|
// form.value.num = 1; |
|
|
|
|
|
// form.value.radio = '0' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleClick = (tab, event) => { |
|
|
const handleClick = (tab, event) => { |
|
|