Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .umirc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export default {
dynamicImport: true,
title: 'umi-ts',
dll: true,
// routes: {
// exclude: [],
// },
routes: {
exclude: [/models/, /service/],
},
// hardSource: true,
},
],
],
history: 'hash',
cssLoaderOptions: {},
alias: {
component: path.resolve(__dirname, './src/component')
component: path.resolve(__dirname, './src/component'),
},
chainWebpack(config, { webpack }) {
// config.plugin('analyzer').use(
Expand Down
6 changes: 6 additions & 0 deletions src/assets/css/common/index.less
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
@header-nav-color: #40aea8;
@footer-border-color: #40aea8;
@theme-color: #40aea8;

p {
margin: 0;
line-height: 1;
}
Binary file added src/assets/images/home/dlbg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/home/ep.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/images/home/qr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
104 changes: 61 additions & 43 deletions src/component/common/BasicHeader/index.less
Original file line number Diff line number Diff line change
@@ -1,52 +1,70 @@
@import '../../../assets/css/common/index';
.cr-header {
.header-box {
position: fixed;
width: 100%;
display: flex;
height: 80px;
top: 0;
box-shadow: 0 0 16px 0 #ccc;
background-color: #ffffff;
z-index: 10;
:global {
.cr-logo {
flex-shrink: 0;
img {
width: 214px;
height: 50px;
margin: 10px 20px 20px;
.cr-header {
width: 1220px;
margin: 0 auto;
display: flex;
height: 80px;
.cr-logo {
flex-shrink: 0;

img {
width: 214px;
height: 50px;
margin: 10px 20px 20px;
}
}
}
.cr-nav {
flex: 1;
margin-bottom: 8px;
align-self: center;
overflow: hidden;
}
.cr-user {
flex-shrink: 0;
font-size: 20px;
line-height: 80px;
> span,
> i {
margin: 0 15px;

.cr-nav {
flex: 1;
margin-bottom: 8px;
align-self: center;
overflow: hidden;
}
> i {
font-weight: bold;

.cr-user {
flex-shrink: 0;
font-size: 20px;
line-height: 80px;

> span,
> i {
margin: 0 15px;
}

> i {
font-weight: bold;
}
}

.ant-menu-item {
font-size: 20px;
color: #000;
line-height: 68px;
margin: 0 10px;
border-bottom: 4px solid transparent;
}

.ant-menu-item-selected,
.ant-menu-item:hover {
border-bottom: 4px solid @header-nav-color;
color: #000000;
}

.ant-menu-item-active .ant-menu-item-selected {
border-bottom: 4px solid @header-nav-color;
}

.ant-menu-horizontal {
border: none;
}
}
.ant-menu-item {
font-size: 20px;
color: #000;
line-height: 68px;
margin: 0 10px;
border-bottom: 4px solid transparent;
}
.ant-menu-item-selected,
.ant-menu-item:hover {
border-bottom: 4px solid @header-nav-color;
color: #000000;
}
.ant-menu-item-active .ant-menu-item-selected {
border-bottom: 4px solid @header-nav-color;
}
.ant-menu-horizontal {
border: none;
}
}
}
68 changes: 35 additions & 33 deletions src/component/common/BasicHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,42 @@ export default class BasicHeader extends Component {
};

render() {
// const Nav = props => (
// <Menu onClick={props.handleClick} selectedKeys={[props.current]} mode="horizontal">
// <Menu.Item key="home">首页</Menu.Item>
// <Menu.Item key="project-center">项目中心</Menu.Item>
// <Menu.Item key="talent-plaza">人才广场</Menu.Item>
// </Menu>
// );
const Nav = props => (
<Menu onClick={props.handleClick} selectedKeys={[props.current]} mode="horizontal">
<Menu.Item key="home">首页</Menu.Item>
<Menu.Item key="project-center">项目中心</Menu.Item>
<Menu.Item key="talent-plaza">人才广场</Menu.Item>
</Menu>
);
return (
<header className={styles['cr-header']}>
<div className={'cr-logo'}>
<img src={logo} alt="" />
</div>
<div className={'cr-nav'}>
{/* <Nav handleClick={this.handleClick} current={this.state.current} /> */}
<Nav />
</div>
<div className={'cr-user'}>
<Search style={{ width: 30, height: 30, verticalAlign: 'middle' }} />
<span
onClick={() => {
router.push('/user');
}}
>
登录
</span>
<span
onClick={() => {
router.push('/user/register');
}}
>
注册
</span>
</div>
</header>
<div className={styles['header-box']}>
<header className={'cr-header'}>
<div className={'cr-logo'}>
<img src={logo} alt="" />
</div>
<div className={'cr-nav'}>
<Nav handleClick={this.handleClick} current={this.state.current} />
{/* <Nav /> */}
</div>
<div className={'cr-user'}>
<Search style={{ width: 30, height: 30, verticalAlign: 'middle' }} />
<span
onClick={() => {
router.push('/user');
}}
>
登录
</span>
<span
onClick={() => {
router.push('/user/register');
}}
>
注册
</span>
</div>
</header>
</div>
);
}
}
80 changes: 80 additions & 0 deletions src/component/home/Banner/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@import '../../../assets/css/common/index';
.home-banner {
height: 560px;
:global {
.home-banner-box {
position: relative;
height: 560px;
background-image: url('/src/assets/images/home/bg@2x-1.png');
.home-banner-box-img {
width: 100%;
height: 100%;
overflow: hidden;
text-align: left;
p {
font-size: 64px;
margin: 0;
line-height: 1;
}
p:nth-child(1) {
color: #4688f1;
margin-top: 100px;
}
p:nth-child(2) {
color: #000;
margin-top: 30px;
}
.banner-button-group {
margin-top: 60px;
button {
width: 150px;
height: 50px;
background-color: transparent;
font-size: 20px;
&:focus {
outline: none;
opacity: 0.6;
}
}
button:nth-child(1) {
border: 2px solid #000000;
color: #000000;
}
button:nth-child(2) {
border: 2px solid @theme-color;
color: @theme-color;
margin-left: 20px;
}
}
}
}

.ant-carousel .slick-dots {
bottom: 30px;
li {
margin: 0 6px;
button {
width: 10px;
height: 10px;
border-radius: 100%;
background-color: rgba(0, 0, 0, 0.2);
opacity: 1;
}

.slick-slide {
text-align: center;
height: 560px;
line-height: 160px;
background: #364d79;
overflow: hidden;
h3 {
color: #fff;
}
}
&.slick-active button {
background-color: rgba(70, 136, 241, 0.8);
}
}
}
}
}
92 changes: 92 additions & 0 deletions src/component/home/Banner/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import React from 'react';
import { Carousel } from 'antd';
import styles from './index.less';
import bgimg from 'assets/images/home/bg@2x-1.png';

export default function Banner(props) {
const onChange = (a = 0, b = 0, c = 0): void => {
console.log(a, b, c);
};
return (
<div className={styles['home-banner']}>
<Carousel afterChange={onChange}>
<div>
<div className={'home-banner-box'}>
<div
className={'home-banner-box-img'}
style={{
backgroundImage: `url(${bgimg})`,
backgroundSize: 'cover',
backgroundPosition: '56%',
}}
>
<p>近23万优秀开发者</p>
<p>您的专属云端开发团队</p>
<div className={'banner-button-group'}>
<button>新建项目</button>
<button>快速组队</button>
</div>
</div>
</div>
</div>
<div>
<div className={'home-banner-box'}>
<div
className={'home-banner-box-img'}
style={{
backgroundImage: `url(${bgimg})`,
backgroundSize: 'cover',
backgroundPosition: '56%',
}}
>
<p>近23万优秀开发者</p>
<p>您的专属云端开发团队</p>
<div className={'banner-button-group'}>
<button>新建项目</button>
<button>快速组队</button>
</div>
</div>
</div>
</div>
<div>
<div className={'home-banner-box'}>
<div
className={'home-banner-box-img'}
style={{
backgroundImage: `url(${bgimg})`,
backgroundSize: 'cover',
backgroundPosition: '56%',
}}
>
<p>近23万优秀开发者</p>
<p>您的专属云端开发团队</p>
<div className={'banner-button-group'}>
<button>新建项目</button>
<button>快速组队</button>
</div>
</div>
</div>
</div>
<div>
<div className={'home-banner-box'}>
<div
className={'home-banner-box-img'}
style={{
backgroundImage: `url(${bgimg})`,
backgroundSize: 'cover',
backgroundPosition: '56%',
}}
>
<p>近23万优秀开发者</p>
<p>您的专属云端开发团队</p>
<div className={'banner-button-group'}>
<button>新建项目</button>
<button>快速组队</button>
</div>
</div>
</div>
</div>
</Carousel>
</div>
);
}
Loading