Commit 41aa6cb8 authored by wildfirecode13's avatar wildfirecode13

111

parent ccb0bfbe
...@@ -12,6 +12,27 @@ import './rank.less'; ...@@ -12,6 +12,27 @@ import './rank.less';
class Rank extends React.Component { class Rank extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {
tab: 0
}
}
updateTabData() {
const { tab } = this.state;
console.warn('获取'+(tab==1?'当期':'下期')+'数据')
}
onClick_tab = () => {
this.updateTabData();
const { tab } = this.state;
this.setState({
tab: 1 - tab
})
}
componentDidMount() {
this.updateTabData();
} }
onClick_close = () => { onClick_close = () => {
...@@ -24,11 +45,14 @@ class Rank extends React.Component { ...@@ -24,11 +45,14 @@ class Rank extends React.Component {
} }
render() { render() {
const { tab } = this.state;
return ( return (
<div className="rank"> <div className="rank">
<span className="rank_bg"></span> <span className="rank_bg"></span>
<span className="rank_tab1"></span> {
<span className="rank_tab2"></span> tab == 0 ? (<span onClick={this.onClick_tab} className="rank_tab1"></span>) :
(<span onClick={this.onClick_tab} className="rank_tab2"></span>)
}
<span className="rank_tips_rank">排名</span> <span className="rank_tips_rank">排名</span>
<span className="rank_rank">99</span> <span className="rank_rank">99</span>
<span className="rank_tips_history">历史最高分</span> <span className="rank_tips_history">历史最高分</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment