Soleilw преди 2 месеца
родител
ревизия
ffae37bf1f

+ 1
- 1
dist/index.html Целия файл

@@ -8,6 +8,6 @@
</head>
<body>
<div id="root"></div>
<script src="/umi.377af00d.js"></script>
<script src="/umi.e7cc0b41.js"></script>
</body>
</html>

+ 0
- 1
dist/p__Partner__Home__index.29cff192.async.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 1
- 0
dist/p__Partner__Home__index.32ea0777.async.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 1
- 0
dist/p__ScienceTechnologyPark__Home__index.4725f189.async.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 0
- 1
dist/p__ScienceTechnologyPark__Home__index.5e50cf2e.async.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


dist/umi.e7cc0b41.js
Файловите разлики са ограничени, защото са твърде много
Целия файл


+ 15
- 9
src/components/Common/Title/index.tsx Целия файл

@@ -13,8 +13,9 @@ import { GetAdvertscheduleList } from '@/services/apis/advertschedule';
interface TitleProps {
title: any,
link: any,
hasMore: boolean
}
const TitleIndex: React.FC<TitleProps> = ({ title, link }) => {
const TitleIndex: React.FC<TitleProps> = ({ title, link, hasMore }) => {
return (
<>
<ConfigProvider
@@ -67,14 +68,19 @@ const TitleIndex: React.FC<TitleProps> = ({ title, link }) => {
}}>
</div>
</Flex>
<Flex justify='flex-end' style={{
}}>
<Button size='small' shape="round">
<Link to={{ pathname: link }} style={{ fontWeight: 'bold', color: '#000000' }}>
更多
</Link>
</Button>
</Flex>
{
hasMore && <>
<Flex justify='flex-end' style={{
}}>
<Button size='small' shape="round">
<Link to={{ pathname: link }} style={{ fontWeight: 'bold', color: '#000000' }}>
更多
</Link>
</Button>
</Flex>
</>
}

</Flex>
</ConfigProvider>


+ 108
- 0
src/components/Partner/Conversion/index.tsx Целия файл

@@ -0,0 +1,108 @@

import { useState, useEffect, useRef } from 'react';
import { ProList, PageContainer } from '@ant-design/pro-components';
import { ConfigProvider, Button, Flex, Input, Space, Tabs, Tooltip, Row, Col, Pagination, Tag, Image, Affix, Typography, Anchor } from 'antd';
import { SearchOutlined, LikeOutlined, ArrowRightOutlined, RightOutlined } from '@ant-design/icons';
import { useModel, connect, history, Link } from 'umi';
import { Imageprefix } from '@/constants/index'

import { GetSectionList, GetArticleList, GetSectionDetailByCode } from '@/services/apis/information';

import TitleIndex from '@/components/Common/Title';
import EmptyResult from '@/components/Common/EmptyResult'

interface TitleProps {
id: any,
}

const PartnerNews: React.FC<TitleProps> = ({ id }: any) => {
const [list, setList] = useState<object[]>([])
const [total, setTotal] = useState<number>(0)
const [page, setPage] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(7)


useEffect(() => {
if (id) {
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => {
setList(res.data.articles && res.data.articles.length > 0 ? res.data.articles : [])
setTotal(res.data.total)
})
}
}, [id]);



return (
<>
<ConfigProvider
theme={{
token: {
colorPrimary: '#19be6e',
},
components: {
Button: {
colorText: '#19be6e'
}
}
}}
>

<div style={{ minHeight: 300 }}>
<Space direction='vertical' size={10} style={{ width: '100%' }}>
{
list && list.length > 0 && list.map((item, index) => (
<>
<Link to={{ pathname: `/sciencetechnologypark/information/detail?id=${item.id}` }} target='_blank'>
<Flex justify='space-between' align='center' style={{ width: '100%', padding: '16px', color: '#000000', background: '#ffffff', borderRadius: 8, cursor: 'pointer' }}>
<Space size={20}>
<Image src={`${Imageprefix}${item.cover_img}`} width={100} height={100}></Image>
<h3>{item.title}</h3>
</Space>
<Space size={20}>
<div>
{item.updated_at}
</div>
<RightOutlined />
</Space>

</Flex>
</Link>
</>
))
}
{
!list || list.length == 0 && <Flex justify='center' align='center' style={{ padding: '16px', borderRadius: 8, cursor: 'pointer' }}>
<EmptyResult description="暂无数据" />
</Flex>
}
</Space>

<Flex justify='center' align='center' style={{ margin: '40px 0' }}>
<Pagination
hideOnSinglePage
total={total}
showTotal={(total) => `总共${total}条`}
current={page}
pageSize={pageSize}
pageSizeOptions={['12', '24', '36']}
onChange={(page, pageSize) => {
setPage(page)
setPageSize(pageSize)
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => {
setList(res.data.articles && res.data.articles.length > 0 ? res.data.articles : [])
setTotal(res.data.total)
})
}}
/>
</Flex>
</div>



</ConfigProvider >
</>
);
};

