|
|
|
@ -8,7 +8,7 @@ import SwiperCore, { Autoplay, Navigation, Pagination } from 'swiper/core';
|
|
|
|
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
|
|
|
import 'swiper/swiper-bundle.min.css';
|
|
|
|
|
import 'swiper/swiper.min.css';
|
|
|
|
|
import { CURRENT_HOST } from "../Common/HostUrl";
|
|
|
|
|
import { CURRENT_HOST, NOTICEPNG } from "../Common/HostUrl";
|
|
|
|
|
import { NoticeGroup, TabsExampleState } from "./NoticeGroup";
|
|
|
|
|
SwiperCore.use([Autoplay, Pagination, Navigation]);
|
|
|
|
|
export class NoticeBody extends React.Component<NoticeGroup, TabsExampleState, {}>
|
|
|
|
@ -18,15 +18,16 @@ export class NoticeBody extends React.Component<NoticeGroup, TabsExampleState, {
|
|
|
|
|
animate: true,
|
|
|
|
|
navbarTabId: 1,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render()
|
|
|
|
|
{
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{
|
|
|
|
|
<div id="Notice">
|
|
|
|
|
<div><h3 style={{ margin: "0 0 5px 0", textAlign: "center" }}>通知公告</h3></div>
|
|
|
|
|
<div style={{ width: "650px", height: "400px" }}>
|
|
|
|
|
<div>
|
|
|
|
|
<img className="backGround" src={NOTICEPNG} alt="" />
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ width: "650px", height: "300px" }}>
|
|
|
|
|
<Tabs id="TabsExample" selectedTabId={this.state.navbarTabId} animate
|
|
|
|
|
key="vertical"
|
|
|
|
|
renderActiveTabPanelOnly
|
|
|
|
@ -49,50 +50,65 @@ export class NoticeBody extends React.Component<NoticeGroup, TabsExampleState, {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 通知
|
|
|
|
|
const Notice: FC<NoticeGroup> = observer(({ data }) =>
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
const Message: FC<NoticeGroup> = observer(({ data }) =>
|
|
|
|
|
<div style={{ height: "100%" }}>
|
|
|
|
|
<div >
|
|
|
|
|
<div>
|
|
|
|
|
<div style={{ marginLeft: "15px" }}>
|
|
|
|
|
{
|
|
|
|
|
data.map((data) =>
|
|
|
|
|
{
|
|
|
|
|
// 纯文字
|
|
|
|
|
if (Number(data.notice_type) == 1)
|
|
|
|
|
{
|
|
|
|
|
return Number(data.notice_type) == 1 && <div style={{ marginTop: "10px", whiteSpace: "pre-wrap" }}>{data.notice_content}</div>;
|
|
|
|
|
return <div>
|
|
|
|
|
<div className="update">
|
|
|
|
|
<h2 style={{ fontWeight: "600", }}>功能更新</h2>
|
|
|
|
|
<span className="date">{data.update_date}</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{ marginTop: "10px", whiteSpace: "pre-wrap" }}>{data.notice_content}</div>
|
|
|
|
|
</div>;
|
|
|
|
|
}
|
|
|
|
|
// 纯图片
|
|
|
|
|
if (Number(data.notice_type) == 2)
|
|
|
|
|
{
|
|
|
|
|
let Img = JSON.parse(data.notice_content);
|
|
|
|
|
let img = JSON.parse(data.notice_content);
|
|
|
|
|
let imgstr = [];
|
|
|
|
|
for (let Imginfo of Object.keys(Img))
|
|
|
|
|
for (let Imginfo of Object.keys(img))
|
|
|
|
|
{
|
|
|
|
|
imgstr.push(<Zmage src={`${CURRENT_HOST}/${Img[Imginfo]}`} alt="" />);
|
|
|
|
|
imgstr.push(<Zmage src={`${CURRENT_HOST}/${img[Imginfo]}`} alt="" />);
|
|
|
|
|
}
|
|
|
|
|
return imgstr;
|
|
|
|
|
return <div>
|
|
|
|
|
<div className="update">
|
|
|
|
|
<h2 style={{ fontWeight: "600" }}>功能更新</h2>
|
|
|
|
|
<span className="date">{data.update_date}</span>
|
|
|
|
|
</div>{imgstr}
|
|
|
|
|
</div>;
|
|
|
|
|
}
|
|
|
|
|
// 图文模式
|
|
|
|
|
if (Number(data.notice_type) == 3)
|
|
|
|
|
{
|
|
|
|
|
return <div className="Markdown"><ReactMarkdown remarkPlugins={[gfm]}>{data.notice_content}</ReactMarkdown></div>;
|
|
|
|
|
return <div className="Markdown">
|
|
|
|
|
<div className="update">
|
|
|
|
|
<h2 style={{ fontWeight: "600" }}>功能更新</h2>
|
|
|
|
|
<span className="date">{data.update_date}</span>
|
|
|
|
|
</div><ReactMarkdown remarkPlugins={[gfm]}>{data.notice_content}</ReactMarkdown>
|
|
|
|
|
</div>;
|
|
|
|
|
}
|
|
|
|
|
// 轮播图
|
|
|
|
|
if (Number(data.notice_type) == 4)
|
|
|
|
|
{
|
|
|
|
|
let Swipers = JSON.parse(data.notice_content);
|
|
|
|
|
let swipers = JSON.parse(data.notice_content);
|
|
|
|
|
let swiper = [];
|
|
|
|
|
for (let Swiperinfo of Object.keys(Swipers))
|
|
|
|
|
for (let Swiperinfo of Object.keys(swipers))
|
|
|
|
|
{
|
|
|
|
|
swiper.push(<SwiperSlide className="NoticeImg">
|
|
|
|
|
<Zmage zoomOptions={{ maxZoom: 5, minZoom: 1 }} style={{ maxWidth: '100%', minWidth: '0' }} src={`${CURRENT_HOST}/${Swipers[Swiperinfo]}`} alt="" />
|
|
|
|
|
<Zmage zoomOptions={{ maxZoom: 5, minZoom: 1 }} style={{ maxWidth: '100%', minWidth: '0' }} src={`${CURRENT_HOST}/${swipers[Swiperinfo]}`} alt="" />
|
|
|
|
|
</SwiperSlide>);
|
|
|
|
|
}
|
|
|
|
|
return <Swiper
|
|
|
|
|
return <div>
|
|
|
|
|
<div className="update">
|
|
|
|
|
<h2 style={{ fontWeight: "600" }}>功能更新</h2>
|
|
|
|
|
<span className="date">{data.update_date}</span>
|
|
|
|
|
</div><Swiper
|
|
|
|
|
spaceBetween={50}
|
|
|
|
|
slidesPerView={1}
|
|
|
|
|
pagination={{
|
|
|
|
@ -102,8 +118,7 @@ const Message: FC<NoticeGroup> = observer(({ data }) =>
|
|
|
|
|
scrollbar={{ draggable: true }}
|
|
|
|
|
>
|
|
|
|
|
{swiper}
|
|
|
|
|
</Swiper>;
|
|
|
|
|
|
|
|
|
|
</Swiper></div>;
|
|
|
|
|
}
|
|
|
|
|
//视频
|
|
|
|
|
if (Number(data.notice_type) == 5)
|
|
|
|
@ -114,7 +129,11 @@ const Message: FC<NoticeGroup> = observer(({ data }) =>
|
|
|
|
|
{
|
|
|
|
|
video.push(<video style={{ width: "100%" }} controls src={`${Video[VideoInfo]}`}></video>);
|
|
|
|
|
}
|
|
|
|
|
return video;
|
|
|
|
|
return <div>
|
|
|
|
|
<div className="update">
|
|
|
|
|
<h2 style={{ fontWeight: "600" }}>功能更新</h2>
|
|
|
|
|
<span className="date">{data.update_date}</span>
|
|
|
|
|
</div>{video}</div>;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|