Commit 5019ac9a by FE

ai test sum

parent a789de0f
......@@ -83,6 +83,7 @@ class BlessingPreheat extends Component {
userHasError: props.user.hasError,
isApp: false,
isClose: false,
testSum: 0,
}
}
......@@ -232,9 +233,11 @@ class BlessingPreheat extends Component {
http.get(`${API.home}/sys/user/blessing`).then(res => {
const {code, data} = res.data
if (code === 200) {
console.log(data.user_test_total);
this.setState({
isSign: !!data.today_signed,
isFormal: data.is_activity,
testSum: parseInt(data.user_test_total, 10) || 0,
userInfo: Object.assign({}, userInfo, {
isFollow: data.subscribed,
blessingVal: data.user_blessing_value,
......@@ -420,8 +423,10 @@ class BlessingPreheat extends Component {
shareMark,
index,
isApp,
isClose
} = this.state
isClose,
testSum
} = this.state;
console.log(testSum);
const {history} = this.props
const isLogin = !this.props.user.hasError
return (
......@@ -525,7 +530,12 @@ class BlessingPreheat extends Component {
<div className="test__record" onClick={() => this.handleToShow('showRecordList', true)}>
测试记录>
</div>
<LevelTest history={history} isLogin={isLogin} toLogin={this.toLogin}></LevelTest>
<LevelTest
history={history}
testSum={testSum}
isLogin={isLogin}
toLogin={this.toLogin}
/>
<RankList></RankList>
......
......@@ -7,7 +7,7 @@ class LevelTest extends Component {
constructor(props) {
super(props);
this.state = {
testNumber: 12345,
testNumber: '',
number: 1,
prizeListUrl: [
{
......@@ -70,7 +70,7 @@ class LevelTest extends Component {
number,
prizeListUrl,
} = this.state;
const {isLogin} = this.props;
const {isLogin, testSum} = this.props;
return (
<>
<div className="level__test_module">
......@@ -83,7 +83,7 @@ class LevelTest extends Component {
<div className='test__number'>
已有
<span className='number'>
{testNumber}
{testNumber || testSum}
</span>
人参加测试
</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