export default PartnerNews;

+ 66
- 0
src/components/Partner/Introduction/index.tsx Целия файл

@@ -0,0 +1,66 @@
import { useState, useEffect, useRef } from 'react';
import { useModel, connect, history, Link } from 'umi';
import { ConfigProvider, Button, Flex, Input, Space, Image, Select, Row, Col, Carousel, Tag, Card, Avatar, Typography } from 'antd';
import { Imageprefix } from '@/constants/index'

import he from 'he';

import { GetSectionList, GetArticleList, GetArticleDetail, GetSectionDetailByCode } from '@/services/apis/information';


import EmptyResult from '@/components/Common/EmptyResult'

interface TitleProps {
id: any,
}

const ScienceTechnologyParkHomeIntroduction: React.FC<TitleProps> = ({ id }: any) => {
const [detail, setDetail] = useState<object | null>(null)

useEffect(() => {
console.log(id)
if (id) {
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => {
if (res.data.articles && res.data.articles.length > 0) {
GetArticleDetail({ id: res.data.articles[0].id }).then(res => {
setDetail(res.data)
})
}
})
}
}, [id]);

return (
<>
<ConfigProvider
theme={{
token: {
colorPrimary: '#19be6e',
},
components: {
Button: {
colorText: '#19be6e'
}
}
}}
>
{
detail &&
<div style={{ minHeight: 300, background: '#f2f2f2', borderRadius: 8, padding: 20, lineHeight: 2 }}>
<div dangerouslySetInnerHTML={{ __html: he.decode(detail.content) }} />
</div>

}
{
!detail && < Flex justify='center' align='center' style={{ padding: '16px', borderRadius: 8, cursor: 'pointer' }}>
<EmptyResult description="暂无数据" />
</Flex>
}
</ConfigProvider >

</>
);
};

export default ScienceTechnologyParkHomeIntroduction;


+ 108
- 0
src/components/Partner/News/index.tsx Целия файл

@@ -0,0 +1,108 @@

import { useState, useEffect, useRef } from 'react';
import { ProList, PageContainer } from '@ant-design/pro-components';
import { ConfigProvider, Button, Flex, Input, Space, Tabs, Tooltip, Row, Col, Pagination, Tag, Image, Affix, Typography, Anchor } from 'antd';
import { SearchOutlined, LikeOutlined, ArrowRightOutlined, RightOutlined } from '@ant-design/icons';
import { useModel, connect, history, Link } from 'umi';
import { Imageprefix } from '@/constants/index'

import { GetSectionList, GetArticleList, GetSectionDetailByCode } from '@/services/apis/information';

import TitleIndex from '@/components/Common/Title';
import EmptyResult from '@/components/Common/EmptyResult'

interface TitleProps {
id: any,
}

const PartnerNews: React.FC<TitleProps> = ({ id }: any) => {
const [list, setList] = useState<object[]>([])
const [total, setTotal] = useState<number>(0)
const [page, setPage] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(7)


useEffect(() => {
if (id) {
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => {
setList(res.data.articles && res.data.articles.length > 0 ? res.data.articles : [])
setTotal(res.data.total)
})
}
}, [id]);



return (
<>
<ConfigProvider
theme={{
token: {
colorPrimary: '#19be6e',
},
components: {
Button: {
colorText: '#19be6e'
}
}
}}
>

<div style={{ minHeight: 300 }}>
<Space direction='vertical' size={10} style={{ width: '100%' }}>
{
list && list.length > 0 && list.map((item, index) => (
<>
<Link to={{ pathname: `/sciencetechnologypark/information/detail?id=${item.id}` }} target='_blank'>
<Flex justify='space-between' align='center' style={{ width: '100%', padding: '16px', color: '#000000', background: '#ffffff', borderRadius: 8, cursor: 'pointer' }}>
<Space size={20}>
<Image src={`${Imageprefix}${item.cover_img}`} width={100} height={100}></Image>
<h3>{item.title}</h3>
</Space>
<Space size={20}>
<div>
{item.updated_at}
</div>
<RightOutlined />
</Space>

</Flex>
</Link>
</>
))
}
{
!list || list.length == 0 && <Flex justify='center' align='center' style={{ padding: '16px', borderRadius: 8, cursor: 'pointer' }}>
<EmptyResult description="暂无数据" />
</Flex>
}
</Space>

<Flex justify='center' align='center' style={{ margin: '40px 0' }}>
<Pagination
hideOnSinglePage
total={total}
showTotal={(total) => `总共${total}条`}
current={page}
pageSize={pageSize}
pageSizeOptions={['12', '24', '36']}
onChange={(page, pageSize) => {
setPage(page)
setPageSize(pageSize)
GetArticleList({ page: 1, pagesize: 10, section_id: id }).then(res => {
setList(res.data.articles && res.data.articles.length > 0 ? res.data.articles : [])
setTotal(res.data.total)
})
}}
/>
</Flex>
</div>



</ConfigProvider >
</>
);
};

