Commit 5019ac9a by FE

ai test sum

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