提交 2850f52b 作者: ZhangLingKun

功能:商品详情页面

上级 4db91bc7
流水线 #7452 已通过 于阶段
in 4 分 53 秒
...@@ -91,7 +91,7 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => { ...@@ -91,7 +91,7 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => {
useEffect(() => { useEffect(() => {
if (!detail) return; if (!detail) return;
getLowerSpec(); getLowerSpec();
// console.log('detail --->', detail); console.log('detail --->', detail);
}, [detail]); }, [detail]);
return ( return (
<ProductHeadWrap> <ProductHeadWrap>
...@@ -136,8 +136,10 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => { ...@@ -136,8 +136,10 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => {
</div> </div>
</div> </div>
{detail?.specAttrList?.map((i, j) => ( {detail?.specAttrList?.map((i, j) => (
<div className="content-item flex-start" key={j}> <div className="content-item flex-start align-start" key={j}>
<div className="item-label">{i.specName}</div> <div className="item-label two-line-ellipsis" title={i.specName}>
{i.specName}
</div>
<div className="item-content flex-start "> <div className="item-content flex-start ">
{i.specValuesList?.map((n, m) => ( {i.specValuesList?.map((n, m) => (
<div <div
...@@ -146,6 +148,7 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => { ...@@ -146,6 +148,7 @@ const ProductHeadView: React.FC<{ detail: DetailType }> = ({ detail }) => {
}`} }`}
key={m} key={m}
onClick={() => handleSelect(j, m)} onClick={() => handleSelect(j, m)}
title={n.specName}
> >
{n.specName} {n.specName}
</div> </div>
...@@ -229,7 +232,7 @@ const ProductHeadWrap = styled.div` ...@@ -229,7 +232,7 @@ const ProductHeadWrap = styled.div`
margin-bottom: 1rem; margin-bottom: 1rem;
align-items: baseline; align-items: baseline;
.price-label { .price-label {
width: 2rem; width: 2.5rem;
color: #999999; color: #999999;
text-align: justify; text-align: justify;
text-align-last: justify; text-align-last: justify;
...@@ -248,14 +251,16 @@ const ProductHeadWrap = styled.div` ...@@ -248,14 +251,16 @@ const ProductHeadWrap = styled.div`
.content-item { .content-item {
margin-bottom: 1rem; margin-bottom: 1rem;
padding: 0 0.8rem; padding: 0 0.8rem;
//flex-wrap: nowrap;
.item-label { .item-label {
width: 2rem; width: 2.5rem;
color: #999999; color: #999999;
text-align: justify; text-align: justify;
text-align-last: justify; text-align-last: justify;
margin-right: 1rem; margin-right: 1rem;
} }
.item-content { .item-content {
width: calc(100% - 3.5rem);
.content-address { .content-address {
font-size: 12px; font-size: 12px;
&:first-child { &:first-child {
...@@ -270,7 +275,7 @@ const ProductHeadWrap = styled.div` ...@@ -270,7 +275,7 @@ const ProductHeadWrap = styled.div`
} }
} }
.content-spec { .content-spec {
//min-width: 4rem; //min-width: max-content;
height: 2rem; height: 2rem;
background: #f2f2f2; background: #f2f2f2;
border-radius: 0.08rem; border-radius: 0.08rem;
...@@ -280,8 +285,9 @@ const ProductHeadWrap = styled.div` ...@@ -280,8 +285,9 @@ const ProductHeadWrap = styled.div`
box-sizing: border-box; box-sizing: border-box;
padding: 0 1rem; padding: 0 1rem;
border: 0.04rem solid #f2f2f2; border: 0.04rem solid #f2f2f2;
&:not(:last-child) { margin: 0 0.5rem 0.5rem 0;
margin-right: 0.5rem; &:last-child {
margin-right: 0;
} }
} }
.spec-active { .spec-active {
......
import React, { useEffect } from 'react'; import React from 'react';
import { PhoneOutlined, ShopOutlined } from '@ant-design/icons'; import { PhoneOutlined, ShopOutlined } from '@ant-design/icons';
import { Rate } from 'antd'; import { Rate } from 'antd';
import styled from 'styled-components'; import styled from 'styled-components';
...@@ -14,9 +14,6 @@ type StoreType = InterDataType<GetCompanyInfoByBUId>; ...@@ -14,9 +14,6 @@ type StoreType = InterDataType<GetCompanyInfoByBUId>;
const ProductStoreView: React.FC<{ detail: DetailType; store: StoreType }> = ({ const ProductStoreView: React.FC<{ detail: DetailType; store: StoreType }> = ({
store, store,
}) => { }) => {
useEffect(() => {
console.log('store --->', store);
}, []);
return ( return (
<ProductStoreWrap> <ProductStoreWrap>
<div className="store-card flex-start"> <div className="store-card flex-start">
...@@ -42,7 +39,7 @@ const ProductStoreView: React.FC<{ detail: DetailType; store: StoreType }> = ({ ...@@ -42,7 +39,7 @@ const ProductStoreView: React.FC<{ detail: DetailType; store: StoreType }> = ({
</div> </div>
<div className="store-item flex-start"> <div className="store-item flex-start">
<div className="item-label">电话:</div> <div className="item-label">电话:</div>
<div className="item-value">{store?.phoneNum}</div> <div className="item-value">{store?.phoneNum || '18626051369'}</div>
</div> </div>
<div className="store-action flex-start"> <div className="store-action flex-start">
<div className="action-item flex-start"> <div className="action-item flex-start">
...@@ -66,7 +63,8 @@ export default ProductStoreView; ...@@ -66,7 +63,8 @@ export default ProductStoreView;
const ProductStoreWrap = styled.div` const ProductStoreWrap = styled.div`
position: relative; position: relative;
width: calc((100% - 0.83rem) / 10 * 2.5); width: calc((100% - 0.83rem) / 10 * 2.5);
min-height: 28rem; min-height: 18rem;
//height: 100%;
background: #ffffff; background: #ffffff;
border: 0.04rem solid #e3e3e3; border: 0.04rem solid #e3e3e3;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -85,7 +85,8 @@ const ProductSwiperView: React.FC<{ ...@@ -85,7 +85,8 @@ const ProductSwiperView: React.FC<{
onSwiper={setThumbsSwiper} onSwiper={setThumbsSwiper}
loop={true} loop={true}
spaceBetween={10} spaceBetween={10}
slidesPerView={5} slidesPerView={list?.length > 5 ? 5 : list?.length}
slidesPerGroupAuto={true}
freeMode={true} freeMode={true}
watchSlidesProgress={true} watchSlidesProgress={true}
modules={[FreeMode, Navigation, Thumbs]} modules={[FreeMode, Navigation, Thumbs]}
......
...@@ -61,7 +61,7 @@ const MallProductView: React.FC<{ ...@@ -61,7 +61,7 @@ const MallProductView: React.FC<{
<ProductWrap> <ProductWrap>
{/* 面包屑 */} {/* 面包屑 */}
<BreadcrumbView /> <BreadcrumbView />
<div className="flex-start"> <div className="flex-start align-start">
<ProductHeadView detail={productDetail} /> <ProductHeadView detail={productDetail} />
<ProductStoreView detail={productDetail} store={storeDetail} /> <ProductStoreView detail={productDetail} store={storeDetail} />
</div> </div>
......
...@@ -36,6 +36,7 @@ export const ProductWrap = styled.div` ...@@ -36,6 +36,7 @@ export const ProductWrap = styled.div`
.product-content { .product-content {
position: relative; position: relative;
width: 100%; width: 100%;
margin-bottom: 3.5rem;
.content-html { .content-html {
width: 100%; width: 100%;
img { img {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论