export default PartnerNews;

+ 25
- 51
src/pages/Partner/Home/index.tsx Целия файл

@@ -15,13 +15,17 @@ import { GetSectionList, GetArticleList, GetSectionDetailByCode } from '@/servic

import TitleIndex from '@/components/Common/Title';
import EmptyResult from '@/components/Common/EmptyResult'

import PartnerIntroduction from '@/components/Partner/Introduction'
import PartnerNews from '@/components/Partner/News'
import PartnerConversion from '@/components/Partner/Conversion'

const HomeNewJob: React.FC = () => {
const [list, setList] = useState<object[]>([])
const [total, setTotal] = useState<number>(0)
const [page, setPage] = useState<number>(1)
const [pageSize, setPageSize] = useState<number>(12)
const [introductionSectionId, setIntroductionSectionId] = useState<number>()
const [newsSectionId, setNewsSectionId] = useState<number>()
const [conversionSectionId, setConversionSectionId] = useState<number>()




const [selectedTags, setSelectedTags] = useState<string[]>(['']);
@@ -31,43 +35,27 @@ const HomeNewJob: React.FC = () => {
setList(res.data.childs ? res.data.childs : [])
if (res.data.childs && res.data.childs.length > 0) {
setSelectedTags(res.data.childs[0].name)
setIntroductionSectionId(res.data.childs[0].childs[0].id)
setNewsSectionId(res.data.childs[0].childs[1].id)
setConversionSectionId(res.data.childs[0].childs[2].id)
}
})
}, []);
const handleChange = (tag: object, checked: boolean) => {


const handleChange = async (tag: object, checked: boolean) => {
const nextSelectedTags = checked
? [tag.name]
: selectedTags.filter((t) => t !== tag.name);
setSelectedTags(nextSelectedTags);
if (tag.childs && tag.childs.length > 0) {
getIntroductionData(tag.childs)
getNewsData(tag.childs)
getConversionData(tag.childs)
console.log(tag.childs[0].id)
setIntroductionSectionId(tag.childs[0] && tag.childs[0].id ? tag.childs[0].id : 0)
setNewsSectionId(tag.childs[1] && tag.childs[1].id ? tag.childs[1].id : 0)
setConversionSectionId(tag.childs[2] && tag.childs[2].id ? tag.childs[2].id : 0)
}
};


const [introduction, setIntroduction] = useState<object | null>(null);

// const getIntroductionData = async (value) => {
// let res = await GetArticleList({ section_id: value[0].id })
// setIntroduction(res.data.articles && res.data.articles.length > 0 ? res.data.articles[0].content : null)
// };
// const [newsList, setNewsList] = useState<object | null>(null);

// const getNewsData = async (value) => {
// let res = await GetArticleList({ section_id: value[0].id })
// setNewsList(res.data.articles && res.data.articles.length > 0 ? res.data.articles[0].content : null)
// };

// const [conversionList, setConversionList] = useState<object | null>(null);

// const getConversionData = async (value) => {
// let res = await GetArticleList({ section_id: value[0].id })
// setConversionList(res.data.articles && res.data.articles.length > 0 ? res.data.articles[0].content : null)
// };
};



@@ -102,26 +90,12 @@ const HomeNewJob: React.FC = () => {
}
</Flex >
<PageContainer header={{ title: '' }} style={{ minHeight: 1000 }}>
<TitleIndex title="合作伙伴简介" link="/sciencetechnologypark/news"></TitleIndex>
{
introduction && <>
<div style={{ minHeight: 300, background: '#f2f2f2', borderRadius: 8, padding: 20, lineHeight: 2 }}>
<div dangerouslySetInnerHTML={{ __html: he.decode(introduction) }} />
</div>
</>
}

{
!introduction && <Flex justify='center' align='center' style={{ padding: '16px', borderRadius: 8, cursor: 'pointer' }}>
<EmptyResult description="暂无数据" />
</Flex>
}

<TitleIndex title="新闻栏目" link="/sciencetechnologypark/news"></TitleIndex>

<TitleIndex title="成果转化" link="/sciencetechnologypark/news"></TitleIndex>


<TitleIndex title="合作伙伴简介" link='' hasMore={false}></TitleIndex>
<PartnerIntroduction id={introductionSectionId}></PartnerIntroduction>
<TitleIndex title="新闻栏目" link='' hasMore={false}></TitleIndex>
<PartnerNews id={newsSectionId}></PartnerNews>
<TitleIndex title="成果转化" link='' hasMore={false}></TitleIndex>
<PartnerConversion id={conversionSectionId}></PartnerConversion>
</PageContainer>



Loading…
Отказ
Запис