Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. import { useState, useEffect, useRef } from 'react';
  2. import { ProList, PageContainer } from '@ant-design/pro-components';
  3. import { ConfigProvider, Button, Flex, Input, Space, Image, Select, Row, Col, Carousel, Card, List, Tag, Typography, Divider, Segmented, Anchor, Modal } from 'antd';
  4. import { SearchOutlined, EllipsisOutlined, ArrowRightOutlined, EnvironmentOutlined, CaretUpOutlined, RightOutlined } from '@ant-design/icons';
  5. import { useModel, connect, history, Link } from 'umi';
  6. import HomeNewJob from '@/components/Talent/Home/NewJob';
  7. import HomeUrgentJob from '@/components/Talent/Home/UrgentJob';
  8. import HomeCompany from '@/components/Talent/Home/Company';
  9. import HomeHighJob from '@/components/Talent/Home/HighJob';
  10. import HomeCampusJob from '@/components/Talent/Home/CampusJob';
  11. import HomeProbation from '@/components/Talent/Home/Probation';
  12. import HomeFamous from '@/components/Talent/Home/Famous';
  13. import TalentHomeBanner from '@/components/Talent/Home/Banner';
  14. import TalentHomeInformation from '@/components/Talent/Home/Information';
  15. import TalentHomeSearch from '@/components/Talent/Home/Search';
  16. import TalentHomeFair from '@/components/Talent/Home/Fair';
  17. import { PostJobSearch } from '@/services/apis/post';
  18. import LoginIndex from '@/components/Login/Index/index'
  19. const HomePage: React.FC = ({ dispatch, dictModel }: any) => {
  20. const [list, setList] = useState<object[]>([])
  21. const [total, setTotal] = useState<number>(0)
  22. const [page, setPage] = useState<number>(1)
  23. const [pageSize, setPageSize] = useState<number>(3)
  24. const [positionList, setPositionList] = useState<any[]>([]);
  25. const [loginHeight, setLoginHeight] = useState<number>(475) // 获取登录的高度
  26. const [keywordName, setKeywordName] = useState<string>('');
  27. const [positionType, setPositionType] = useState<string>('热门职位')
  28. // 切换登录
  29. const [type, setType] = useState<string>('jobseeker')
  30. const [openPreview, setOpenPreview] = useState(false);
  31. // useEffect(() => {
  32. // PostJobSearch({ page: 1, pagesize: 3, keyword: '文员' }).then(res => {
  33. // setList(res.data.jobs)
  34. // })
  35. // }, []);
  36. const getHeight = (value: number) => {
  37. setLoginHeight(value)
  38. }
  39. return (
  40. <>
  41. <ConfigProvider
  42. theme={{
  43. token: {
  44. colorPrimary: '#19be6e',
  45. },
  46. components: {
  47. Button: {
  48. colorText: '#19be6e'
  49. },
  50. Segmented: {
  51. trackBg: '#f0f0f0',
  52. itemSelectedColor: '#19be6e',
  53. trackPadding: -16
  54. }
  55. }
  56. }}
  57. >
  58. {/* 固定 */}
  59. <Anchor
  60. offsetTop={87}
  61. style={{ position: 'fixed', bottom: 87, background: '#f5f5f5', paddingRight: 20, borderRadius: 10, zIndex: 99 }}
  62. items={[
  63. { title: (<><h3>知名企业</h3></>), key: 4, href: '#fomaus' },
  64. { title: (<><h3>热门企业</h3></>), key: 2, href: '#company' },
  65. { title: (<><h3>热门职位</h3></>), key: 1, href: '#newjob' },
  66. { title: (<><h3>校园招聘</h3></>), key: 5, href: '#campusjob' },
  67. { title: (<><h3>招聘会</h3></>), key: 3, href: '#fair' },
  68. { title: (<><h3>见习基地</h3></>), key: 6, href: '#probation' },
  69. { title: (<><h3>关于我们</h3></>), key: 7, href: '#about' },
  70. ]}
  71. />
  72. <PageContainer header={{ title: ' ' }} style={{ background: '#ffffff' }}
  73. >
  74. <Row gutter={[16, 16]}>
  75. <Col span={localStorage.getItem('token') ? 24 : 18}>
  76. <Space direction='vertical' size={20} style={{ width: '100%' }}>
  77. <Flex justify='center' align='center'>
  78. <Space.Compact style={{ width: '80%' }}>
  79. <Input
  80. size='large'
  81. prefix={<SearchOutlined style={{ color: '#19be6e' }} />}
  82. placeholder="请输入关键词"
  83. allowClear
  84. value={keywordName}
  85. onChange={(e) => {
  86. setKeywordName(e.target.value)
  87. }}
  88. />
  89. <Link to={{ pathname: `/talent/search/job?keyword=${keywordName}` }}>
  90. <Button size='large' type='primary' style={{ width: 200 }}>搜索</Button>
  91. </Link>
  92. </Space.Compact>
  93. </Flex>
  94. <Flex justify='center' align='center'>
  95. <Space size={30} style={{ width: '70%' }}>
  96. <Link to={{ pathname: `/talent/search/job?keyword=客服` }} style={{ color: 'gray' }}>
  97. 客服
  98. </Link>
  99. <Link to={{ pathname: `/talent/search/job?keyword=会计` }} style={{ color: 'gray' }}>
  100. 会计
  101. </Link>
  102. <Link to={{ pathname: `/talent/search/job?keyword=销售` }} style={{ color: 'gray' }}>
  103. 销售
  104. </Link>
  105. <Link to={{ pathname: `/talent/search/job?keyword=策划` }} style={{ color: 'gray' }}>
  106. 策划
  107. </Link>
  108. <Link to={{ pathname: `/talent/search/job?keyword=外贸` }} style={{ color: 'gray' }}>
  109. 外贸
  110. </Link>
  111. <Link to={{ pathname: `/talent/search/job?keyword=文员` }} style={{ color: 'gray' }}>
  112. 文员
  113. </Link>
  114. <Link to={{ pathname: `/talent/search/job?keyword=行政` }} style={{ color: 'gray' }}>
  115. 行政
  116. </Link>
  117. </Space>
  118. </Flex>
  119. </Space>
  120. </Col>
  121. {
  122. !localStorage.getItem('token') && <>
  123. <Col span={2}>
  124. <Button size='large' type='primary' style={{ width: '100%' }} onClick={() => {
  125. setType('jobseeker')
  126. setOpenPreview(true)
  127. }}>登录</Button>
  128. </Col>
  129. <Col span={4}>
  130. <Button size='large' type='primary' style={{ width: '100%' }} onClick={() => {
  131. setType('company')
  132. setOpenPreview(true)
  133. }}>发布一个职位</Button>
  134. </Col>
  135. </>
  136. }
  137. </Row>
  138. </PageContainer>
  139. {/* 未登录的登录页 */}
  140. <Flex vertical justify='center' align='center' style={{ width: '100%', marginBottom: 40, position: 'relative' }}>
  141. <Flex vertical justify='center' align='center' style={{ background: '#ffffff', padding: '0 314px 40px', width: '100%' }}>
  142. <Flex justify='space-bewteen' style={{ width: '100%' }}>
  143. <Row gutter={[16, 16]}>
  144. <Col span={16}>
  145. <TalentHomeBanner getHeight={getHeight}></TalentHomeBanner>
  146. </Col>
  147. <Col span={8} style={{ height: loginHeight, width: '100%' }}>
  148. <Flex justify='flex-end' style={{ height: loginHeight, width: '100%' }}>
  149. <TalentHomeInformation height={loginHeight}></TalentHomeInformation>
  150. </Flex>
  151. </Col>
  152. </Row >
  153. </Flex>
  154. </Flex>
  155. {/* <div style={{ position: 'absolute', bottom: -50 }}>
  156. <Flex justify='center' align='center' style={{ background: '#19be6e', width: '100%', borderRadius: 8 }}>
  157. <Flex justify='space-between' align='center' style={{ borderRadius: 8, padding: '30px 20px' }}>
  158. <TalentHomeSearch></TalentHomeSearch>
  159. </Flex>
  160. </Flex>
  161. </div> */}
  162. </Flex>
  163. <PageContainer
  164. header={{ title: '', }}
  165. style={{ paddingTop: 0 }}
  166. >
  167. <Space direction='vertical' size={0} style={{ minHeight: 800 }}>
  168. <Flex justify='center' align='center' id='fomaus' style={{ width: '100%' }}>
  169. <HomeFamous></HomeFamous>
  170. </Flex>
  171. <Flex justify='center' align='center' id='company' style={{ width: '100%' }}>
  172. <HomeCompany></HomeCompany>
  173. </Flex>
  174. <Divider orientation="left" orientationMargin="0"><Typography.Title level={2}>职位推荐</Typography.Title></Divider>
  175. <Flex justify='center' align='center' style={{ width: '100%' }} id='newjob'>
  176. <Flex justify='space-between' align='center' style={{ width: '100%' }}>
  177. <Space direction='vertical' size='small' style={{ width: '100%' }} >
  178. <Segmented
  179. size='large'
  180. block
  181. value={positionType}
  182. options={['热门职位', '急招职位', '高薪职位']}
  183. onChange={(value) => {
  184. setPositionType(value)
  185. }}
  186. />
  187. <div style={{ paddingTop: 20 }}>
  188. {positionType == '热门职位' && <><HomeNewJob></HomeNewJob></>}
  189. {positionType == '急招职位' && <><HomeUrgentJob></HomeUrgentJob></>}
  190. {positionType == '高薪职位' && <><HomeHighJob></HomeHighJob></>}
  191. </div>
  192. </Space>
  193. </Flex>
  194. </Flex>
  195. <Flex justify='center' align='center' id='campusjob' style={{ width: '100%' }}>
  196. <HomeCampusJob></HomeCampusJob>
  197. </Flex>
  198. <Flex justify='center' align='center' id='fair' style={{ width: '100%' }}>
  199. <TalentHomeFair></TalentHomeFair>
  200. </Flex>
  201. <Flex justify='center' align='center' id='probation' style={{ width: '100%' }}>
  202. <HomeProbation></HomeProbation>
  203. </Flex>
  204. </Space>
  205. {/* <Space direction='vertical' size={60} style={{ marginTop: 40 }}>
  206. <div style={{ position: 'relative', width: '100%', height: 480, borderRadius: 8, background: '#00574B', zIndex: '99', }}>
  207. <div style={{ position: 'absolute', top: 0, right: 0, bottom: 0, left: 0, clipPath: 'circle(50% at right bottom)', backgroundImage: `url(${require('../../../../public/images/kcy.png')})`, backgroundSize: '100% 480px' }}>
  208. </div>
  209. <div style={{ position: 'absolute', top: '20%', right: '50%', bottom: 0, left: '10%', zIndex: 99 }}>
  210. <Space direction='vertical' style={{ width: '100%' }}>
  211. <Space>
  212. <Typography.Title level={5} style={{ color: '#ffffff' }}>关于</Typography.Title>
  213. <Typography.Title level={1} style={{ color: '#ffffff' }}>科创园</Typography.Title>
  214. </Space>
  215. <Typography.Paragraph ellipsis={{ rows: 5, expandable: true, symbol: '详情' }} style={{ color: '#ffffff' }}>
  216. 致力于提供一套简单方便、专业可靠、不限可能的数据可视化最佳实践。得益于丰富的业务场景和用户需求挑战,AntV 经历多年积累与不断打磨,已支撑整个阿里集团内外 20000+ 业务系统,通过了日均千万级 UV 产品的严苛考验。 我们正在基础图表,图分析,图编辑,地理空间可视化,智能可视化等各个可视化的领域耕耘,欢迎同路人一起前行。
  217. </Typography.Paragraph>
  218. <Button size='large' icon={<ArrowRightOutlined />} iconPosition='end'>进入科创园</Button>
  219. </Space>
  220. </div>
  221. </div>
  222. <Space direction='vertical' size='small' style={{ width: '100%' }} id='campusjob'>
  223. <Flex justify='space-between' align='center'>
  224. <Typography.Title level={2}>校园招聘</Typography.Title>
  225. <EllipsisOutlined style={{ color: '#19be6e', fontSize: '24px' }} />
  226. </Flex>
  227. <HomeCampusJob></HomeCampusJob>
  228. </Space>
  229. <Space direction='vertical' size='small' style={{ width: '100%' }} id='campusjob'>
  230. <Flex justify='space-between' align='center'>
  231. <Typography.Title level={2}>见习基地</Typography.Title>
  232. <EllipsisOutlined style={{ color: '#19be6e', fontSize: '24px' }} />
  233. </Flex>
  234. <HomeProbation></HomeProbation>
  235. </Space>
  236. </Space> */}
  237. </PageContainer >
  238. {/* 登录 */}
  239. <Modal
  240. open={openPreview}
  241. centered
  242. footer={null}
  243. onCancel={() => setOpenPreview(false)}
  244. destroyOnClose
  245. maskClosable={false}
  246. style={{ minWidth: 540 }}
  247. >
  248. <LoginIndex type={type} loginChangeStatus={(isLogin: boolean) => {
  249. console.log(isLogin)
  250. setOpenPreview(isLogin)
  251. }}></LoginIndex>
  252. </Modal>
  253. </ConfigProvider >
  254. </>
  255. );
  256. };
  257. export default connect(({ dictModel, openModel }: any) => ({
  258. dictModel
  259. }))(HomePage);