Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

资讯页面加分栏 #1

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 26 additions & 9 deletions app/components/header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const SUPPOER_LOCALES = [
class Header extends React.Component {
constructor(props, context) {
super(props, context);

this.state = {
mediaQuery: false,
collapse: true,
Expand Down Expand Up @@ -106,8 +105,8 @@ class Header extends React.Component {
collapseStyle = this.props.className + '-collapseShow';
}
}

// console.log(`selectedKeys: ${this.selectedKeys}`);
// console.log(`selectedKeys: ${this.selectedKeys}`);
return (
<div className={this.props.className}>
<div className='flex container'>
Expand Down Expand Up @@ -146,8 +145,13 @@ class Header extends React.Component {
<Menu.Item key='ecosystem-5'>{intl.get('MILL_MALL')}</Menu.Item>
</Menu.SubMenu>
<Menu.Item key='moore'>{intl.get('MOORE_ECONOMICS')}</Menu.Item>
<Menu.Item key='documents' >{intl.get('DOCUMENTS')}</Menu.Item>
<Menu.Item key='news' >{intl.get('NEWS')}</Menu.Item>
<Menu.SubMenu title={intl.get('NEWS')}>
<Menu.Item key='news-1'>{intl.get('UPCOMING_EVENTS')}</Menu.Item>
<Menu.Item key='news-2'>{intl.get('CURRENT_EVENTS')}</Menu.Item>
<Menu.Item key='news-3'>{intl.get('ETM_SOUND')}</Menu.Item>
</Menu.SubMenu>
<Menu.Item key='wallet'>{intl.get('WALLET')}</Menu.Item>
<Menu.Item key='documents'>{intl.get('DOCUMENTS')}</Menu.Item>
<Menu.SubMenu className='lang-select' title={this.getViewLang()}>
<Menu.Item key='lang-1'>{SUPPOER_LOCALES[0].name}</Menu.Item>
<Menu.Item key='lang-2'>{SUPPOER_LOCALES[1].name}</Menu.Item>
Expand All @@ -165,6 +169,7 @@ class Header extends React.Component {
);
}
getViewLang (){
console.log(global.select,'global.select头部')
let n=0;
for(let i=0;i<SUPPOER_LOCALES.length;i++){
if(SUPPOER_LOCALES[i].value === global.select){
Expand Down Expand Up @@ -212,6 +217,7 @@ class Header extends React.Component {
// console.log('current: ', this.selectedKeys);
}
onMenuItemClick(event) {
var that = this
console.log(this.props)
switch (event.key) {
case 'knownledge-1': {
Expand Down Expand Up @@ -267,18 +273,29 @@ class Header extends React.Component {
this.props.history.pushState(null, 'moore');
break;
}
case 'news' : {
case 'news-1' : {
this.props.history.pushState(null, 'articleList');
break;
}
case 'timeTower' : {
this.props.history.pushState(null, 'timeTower');
case 'news-2' : {
this.props.history.pushState(null, 'articleListTwo');
break;
}
case 'news-3' : {
this.props.history.pushState(null, 'articleListThree');
break;
}
case 'timeTower' : {
this.props.history.pushState(null, 'timeTower');
break;
}
case 'wallet' : {
window.open('https://wallet.entanmo.com')
break;
}
case 'documents': {
var pdfTemp = ((lang)=>{return '../../docs/ETM Science_'+lang+'.pdf'})(global.select);
window.open(pdfTemp);
document.getElementsByClassName("ant-menu-item").r
break;
}
case 'lang-1': {
Expand Down
6 changes: 4 additions & 2 deletions app/components/header/style/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.header .ant-menu-item, .ant-menu-submenu-title{padding: 0 13px;}

.header {
width: 100%;
min-height: 60px;
Expand Down Expand Up @@ -74,7 +76,7 @@
}
@media screen and (min-width: 992px) {
.header > .container {
padding: 0 88px;
padding: 0 80px;
}
.header-toggle {
display: none;
Expand All @@ -86,6 +88,6 @@
}
@media screen and (min-width: 1080px) {
.header > .container {
padding: 0 144px;
padding: 0 80px;
}
}
6 changes: 4 additions & 2 deletions app/components/header/style/index.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@import '../../../style/default.less';

@header: header;
.header .ant-menu-item, .ant-menu-submenu-title{padding: 0 13px;}

.@{header} {
width: 100%;
min-height: @header-height;
Expand Down Expand Up @@ -110,7 +112,7 @@
@media screen and (min-width: @lg) {
.@{header} {
> .container {
padding: 0 88px;
padding: 0 80px;
}

&-toggle {
Expand All @@ -127,7 +129,7 @@
@media screen and (min-width: @normal) {
.@{header} {
> .container {
padding: 0 144px;
padding: 0 80px;
}
}
}
2 changes: 1 addition & 1 deletion app/components/home-section7/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
align-items: center;
}
.home-section7-btn {
padding-bottom: 60px;
padding-bottom: 55px;
}
2 changes: 1 addition & 1 deletion app/components/home-section7/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}

&-btn {
padding-bottom: 60px;
padding-bottom: 55px;
}

}
11 changes: 9 additions & 2 deletions app/containers/article/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Breadcrumb } from 'antd';
import Header from '../../components/header';
import Footer from '../../components/footer';
import list from '../../markdown/js/list';
import listTwo from '../../markdown/js/listTwo';
import listThree from '../../markdown/js/listThree';
import './style/index.less'
class Article extends React.Component{
constructor(props){
Expand All @@ -22,6 +24,12 @@ import './style/index.less'
for(const [title,detail] of Object.entries(list)){
arr.push(title)
}
for(const [title,detail] of Object.entries(listTwo)){
arr.push(title)
}
for(const [title,detail] of Object.entries(listThree)){
arr.push(title)
}
if(url.match(reg) && arr.indexOf(path) !== -1){
this.state.path = path
} else {
Expand Down Expand Up @@ -60,8 +68,7 @@ import './style/index.less'
<div className="breadcrumb">
<Breadcrumb>
<Breadcrumb.Item>
<Link style={{ color:'#666'}} to={`articleList`}>文章列表</Link></Breadcrumb.Item>
<Breadcrumb.Item style={{ color:'#666'}} href="javascript:;">{this.state.path}</Breadcrumb.Item>
<Link style={{ color:'#666'}} to={`articleList`}>文章列表 ></Link></Breadcrumb.Item>
</Breadcrumb>
</div>
{
Expand Down
Binary file added app/containers/articleList/image/act12.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/containers/articleList/image/act25.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 35 additions & 27 deletions app/containers/articleList/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ArticleList extends React.Component {
for(const [title,detail] of Object.entries(AllMd)){
this.state.listAll.push(detail)
}
this.state.lists = this.state.listAll.slice(0,2);
this.state.lists = this.state.listAll.slice(0,3);
}
componentDidMount () {
const wrapper = document.querySelector('#wrapper');
Expand All @@ -41,7 +41,7 @@ class ArticleList extends React.Component {
this.setState({
loading: true
})
const len = Math.round(height / itemHeight + 1);
const len = Math.round(height / itemHeight + 2);
setTimeout(()=> {
this.setState({
lists : this.state.listAll.slice(0,len),
Expand All @@ -64,31 +64,39 @@ class ArticleList extends React.Component {
return (
<div className={this.props.className}>
<Header history={this.props.history} currentKey={this.currentKey}/>
<div className={`${this.props.className}-banner ${this.props.className}-banner-style1`}>
<p className={`${this.props.className}-banner-title`}>{intl.get('ARTICLE-TITLE')}</p>
<p className={`${this.props.className}-banner-desc`}
style={{
maxWidth: '528px'
}}>{intl.get('ARTICLE-DES')}</p>
</div>
<div id="wrapper" className="article-wrapper">
{ this.state.lists.map((item) =>
<div key={item.id} className="article-item">
<img className="pic" src={(()=>{return require("./image/"+ item.picName+".jpg")})()} />
<Link style={{color:'#666'}} to={`articleList/article/${item.path}`}>
<div className="title">{item.title}</div>
</Link>
<p className="time">{item.time}</p>
</div>
)}
</div>
<div>
<Spin tip="Loading..." spinning={this.state.loading} ></Spin>
{ this.state.show ?
<div style={{color:'#666',textAlign:'center',marginBottom:'10px'}}>没有更多...</div> : null
}
</div>
<Footer />
<div className={`${this.props.className}-banner ${this.props.className}-banner-style1`}>
<p className={`${this.props.className}-banner-desc`}
style={{
maxWidth: '528px'
}}>{intl.get('ARTICLE-DES')}</p>
</div>
<div className={`classify`}>
<div className={`classify-box`}>
<Link to="/articleList"><div className={`classify-list active`}>{intl.get('UPCOMING_EVENTS')}</div></Link>
<Link to="/articleListTwo"><div className={`classify-list`}>{intl.get('CURRENT_EVENTS')}</div></Link>
<Link to="/articleListThree"><div className={`classify-list`}>{intl.get('ETM_SOUND')}</div></Link>
</div>
</div>
<div id="wrapper" className="article-wrapper">
{ this.state.lists.map((item) =>
<div key={item.id} className="article-item">
<Link style={{color:'#666'}} to={`articleList/article/${item.path}`}>
<img className="pic" src={(()=>{return require("./image/"+ item.picName+".jpg")})()} />
</Link>
<Link style={{color:'#666'}} to={`articleList/article/${item.path}`}>
<div className="title">{item.title}</div>
</Link>
<p className="time">{item.time}</p>
</div>
)}
</div>
<div>
<Spin tip="Loading..." spinning={this.state.loading} ></Spin>
{ this.state.show ?
<div style={{color:'#666',textAlign:'center',marginBottom:'10px'}}>没有更多...</div> : null
}
</div>
<Footer />
</div>
)
}
Expand Down
15 changes: 15 additions & 0 deletions app/containers/articleList/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,18 @@
font-size: 14px;
}
}


.classify{
color:#fff;
margin-bottom:10px;
background:#000;
height:40px;
line-height:40px;
font-size:16px;
text-align: left;
}
.classify-box{width: 1080px;margin: 0 auto;}
.classify-box .classify-list{margin-right: 2px;padding: 0 16px;transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);line-height: 38px;display: inline-block;float: left;cursor: pointer;}
.classify-box .classify-list:hover{color: #ff2717}
.classify-box .classify-list.active{color: #ff2717;font-weight: 600;}
14 changes: 14 additions & 0 deletions app/containers/articleList/style/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,17 @@
}
}
}

.classify{
color:#fff;
margin-bottom:10px;
background:#000;
height:40px;
line-height:40px;
font-size:16px;
text-align: left;
}
.classify-box{width: 1080px;margin: 0 auto;}
.classify-box .classify-list{margin-right: 2px;padding: 0 16px;transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);line-height: 38px;display: inline-block;float: left;cursor: pointer;}
.classify-box .classify-list:hover{color: #ff2717}
.classify-box .classify-list.active{color: #ff2717;font-weight: 600;}
Binary file added app/containers/articleListThree/image/ETM.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/containers/articleListThree/image/act19.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/containers/articleListThree/image/act20.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/containers/articleListThree/image/act21.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/containers/articleListThree/image/act22.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/containers/articleListThree/image/act23.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/containers/articleListThree/image/act24.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/containers/articleListThree/image/pic.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.