Skip to content

Commit

Permalink
优化导航,制作首页功能
Browse files Browse the repository at this point in the history
  • Loading branch information
a395027720 committed Aug 5, 2019
1 parent 7e2c7b3 commit 22395bc
Show file tree
Hide file tree
Showing 24 changed files with 669 additions and 26 deletions.
1 change: 1 addition & 0 deletions config/paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ module.exports = {
servedPath: getServedPath(resolveApp('package.json')),
stylesPath: resolveApp('src/styles'),
utilsPath: resolveApp('src/utils'),
imagesPath: resolveApp('src/static/images'),
};


Expand Down
3 changes: 2 additions & 1 deletion config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ module.exports = function(webpackEnv) {
'react-native': 'react-native-web',
'@': paths.appSrc,
'utils':paths.utilsPath,
'styles':paths.stylesPath
'styles':paths.stylesPath,
'images':paths.imagesPath
},
plugins: [
// Adds support for installing with Plug'n'Play, leading to faster installs and adding
Expand Down
8 changes: 6 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />

<meta name="format-detection" content="telephone=no">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="description" content="【火花思维】-儿童数理思维启蒙和专注力训练在线教育平台,资深教研教师团队,100%原创课程寓教于乐,提升孩子数理逻辑等成长关键能力。" />
<meta name="keywords" content="注意力训练,儿童专注力训练" />

<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand All @@ -20,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>儿童数理思维在线教育平台-火花思维</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from "react";
import "styles/iconfont/iconfont.css";
import "styles/common.scss";
import "styles/reset.css";

import "./utils/prototype"
export default class App extends Component {
componentDidMount() {}
render() {
Expand Down
41 changes: 36 additions & 5 deletions src/components/footer/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,42 @@
import React, { Component } from 'react'

import React, { Component } from "react";
import "./index.scss";
import code from "images/code.png"
export default class Footer extends Component {
render() {
return (
<div>
Footer
<div className="footer">
<div className="w flex-row">
<div className="footer-left flex-4">
<ul className="flex-column">
<li>首页</li>
<li>课程体系</li>
<li>AI课</li>
<li>火花知识</li>
<li>常见问题</li>
<li>软件下载</li>
<li>关于我们</li>
</ul>
</div>
<div className="footer-center flex-5 flex-column">
<p>客服:10109909</p>
<p style={{ marginTop: 15 }}>工作时间:周一至周日9:00-21:00</p>
<div className="zhaopin">
<span>教师招聘 - [email protected]</span>
</div>
<div className="hezuo">
<span>商务合作 - [email protected]</span>
</div>
</div>
<div className="footer-right flex-3">
<p>微信服务号</p>
<img className="code-img" src={code} alt=""/>
</div>
</div>
<div className="footer-bottom flex-column align-items-center">
<p>Copyright © 2019 北京心更远科技发展有限公司 版权所有京ICP备16037757号-2</p>
<p>京公网安备 11010502036019号网络文化经营许可证京网文[2018]7814-639号</p>
</div>
</div>
)
);
}
}
44 changes: 44 additions & 0 deletions src/components/footer/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
.footer {
background-color: #3c3c3c;
color: #fff;
font-size: 16px;
padding: 50px 0 0 0;
.footer-left {
ul {
li {
height: 40px;
line-height: 40px;
}
}
}
.footer-center {
.zhaopin,
.hezuo {
margin-top: 10px;
span {
display: inline-block;
background-color: #2f2f2f;
height: 40px;
line-height: 40px;
padding: 0 20px;
border-radius: 20px;
}
}

}
.footer-right{
.code-img{
width: 258px;
height: 258px;
margin-top: 20px;
}

}
.footer-bottom{
font-size: 13px;
line-height: 25px;
background-color: #2f2f2f;
padding: 30px 0 30px 0;
color: #cdcdcd;
}
}
8 changes: 6 additions & 2 deletions src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export default class Header extends Component {

componentDidMount() {
window.addEventListener("scroll", this.handleWindowScroll.bind(this));
let activeTab = tabs.findIndex(
item => item.path === window.location.pathname
);
this.setState({ activeTab });
}
componentWillUnmount() {
window.removeEventListener("scroll", this.handleWindowScroll.bind(this));
Expand Down Expand Up @@ -69,11 +73,11 @@ export default class Header extends Component {
const tabs = [
{
title: "首页",
path: "/"
path: "/home"
},
{
title: "课程体系",
path: "/system"
path: "/course"
},
{
title: "AI课",
Expand Down
3 changes: 3 additions & 0 deletions src/pages/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export default class Common extends Component {
dhzxShow: false,
};




render() {
return (
<div className="common">
Expand Down
2 changes: 1 addition & 1 deletion src/pages/common/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.common {
position: relative;

background-color: #e7ecf3;
.float-btns {
position: fixed;
right: 0;
Expand Down
13 changes: 13 additions & 0 deletions src/pages/course/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { Component } from 'react'
import "./index.scss"
export default class Course extends Component {
render() {
return (
<div className="course">
<div className="banner-image">

</div>
</div>
)
}
}
12 changes: 12 additions & 0 deletions src/pages/course/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.course{
position: relative;

background-color: red;
.banner-image{
width: 100%;
height: 416px;
background: url(https://asset.txqn.huohua.cn/image/113ae1e6-3ac6-44cb-8157-b424558b05f5.jpg) no-repeat;
background-position: center;
background-size: cover;
}
}
Loading

0 comments on commit 22395bc

Please sign in to comment.