Commit d11b162d authored by 周宏民's avatar 周宏民

pref: 演示引导页添加 介绍视频

parent ab364750
Pipeline #96581 passed with stages
This diff was suppressed by a .gitattributes entry.
/*
* @Title:
* @Author: hongmye
* @Date: 2025-03-28 11:18:55
*/
import React, { useState, useEffect, useRef } from 'react';
import { Modal } from 'antd';
import classNames from 'classnames';
import styles from './index.less';
const videoUrl = 'https://panda-water.cn/video/companyIntroduction.mp4';
const IframeContainer = props => {
const { loading, isVideoModal, setIsVideoModal } = props;
const videoRef = useRef(null);
const width = 1400;
useEffect(() => {
if (videoRef.current) {
if (isVideoModal) {
videoRef.current.paused && videoRef.current.play();
} else {
!videoRef.current.paused && videoRef.current.pause();
}
}
}, [isVideoModal]);
return (
<>
<Modal
style={{ top: '60px' }}
wrapClassName={classNames(styles.videoModal, 'demonstration_video_modal')}
title={null}
visible={isVideoModal}
open={isVideoModal}
footer={null}
width={width}
onCancel={() => {
setIsVideoModal(false);
}}
>
<video ref={videoRef} width={width} autoPlay="autoPlay" muted controls src={videoUrl} loop />
</Modal>
</>
);
};
export default IframeContainer;
:global {
.demonstration_video_modal {
.@{ant-prefix}-modal-content {
background: transparent;
}
.@{ant-prefix}-modal-body {
border-radius: 10px;
overflow: hidden;
padding: 0;
}
.@{ant-prefix}-modal-close {
top: -40px;
right: -40px;
color: #fff;
transition: all 0.2s;
}
.@{ant-prefix}-modal-close:hover {
color: #fff;
transform: scale(1.5);
transform-origin: center center;
}
}
}
\ No newline at end of file
...@@ -29,6 +29,7 @@ import Iframe from './components/Iframe'; ...@@ -29,6 +29,7 @@ import Iframe from './components/Iframe';
import RightItem from './components/Right'; import RightItem from './components/Right';
import BottomItem from './components/Bottom'; import BottomItem from './components/Bottom';
import { platformData } from './components/configData'; import { platformData } from './components/configData';
import VideoModal from './components/VideoModal';
const boxWidth = 1920; const boxWidth = 1920;
const boxHeight = 910; const boxHeight = 910;
...@@ -50,6 +51,7 @@ const Demonstration = props => { ...@@ -50,6 +51,7 @@ const Demonstration = props => {
const [projectConfig, setProjectConfig] = useState({}); // 项目案例是否可免密跳转 const [projectConfig, setProjectConfig] = useState({}); // 项目案例是否可免密跳转
const [showContent, setShowContent] = useState(false); const [showContent, setShowContent] = useState(false);
const [jumpLoading, setJumpLoading] = useState(false); const [jumpLoading, setJumpLoading] = useState(false);
const [isVideoModal, setIsVideoModal] = useState(false);
const [selectKey, setSelectKey] = useState('供水产品'); const [selectKey, setSelectKey] = useState('供水产品');
const [boxSize, setBoxSize] = useState({ const [boxSize, setBoxSize] = useState({
scale: 1, scale: 1,
...@@ -500,6 +502,10 @@ const Demonstration = props => { ...@@ -500,6 +502,10 @@ const Demonstration = props => {
const onendLoading = () => { const onendLoading = () => {
jumpProgressEnd(); jumpProgressEnd();
}; };
const onOpenVideo = () => {
// if (!productConfig?.['熊猫武汉研发中心']) return message.warning('该账号没有权限,请联系管理员');
setIsVideoModal(true);
};
const iframeItem = useMemo(() => { const iframeItem = useMemo(() => {
if (!linkUrl) return null; if (!linkUrl) return null;
return ( return (
...@@ -646,7 +652,7 @@ const Demonstration = props => { ...@@ -646,7 +652,7 @@ const Demonstration = props => {
<div className={styles.top_c_title}>熊猫智慧水务一体化解决方案</div> <div className={styles.top_c_title}>熊猫智慧水务一体化解决方案</div>
</div> </div>
<div className={styles.top_r}> <div className={styles.top_r}>
<div className={styles.top_r_text}>- 引领中国智慧水务 -</div> <div className={styles.top_r_text} onClick={onOpenVideo} />
</div> </div>
</div> </div>
...@@ -716,6 +722,7 @@ const Demonstration = props => { ...@@ -716,6 +722,7 @@ const Demonstration = props => {
</div> </div>
) : null} ) : null}
{iframeItem} {iframeItem}
<VideoModal isVideoModal={isVideoModal} setIsVideoModal={setIsVideoModal} />
</div> </div>
); );
}; };
......
...@@ -196,18 +196,20 @@ ...@@ -196,18 +196,20 @@
.top_r { .top_r {
width: 376px; width: 376px;
height: 35px; height: 35px;
display: flex; position: relative;
justify-content: flex-end;
.top_r_text { .top_r_text {
width: 281px; width: 218px;
height: 35px; height: 62px;
line-height: 35px; background: url('@{imgSrc}/武汉研发中心.png') no-repeat center center;
padding-left: 60px;
background: url('@{imgSrc}/引领中国智慧水务.png') no-repeat center center;
background-size: 100% 100%; background-size: 100% 100%;
font-size: 15px; cursor: pointer;
letter-spacing: 3px; position: absolute;
right: 42px;
top: -12px;
}
.top_r_text:active{
opacity: 0.8;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment