Commit a2627059 by guomingpang

fix:修复中心首页初始化课程总数闪现NaN的问题

parent bfaec9cc
...@@ -30,6 +30,7 @@ class Home extends React.Component { ...@@ -30,6 +30,7 @@ class Home extends React.Component {
unfinishedNum: 0, unfinishedNum: 0,
weekVisitCustomerNum: 0, weekVisitCustomerNum: 0,
incWeekVisitCustomerNum: 0, incWeekVisitCustomerNum: 0,
courseNum: 0,
}; };
this._chart = null; this._chart = null;
} }
...@@ -100,6 +101,7 @@ class Home extends React.Component { ...@@ -100,6 +101,7 @@ class Home extends React.Component {
trainingPlanNum: res.result.trainingPlanNum, trainingPlanNum: res.result.trainingPlanNum,
weekVisitCustomerNum: res.result.weekVisitCustomerNum, weekVisitCustomerNum: res.result.weekVisitCustomerNum,
incWeekVisitCustomerNum: res.result.incWeekVisitCustomerNum, incWeekVisitCustomerNum: res.result.incWeekVisitCustomerNum,
courseNum: res.result.videoCourseNum + res.result.liveCourseNum + res.result.pictureCourseNum + res.result.offlineCourseNum,
}); });
} }
}); });
...@@ -214,6 +216,7 @@ class Home extends React.Component { ...@@ -214,6 +216,7 @@ class Home extends React.Component {
render() { render() {
const { const {
courseNum,
examNum, examNum,
incExamNum, incExamNum,
list, list,
...@@ -304,7 +307,7 @@ class Home extends React.Component { ...@@ -304,7 +307,7 @@ class Home extends React.Component {
<span className='header-word'>课程总数 (个)</span> <span className='header-word'>课程总数 (个)</span>
</div> </div>
<div className='data-number'>{videoCourseNum + liveCourseNum + pictureCourseNum + offlineCourseNum}</div> <div className='data-number'>{courseNum}</div>
<div className='data-footer'> <div className='data-footer'>
<span className='footer-word'>本月新增</span> <span className='footer-word'>本月新增</span>
{incCustomerNum > 0 && <span className='icon iconfont'>&#xe635;</span>} {incCustomerNum > 0 && <span className='icon iconfont'>&#xe635;</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