diff --git a/src/components/CarouselPicture/CarouselPicture.js b/src/components/CarouselPicture/CarouselPicture.js new file mode 100644 index 0000000..e582054 --- /dev/null +++ b/src/components/CarouselPicture/CarouselPicture.js @@ -0,0 +1,61 @@ +import React, { Component, useState, memo, createRef } from "react"; +import styles from "./CarouselPicture.less"; +import leftIcon from "../../assets/icon_fanye_l@3x.png"; +import rightIcon from "../../assets/icon_fanye_r@3x.png"; + +import { Icon } from "antd"; + +const CarouselPicture = (props) => { + const ref = createRef(); + const { imgData, style = {} } = props; + const [translateX, setTranslateX] = useState(0); //每次偏移数值 + + /** + * 点击右侧按钮 + */ + const clickRightIcon = () => { + if ( + ref.current.scrollWidth < + Math.abs(translateX) + Math.abs(ref.current.offsetWidth) + ) { + //到最后一页时候需要停止点击按钮 + return; + } + setTranslateX(translateX - ref.current.offsetWidth); //每次滚动可见区域宽度 + }; + + /** + * 点击左侧按钮 + */ + const clickLeftIcon = () => { + if (translateX === 0) return; + setTranslateX(translateX + ref.current.offsetWidth); + }; + console.log("translateX", translateX); + console.log("ref", ref); + return ( +
+ + + + + + + +
+ ); +}; + +export default CarouselPicture; diff --git a/src/components/CarouselPicture/CarouselPicture.less b/src/components/CarouselPicture/CarouselPicture.less new file mode 100644 index 0000000..22cd17a --- /dev/null +++ b/src/components/CarouselPicture/CarouselPicture.less @@ -0,0 +1,77 @@ +.wrap_scrollImg { + padding: 0 10%; + text-align: centerf; + width: 100%; + height: 220px; + //background-color: #2C9806; + overflow: hidden; + position: relative; + display: flex; + flex-direction: row; + align-items: center; + &:hover { + span { + display: inline-block; + } + } + + span { + cursor: pointer; + z-index: 11; + position: absolute; + // display: none; + top: 0; + bottom: 0; + margin: auto; + transition: 0.2s; + + &:hover { + font-size: 22px; + } + } + .left_icon,.right_icon{ + img{ + width: 24px; + height: auto; + } + } + .left_icon { + left: 0; + } + + .right_icon { + right: 0; + } + + ul { + z-index: 10; + margin: 0 180px; + height: inherit; + white-space: nowrap; + position: absolute; + transition: all 0.5s ease-in 0s; //偏移的过度效果 + margin-right: -1%; //设置ul偏右-用来抵消li元素右边距1%导致的缺口 + + li { + height: 100%; + display: inline-block; + min-width: calc(24%); + width: calc(24%); + margin-right: 1%; //图片右边距 + overflow: hidden; + border-radius: 6px; + cursor: pointer; + + img { + transition: all 0.3s; + width: 100%; + height: 100%; + object-fit: cover; + + &:hover { + transform: scale(1.1); + } + } + } + } +} diff --git a/src/components/CarouselPicture/index.js b/src/components/CarouselPicture/index.js new file mode 100644 index 0000000..12b5a7e --- /dev/null +++ b/src/components/CarouselPicture/index.js @@ -0,0 +1,3 @@ +import CarouselPicture from './CarouselPicture'; + +export default CarouselPicture; diff --git a/src/components/CusBreadcrumb/CusBreadcrumb.js b/src/components/CusBreadcrumb/CusBreadcrumb.js new file mode 100644 index 0000000..ec12f6f --- /dev/null +++ b/src/components/CusBreadcrumb/CusBreadcrumb.js @@ -0,0 +1,24 @@ +import React from "react"; +import img1 from "../../assets/icon_home@3x.png"; +import { Breadcrumb } from "antd"; +import styles from "./CusBreadcrumb.less"; + +const CusBreadcrumb = (props) => { + const { breadcrumbMenus = [] } = props; + return ( +
+ + + + + {breadcrumbMenus?.map((item, index) => ( + + {item.text} + + ))} + +
+ ); +}; + +export default CusBreadcrumb; diff --git a/src/components/CusBreadcrumb/CusBreadcrumb.less b/src/components/CusBreadcrumb/CusBreadcrumb.less new file mode 100644 index 0000000..5fb3694 --- /dev/null +++ b/src/components/CusBreadcrumb/CusBreadcrumb.less @@ -0,0 +1,23 @@ +.root { + img { + width: 16px; + height: 16px; + } + :global { + .ant-breadcrumb > span:last-child a { + color: #2bb2a8; + } + .ant-breadcrumb-separator, + .ant-breadcrumb a, + .ant-breadcrumb-link { + font-family: Source Han Sans SC; + font-weight: 500; + font-size: 14px; + color: #8a8990; + line-height: 75px; + &:hover { + color: #2bb2a8; + } + } + } +} diff --git a/src/components/CusBreadcrumb/index.js b/src/components/CusBreadcrumb/index.js new file mode 100644 index 0000000..13cbd1c --- /dev/null +++ b/src/components/CusBreadcrumb/index.js @@ -0,0 +1,3 @@ +import CusBreadcrumb from './CusBreadcrumb'; + +export default CusBreadcrumb; diff --git a/src/components/GreenLine/GreenLine.js b/src/components/GreenLine/GreenLine.js new file mode 100644 index 0000000..3de71e0 --- /dev/null +++ b/src/components/GreenLine/GreenLine.js @@ -0,0 +1,13 @@ +import React from "react"; +import styles from "./GreenLine.less"; + +const GreenLine = (props) => { + const { width = 10, height = 6 } = props; + return ( +
+
+
+ ); +}; + +export default GreenLine; diff --git a/src/components/GreenLine/GreenLine.less b/src/components/GreenLine/GreenLine.less new file mode 100644 index 0000000..b022f57 --- /dev/null +++ b/src/components/GreenLine/GreenLine.less @@ -0,0 +1,8 @@ +.root { + margin: 40px 0; + .line { + // width: 10px; + // height: 6px; + background: #2bb2a8; + } +} diff --git a/src/components/GreenLine/index.js b/src/components/GreenLine/index.js new file mode 100644 index 0000000..870278b --- /dev/null +++ b/src/components/GreenLine/index.js @@ -0,0 +1,3 @@ +import GreenLine from './GreenLine'; + +export default GreenLine; diff --git a/src/components/Logo/Logo.js b/src/components/Logo/Logo.js deleted file mode 100644 index f2b1046..0000000 --- a/src/components/Logo/Logo.js +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react'; -import styles from './Logo.less'; - -const Logo = () => ( -
-
-
-); - -export default Logo; diff --git a/src/components/Logo/Logo.less b/src/components/Logo/Logo.less deleted file mode 100644 index 3470cc9..0000000 --- a/src/components/Logo/Logo.less +++ /dev/null @@ -1,17 +0,0 @@ -.logo { - height: 64px; - position: relative; - line-height: 64px; - padding-left: 24px; - -webkit-transition: all 0.3s; - transition: all 0.3s; - background: #002140; - overflow: hidden; - .img { - // width: 120px; - border-radius: 4px; - height: 31px; - background: rgba(255, 255, 255, 0.2); - margin: 16px 24px 16px 0; - } -} diff --git a/src/components/Logo/index.js b/src/components/Logo/index.js deleted file mode 100644 index 72acb33..0000000 --- a/src/components/Logo/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import Logo from './Logo'; - -export default Logo; diff --git a/src/components/PageHeaderInfo/PageHeaderInfo.js b/src/components/PageHeaderInfo/PageHeaderInfo.js new file mode 100644 index 0000000..149a3f9 --- /dev/null +++ b/src/components/PageHeaderInfo/PageHeaderInfo.js @@ -0,0 +1,20 @@ +import React from "react"; +import GreenLine from "../GreenLine"; +import styles from "./PageHeaderInfo.less"; + +const PageHeaderInfo = (props) => { + const { title = "", info = "", imgText = "", children } = props; + return ( +
+ {children} +
+
{title}
+
{info}
+
{imgText}
+ +
+
+ ); +}; + +export default PageHeaderInfo; diff --git a/src/components/PageHeaderInfo/PageHeaderInfo.less b/src/components/PageHeaderInfo/PageHeaderInfo.less new file mode 100644 index 0000000..8647182 --- /dev/null +++ b/src/components/PageHeaderInfo/PageHeaderInfo.less @@ -0,0 +1,23 @@ +.root { + background: #ffffff; + opacity: 0.96; + padding: 0 10%; + position: absolute; + top: 0; + left: 0; + right: 0; + .gywmBox { + padding: 40px 0; + position: relative; + .imgText { + position: absolute; + right: 10%; + bottom: -45px; + font-family: Source Han Sans SC; + font-weight: 500; + font-size: 117px; + color: #000000; + opacity: 0.1; + } + } +} diff --git a/src/components/PageHeaderInfo/index.js b/src/components/PageHeaderInfo/index.js new file mode 100644 index 0000000..efbea6f --- /dev/null +++ b/src/components/PageHeaderInfo/index.js @@ -0,0 +1,3 @@ +import PageHeaderInfo from './PageHeaderInfo'; + +export default PageHeaderInfo; diff --git a/src/global.less b/src/global.less index faee9c2..0c4861d 100644 --- a/src/global.less +++ b/src/global.less @@ -49,4 +49,29 @@ body { text-align: center; } +.common-title1 { + font-family: Source Han Sans SC; + font-weight: 500; + font-size: 50px; + color: #000000; + line-height: 75px; +} +.common-info { + font-family: Source Han Sans SC; + font-weight: 500; + font-size: 24px; + color: #8a8990; + line-height: 75px; +} +.fullImg { + width: 100vw; + height: auto; + object-fit: cover; +} +.ant-btn-background-ghost.ant-btn-primary, +.ant-btn-background-ghost.ant-btn-primary:hover, +.ant-btn-background-ghost.ant-btn-primary:focus { + color: #2bb2a8 !important; + border-color: #2bb2a8 !important; +} diff --git a/src/layouts/BaseLayout.js b/src/layouts/BaseLayout.js index 21d635c..c1978b9 100644 --- a/src/layouts/BaseLayout.js +++ b/src/layouts/BaseLayout.js @@ -82,13 +82,13 @@ class BaseLayout extends React.Component { const { children, location = {} } = this.props; const { pathname = "" } = location; const arr = ["/home"]; - + const isInherit = arr.includes(pathname); const { locale } = this.state; // const localeConfig = locale === "中文" ? zhCNConfig : enUSConfig; return ( - + {/* 顶栏 */}
@@ -115,7 +115,7 @@ class BaseLayout extends React.Component { ]} data={headMenuData} onClick={this.handleSideMenuClick} - isInherit={arr.includes(pathname)} + isInherit={isInherit} />
diff --git a/src/layouts/BaseLayout.less b/src/layouts/BaseLayout.less index efb018a..29fc641 100644 --- a/src/layouts/BaseLayout.less +++ b/src/layouts/BaseLayout.less @@ -4,11 +4,19 @@ display: block; :global { .ant-layout-content { - background-color: white; + min-height: calc(100vh - 602px); + background: #ffffff; + opacity: 0.96; + } + } +} +.root2 { + :global { + .ant-layout-content { + min-height: calc(100vh - 442px) !important; } } } - .header { height: 59px; height: auto; diff --git a/src/layouts/components/Footer/Footer.js b/src/layouts/components/Footer/Footer.js index 113a168..5087a79 100644 --- a/src/layouts/components/Footer/Footer.js +++ b/src/layouts/components/Footer/Footer.js @@ -21,7 +21,7 @@ const Footer = (props) => {
- +
diff --git a/src/layouts/components/TopMenu/TopMenu.js b/src/layouts/components/TopMenu/TopMenu.js index 6f71f3c..2db520d 100644 --- a/src/layouts/components/TopMenu/TopMenu.js +++ b/src/layouts/components/TopMenu/TopMenu.js @@ -1,6 +1,6 @@ import React from "react"; import PropTypes from "prop-types"; -import logoImg from "../../../assets/logo.png"; +import logoImg from "../../../assets/logo@3x.png"; import { Icon, Menu } from "antd"; import styles from "./TopMenu.less"; @@ -37,7 +37,7 @@ const TopMenu = (props) => { const { className, data, isInherit, ...otherProps } = props; return (
- + { + const locale = getLocale(); + const [certificateList, setCertificateList] = useState([ + { url: img1, name: "xxxxxxxxxxxxxxxxxxx CE证书" }, + { url: img1, name: "xxxxx CE证书" }, + { url: img1, name: " CE证书" }, + { url: img1, name: "xxxxxxxxxxxxxxxxxxx CE证书" }, + { url: img1, name: "xxxxxxxxxxxxxxxxxxx CE证书" }, + { url: img1, name: "xxxxxxxxxxxxxxxxxxx CE证书" }, + { url: img1, name: "xxxxxxxxxxxxxxxxxxx CE证书" }, + { url: img1, name: "xxxxxxxxxxxxxxxxxxx CE证书" }, + ]); + return ( +
+ +
+
{locale.slrz}
+
{locale.zszs}
+
+
+ {certificateList.map((item, index) => ( +
+ +
{item.name}
+
+ ))} +
+
+ ); +}; + +export default FullCertificate; diff --git a/src/pages/about-us/full-certificate/index.less b/src/pages/about-us/full-certificate/index.less new file mode 100644 index 0000000..112269f --- /dev/null +++ b/src/pages/about-us/full-certificate/index.less @@ -0,0 +1,43 @@ +.root { + padding: 0 10% 90px; + .titleBox { + text-align: center; + margin: 60px 0 60px; + .title { + font-family: Source Han Sans SC; + font-weight: bold; + font-size: 38px; + color: #000000; + line-height: 64px; + } + .info { + font-family: Source Han Sans SC; + font-weight: 400; + font-size: 26px; + color: #595a61; + line-height: 40px; + } + } + .listBox { + .item { + padding: 0px 36px 40px; + width: 20%; + display: inline-block; + vertical-align: top; + img { + width: 100%; + object-fit: cover; + height: auto; + margin-bottom: 30px; + } + .title { + font-family: Source Han Sans SC; + font-weight: bold; + font-size: 24px; + color: #131313; + line-height: 34px; + text-align: center; + } + } + } +} diff --git a/src/pages/about-us/index.js b/src/pages/about-us/index.js index fa16782..0b5e8fd 100644 --- a/src/pages/about-us/index.js +++ b/src/pages/about-us/index.js @@ -1,24 +1,80 @@ import React from "react"; +import { Divider, Button } from "antd"; + import { getLocale } from "../../utils"; import styles from "./index.less"; -import img1 from "../../assets/img_guanyu@3x.png"; -import img2 from "../../assets/img_jianjie@3x.png"; +import GreenLine from "../../components/GreenLine"; +import CusBreadcrumb from "../../components/CusBreadcrumb"; +import PageHeaderInfo from "../../components/PageHeaderInfo"; +import CarouselPicture from "../../components/CarouselPicture"; + +import img1 from "../../assets/img_guanyuwomen@3x.png"; +import img2 from "../../assets/img_zhengshu@3x.png"; const IndexPage = (props) => { - console.log(props); const locale = getLocale(); + const { history } = props; + const renderItem = ({ imgUrl, name, year, info }, index) => ( +
+
+ {name} +
+
+
{year}
+
{name}
+
{info}
+
+
+ ); + const imgList = [ + { + imgUrl: img2, + name: "xxxxCE证书", + year: "2023", + info: + "CE认证是指产品符合欧洲经济区相关法规和标准的认证,使得产品可以在欧洲市场自由流通销售", + render: (val) => renderItem(val), + }, + { + imgUrl: img2, + name: "xxxxCE证书", + render: (val) => renderItem(val), + }, + { + imgUrl: img2, + name: "xxxxCE证书", + render: (val) => renderItem(val), + }, + ]; return (

-
- +
+ + + +
-
{locale.gsjj1}
{locale.gsjj2}
+
{locale.gsjj31}
{locale.gsjj32}
@@ -26,6 +82,58 @@ const IndexPage = (props) => {
+
+
+
10
+
{locale.nhyjy}
+
+
+
16
+
{locale.hzqy}
+
+
+
300
+
{locale.qqkh}
+
+
+
3600
+
{locale.scjd}
+
+
+
+
+
{locale.qywh1}
+
{locale.qywh2}
+ +
+
+
{locale.qywh3}
+
{locale.qywh4}
+
+ +
+
{locale.qywh5}
+
{locale.qywh6}
+
+
+
+
+
+
{locale.yrzz}
+
{locale.yrzzInfo}
+ + + +

); diff --git a/src/pages/about-us/index.less b/src/pages/about-us/index.less index 29750fe..453ea74 100644 --- a/src/pages/about-us/index.less +++ b/src/pages/about-us/index.less @@ -1,15 +1,33 @@ .root { - .fullImg { - width: 100vw; - height: auto; - object-fit: cover; + .gssjBox { + padding: 57px; + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr; + font-family: Source Han Sans SC; + font-weight: 400; + font-size: 16px; + color: #595a61; + line-height: 40px; + > div { + text-align: center; + } + .title { + font-family: Source Han Sans SC; + font-weight: bold; + font-size: 60px; + color: #2bb2a8; + line-height: 81px; + } } .gsjjBox { position: relative; + background-image: url(../../assets/img_jianjie@3x.png); + background-size: cover; /* 确保图片覆盖整个元素 */ + background-position: center; /* 将图片居中显示 */ + padding-left: 10%; + padding-top: 94px; + padding-bottom: 71px; .gsjjText { - position: absolute; - bottom: 71px; - left: 10%; .title { font-family: Source Han Sans SC; font-weight: 500; @@ -38,4 +56,98 @@ } } } + .qywhBox { + position: relative; + background-image: url(../../assets/img_qiyewenhua@3x.png); + background-size: cover; /* 确保图片覆盖整个元素 */ + background-position: center; /* 将图片居中显示 */ + padding-left: 10%; + padding-top: 94px; + padding-bottom: 71px; + color: white; + .qywhText { + .title { + font-family: Source Han Sans SC; + font-weight: 500; + font-size: 48px; + line-height: 64px; + margin-bottom: 24px; + } + .secondTitle { + font-family: Source Han Sans SC; + font-weight: 400; + font-size: 22px; + line-height: 40px; + } + .info { + max-width: 40%; + font-family: Source Han Sans SC; + font-weight: 300; + font-size: 16px; + line-height: 30px; + :global { + .ant-divider-horizontal { + margin: 40px 0; + } + .ant-divider { + border: 1px solid rgba(255, 255, 255, 0.1); + } + } + // .item :not(:last-child) { + // } + .secondInfo { + opacity: 0.6; + font-size: 16px; + margin-top: 23px; + } + } + } + } + .ryzzBox { + background-image: url(../../assets/img_rongyuzizhi@3x.png); + background-size: cover; /* 确保图片覆盖整个元素 */ + background-position: center; /* 将图片居中显示 */ + padding: 120px 10% 50px; + + .btn { + display: block; + width: 245px; + height: 50px; + margin: 50px auto; + } + } +} +.carouselPictureBox { + display: grid; + grid-template-columns: auto 1fr; + .imgBox { + background: #f6f7fb; + border: 6px solid #ffffff; + } + .imgInfo { + background: white; + align-items: center; + padding: 40px 50px; + .title { + font-family: Source Han Sans SC; + font-weight: bold; + font-size: 24px; + color: #d80b2a; + line-height: 34px; + } + .year { + font-family: Source Han Sans SC; + font-weight: 300; + font-size: 16px; + color: #d80b2a; + line-height: 32px; + } + .info { + font-family: Source Han Sans SC; + font-weight: 300; + font-size: 16px; + color: #595a61; + line-height: 32px; + } + } } diff --git a/src/pages/product-center/index.js b/src/pages/product-center/index.js index 8d77f4b..f60a9fb 100644 --- a/src/pages/product-center/index.js +++ b/src/pages/product-center/index.js @@ -1,12 +1,33 @@ import styles from "./index.less"; -import { LocalConsumer } from "../../layouts/MyContext"; +import { getLocale } from "../../utils"; +import PageHeaderInfo from "../../components/PageHeaderInfo"; +import CusBreadcrumb from "../../components/CusBreadcrumb"; +import CarouselPicture from "../../components/CarouselPicture"; +import img1 from "../../assets/img_chanpinzhongxin@3x.png"; + import React, { useContext } from "react"; const IndexPage = (props) => { - console.log(props); + const locale = getLocale(); return ( -
-

Page index

+
+
+ + + + +
); };