Commit b8022196 by zhanghaozhe

Merge branch 'ai-test-merge' into dev

parents 5da0e928 6fd059d9
...@@ -37,6 +37,7 @@ class Scores extends Component { ...@@ -37,6 +37,7 @@ class Scores extends Component {
address: '', address: '',
}, },
isShowUserAddress: false, isShowUserAddress: false,
entryButtonInRule: false,
} }
componentDidMount() { componentDidMount() {
...@@ -160,6 +161,7 @@ class Scores extends Component { ...@@ -160,6 +161,7 @@ class Scores extends Component {
userScore, userScore,
isShowUserAddress, isShowUserAddress,
userAddress, userAddress,
entryButtonInRule,
} = this.state } = this.state
const _rankList = Array.isArray(rankList) ? isExpandRankList ? rankList : rankList.slice(0, 10) : [] const _rankList = Array.isArray(rankList) ? isExpandRankList ? rankList : rankList.slice(0, 10) : []
return ( return (
...@@ -296,6 +298,7 @@ class Scores extends Component { ...@@ -296,6 +298,7 @@ class Scores extends Component {
pageState.daily_test_num > 0 pageState.daily_test_num > 0
? <button className={'available'} onClick={() => { ? <button className={'available'} onClick={() => {
isNeverShow ? this.startTest() : this.setState({ isNeverShow ? this.startTest() : this.setState({
entryButtonInRule: true,
isShowRule: true, isShowRule: true,
}) })
}}>开始测试<span>(今日可测试{pageState.daily_test_num}次)</span></button> }}>开始测试<span>(今日可测试{pageState.daily_test_num}次)</span></button>
...@@ -311,8 +314,9 @@ class Scores extends Component { ...@@ -311,8 +314,9 @@ class Scores extends Component {
close={() => { close={() => {
this.setState({ this.setState({
isShowRule: false, isShowRule: false,
entryButtonInRule: false,
}) })
}}/> }} entryButtonInRule={entryButtonInRule}/>
} }
{ {
isShowUserAddress && isShowUserAddress &&
...@@ -344,16 +348,20 @@ class Scores extends Component { ...@@ -344,16 +348,20 @@ class Scores extends Component {
} }
} }
function Rule({neverShow, isNeverShow, rule, close, startTest}) { function Rule({neverShow, isNeverShow, rule, close, startTest, entryButtonInRule}) {
return <div className="rule-mask"> return <div className="rule-mask">
<div className="rule"> <div className="rule">
<div>测试规则</div> <div>测试规则</div>
<div dangerouslySetInnerHTML={html(rule)}></div> <div dangerouslySetInnerHTML={html(rule)}></div>
<div className="option"> {
<input id={'never-show'} type="checkbox" onChange={neverShow} checked={isNeverShow}/> entryButtonInRule && <>
<label htmlFor="never-show">不再提示</label> <div className="option">
</div> <input id={'never-show'} type="checkbox" onChange={neverShow} checked={isNeverShow}/>
<button onClick={startTest}>进入测试</button> <label htmlFor="never-show">不再提示</label>
</div>
<button onClick={startTest}>进入测试</button>
</>
}
<i className={'close iconfont iconiconfront-2'} onClick={close}/> <i className={'close iconfont iconiconfront-2'} onClick={close}/>
</div> </div>
</div> </div>
......
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