Commit 67f9a138 by zhangleyuan

feat:调整首页的样式

parent ed837ed7
......@@ -261,8 +261,9 @@ class Home extends React.Component {
};
return (
<div className="home-page">
<div className="home-title">数据概况</div>
<div className="data-box">
<div className="data-wrap">
<div className="home-title">数据概况</div>
<div className="data-box">
<div className="data-item">
<div className="header">
<img className="header-icon" src="https://image.xiaomaiketang.com/xm/wAaFtjeRsM.png" />
......@@ -360,65 +361,67 @@ class Home extends React.Component {
</div>
</div>
</div>
<div className="home-title">学习概况</div>
<div className="study-box">
<div className="study-item">
<div className="study-title">课程学习排行榜</div>
<div className="study-header">
<div className="study-tab">
<span
className={`tab${scheduleType === 'LIVE' ? ' selected' : ''}`}
onClick={() => this.setState({ scheduleType: 'LIVE' }, () => this.getHotCourse())}
>直播课</span>
<span
className={`tab${scheduleType === 'VOICE' ? ' selected' : ''}`}
onClick={() => this.setState({ scheduleType: 'VOICE' }, () => this.getHotCourse())}
>视频课</span>
<span
className={`tab${scheduleType === 'PICTURE' ? ' selected' : ''}`}
onClick={() => this.setState({ scheduleType: 'PICTURE' }, () => this.getHotCourse())}
>图文课</span>
</div>
<div className="study-select">
<span className="select-word">{moment().subtract(timeRange - 1, 'day').format('MM.DD')} ~ {moment().format('MM.DD')}</span>
<Select
style={{ width: 88 }}
value={timeRange}
onChange={(value) => {
this.setState({ timeRange: value }, () => this.getHotCourse());
}}
>
<Option value="7">近7天</Option>
<Option value="15">近15天</Option>
<Option value="30">近30天</Option>
</Select>
</div>
</div>
{_.isEmpty(list) ?
<div className="study-empty">
<img src="https://image.xiaomaiketang.com/xm/52dmait5Bx.png" />
<div>暂无课程上榜</div>
</div>
<div className="study-wrap">
<div className="home-title">学习概况</div>
<div className="study-box">
<div className="study-item">
<div className="study-title">课程学习排行榜</div>
<div className="study-header">
<div className="study-tab">
<span
className={`tab${scheduleType === 'LIVE' ? ' selected' : ''}`}
onClick={() => this.setState({ scheduleType: 'LIVE' }, () => this.getHotCourse())}
>直播课</span>
<span
className={`tab${scheduleType === 'VOICE' ? ' selected' : ''}`}
onClick={() => this.setState({ scheduleType: 'VOICE' }, () => this.getHotCourse())}
>视频课</span>
<span
className={`tab${scheduleType === 'PICTURE' ? ' selected' : ''}`}
onClick={() => this.setState({ scheduleType: 'PICTURE' }, () => this.getHotCourse())}
>图文课</span>
</div>
<div className="study-select">
<span className="select-word">{moment().subtract(timeRange - 1, 'day').format('MM.DD')} ~ {moment().format('MM.DD')}</span>
<Select
style={{ width: 88 }}
value={timeRange}
onChange={(value) => {
this.setState({ timeRange: value }, () => this.getHotCourse());
}}
>
<Option value="7">近7天</Option>
<Option value="15">近15天</Option>
<Option value="30">近30天</Option>
</Select>
</div>
</div>
: list.map((item, index) => (
<div className={`table-item${index % 2 ? '' : ' odd'}`} key={item.id}>
{index < 3 ?
<span className="table-number"><img src={this.showNumber(index)} className="table-image" /></span>
: <span className="table-number">{index + 1}</span>
}
<div className="table-data">
<div className="table-name">
<Tooltip title={item.courseName}>
{item.courseName}
</Tooltip>
{_.isEmpty(list) ?
<div className="study-empty">
<img src="https://image.xiaomaiketang.com/xm/52dmait5Bx.png" />
<div>暂无课程上榜</div>
</div>
: list.map((item, index) => (
<div className={`table-item${index % 2 ? '' : ' odd'}`} key={item.id}>
{index < 3 ?
<span className="table-number"><img src={this.showNumber(index)} className="table-image" /></span>
: <span className="table-number">{index + 1}</span>
}
<div className="table-data">
<div className="table-name">
<Tooltip title={item.courseName}>
{item.courseName}
</Tooltip>
</div>
<div className="table-tag">{item.categoryName}</div>
</div>
<div className="table-tag">{item.categoryName}</div>
<span className="table-study">{item.studyNum || 0}人已学习</span>
</div>
<span className="table-study">{item.studyNum || 0}人已学习</span>
</div>
))
}
</div>
<div className="study-item">
))
}
</div>
<div className="study-item">
<div className="study-title">培训计划完成情况
<Tooltip overlayClassName="data-plan-tooltip" title="若某人加入多个培训计划,则需完成所有已加入的培训计划后,才视为已完成培训">
<span className="iconfont icon">&#xe61d;</span>
......@@ -500,6 +503,7 @@ class Home extends React.Component {
<div className="word">完成培训</div>
</div>
</div>
</div>
</div>
<div className="study-chart">
<div className="study-title">学习人数与时长
......
......@@ -9,282 +9,304 @@
.home-title {
height: 44px;
line-height: 44px;
color: #999;
color: #333;
padding-left:28px;
font-size:16px;
font-weight:bold;
position: relative;
&::before{
width:4px;
height:12px;
content:'';
background-image: linear-gradient(#2966FF 83.5%, #0ACCA4 16.5%);
display:inline-block;
position: absolute;
left:16px;
top:16px;
}
}
@font-face {
font-family: 'number';
src: url('https://image.xiaomaiketang.com/xm/n2sADd2jY6.TTF');
}
.data-box {
display: flex;
justify-content: space-between;
.data-item {
position: relative;
height: 156px;
background: #fff;
width: ~'calc(16.67% - 8px)';
padding: 16px;
&.course-data {
width: ~'calc(50% - 24px)';
}
.header {
display: flex;
.header-icon {
width: 18px;
height: 18px;
margin-right: 4px;
}
.header-word {
display: inline-block;
font-size: 12px;
line-height: 18px;
color: #999;
}
}
.data-number {
font-family: 'number';
font-size: 28px;
color: #333;
margin-top: 24px;
}
.data-footer {
margin-top: 12px;
.footer-word {
font-size: 12px;
color: #999;
margin-right: 8px;
.data-wrap{
background: #FFF;
.data-box {
display: flex;
justify-content: space-between;
.data-item {
position: relative;
height: 156px;
background: #fff;
width: ~'calc(16.67% - 8px)';
padding: 16px;
&.course-data {
width: ~'calc(50% - 24px)';
}
.iconfont {
font-size: 12px;
margin-right: 4px;
color: #EC4B35;
.header {
display: flex;
.header-icon {
width: 18px;
height: 18px;
margin-right: 4px;
}
.header-word {
display: inline-block;
font-size: 12px;
line-height: 18px;
color: #999;
}
}
.footer-number {
font-size: 12px;
color: #999;
.data-number {
font-family: 'number';
font-size: 28px;
color: #333;
margin-top: 24px;
}
}
.course-box {
border-radius: 4px;
background: #FAFAFA;
height: 124px;
width: 66%;
position: absolute;
right: 16px;
top: 16px;
padding: 8px 24px 0;
.course-item {
display: inline-block;
width: 50%;
padding: 4px 0 12px;
.course-title {
.data-footer {
margin-top: 12px;
.footer-word {
font-size: 12px;
color: #999;
margin-right: 8px;
}
.data {
display: flex;
align-items: flex-end;
.course-number {
font-size: 16px;
font-family: 'number';
margin-right: 16px;
}
.course-word {
.iconfont {
font-size: 12px;
margin-right: 4px;
color: #EC4B35;
}
.footer-number {
font-size: 12px;
color: #999;
}
}
.course-box {
border-radius: 4px;
background: #FAFAFA;
height: 124px;
width: 66%;
position: absolute;
right: 16px;
top: 16px;
padding: 8px 24px 0;
.course-item {
display: inline-block;
width: 50%;
padding: 4px 0 12px;
.course-title {
font-size: 12px;
color: #999;
margin-right: 8px;
}
.iconfont {
font-size: 12px;
margin-right: 4px;
color: #EC4B35;
}
.add-number {
font-size: 12px;
color: #999;
.data {
display: flex;
align-items: flex-end;
.course-number {
font-size: 16px;
font-family: 'number';
margin-right: 16px;
}
.course-word {
font-size: 12px;
color: #999;
margin-right: 8px;
}
.iconfont {
font-size: 12px;
margin-right: 4px;
color: #EC4B35;
}
.add-number {
font-size: 12px;
color: #999;
}
}
}
}
}
}
}
.study-box {
display: flex;
justify-content: space-between;
.study-item {
position: relative;
height: 414px;
background: #fff;
width: ~'calc(50% - 8px)';
padding: 16px;
.study-title {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 12px;
.iconfont {
font-size: 14px;
color: #BFBFBF;
margin-left: 4px;
}
.tip {
font-size: 14px;
color: #999999;
margin-left: 8px;
font-weight: 400;
.study-wrap{
background: #FFF;
margin-top:16px;
.study-box {
display: flex;
justify-content: space-between;
.study-item {
position: relative;
height: 414px;
background: #fff;
width: ~'calc(50% - 8px)';
padding: 16px;
.study-title {
font-size: 16px;
color: #333;
font-weight: 500;
line-height: 22px;
margin-bottom: 12px;
.iconfont {
font-size: 14px;
color: #BFBFBF;
margin-left: 4px;
}
.tip {
font-size: 14px;
color: #999999;
margin-left: 8px;
font-weight: 400;
}
}
}
.study-header {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.study-tab {
.tab {
position: relative;
padding-right: 24px;
color: #666;
cursor: pointer;
&.selected {
color: #2966FF;
&::after {
position: absolute;
width: 24px;
height: 2px;
content: '';
background: #2966FF;
border-radius: 1px;
left: 9px;
bottom: -4px;
.study-header {
display: flex;
justify-content: space-between;
margin-bottom: 16px;
.study-tab {
.tab {
position: relative;
padding-right: 24px;
color: #666;
cursor: pointer;
&.selected {
color: #2966FF;
&::after {
position: absolute;
width: 24px;
height: 2px;
content: '';
background: #2966FF;
border-radius: 1px;
left: 9px;
bottom: -4px;
}
}
}
}
.study-select {
.select-word {
color: #999;
margin-right: 8px;
}
}
}
.study-select {
.select-word {
.table-item {
width: 100%;
height: 60px;
display: flex;
align-items: center;
&.odd {
background: #FAFAFA;
}
.table-image {
width: 24px;
height: 24px;
}
.table-number {
width: 15%;
color: #999;
margin-right: 8px;
padding: 0 16px;
text-align: center;
}
}
}
.table-item {
width: 100%;
height: 60px;
display: flex;
align-items: center;
&.odd {
background: #FAFAFA;
}
.table-image {
width: 24px;
height: 24px;
}
.table-number {
width: 15%;
color: #999;
padding: 0 16px;
text-align: center;
}
.table-data {
width: 55%;
padding: 0 16px;
.table-name {
color: #333;
line-height: 20px;
margin-bottom: 2px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
.table-data {
width: 55%;
padding: 0 16px;
.table-name {
color: #333;
line-height: 20px;
margin-bottom: 2px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.table-tag {
line-height: 17px;
color: #999;
font-size: 12px;
}
}
.table-tag {
line-height: 17px;
.table-study {
width: 30%;
color: #999;
font-size: 12px;
padding: 0 16px;
}
}
.table-study {
width: 30%;
color: #999;
padding: 0 16px;
}
}
.study-empty {
margin-top: 102px;
img {
display: block;
width: 100px;
height: 100px;
margin: 0 auto 8px;
}
div {
text-align: center;
color: #333;
.study-empty {
margin-top: 102px;
img {
display: block;
width: 100px;
height: 100px;
margin: 0 auto 8px;
}
div {
text-align: center;
color: #333;
}
}
}
.circle-box {
width: 70%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.big-circle {
.circle-box {
width: 70%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
width: 204px;
height: 204px;
border-radius: 102px;
background: #F1F3F6;
margin-top: -20px;
.small-circle {
.big-circle {
display: flex;
align-items: center;
justify-content: center;
width: 124px;
height: 124px;
border-radius: 62px;
background: #fff;
.tip-box {
text-align: center;
width: 204px;
height: 204px;
border-radius: 102px;
background: #F1F3F6;
margin-top: -20px;
.small-circle {
display: flex;
align-items: center;
justify-content: center;
width: 124px;
height: 124px;
border-radius: 62px;
background: #fff;
.tip-box {
text-align: center;
}
}
}
}
}
.circle-tip {
position: absolute;
left: 70%;
padding-left: 16px;
&.unfinished {
top: 152px;
.spot {
background: #2966FF;
.circle-tip {
position: absolute;
left: 70%;
padding-left: 16px;
&.unfinished {
top: 152px;
.spot {
background: #2966FF;
}
}
&.finished {
top: 232px;
.spot {
background: #FFBB54;
}
}
}
&.finished {
top: 232px;
.spot {
background: #FFBB54;
position: absolute;
width: 8px;
height: 8px;
border-radius: 4px;
top: 20px;
left: 0;
}
.number {
color: #333;
font-size: 16px;
margin-bottom: 2px;
}
.word {
color: #999;
}
}
.spot {
position: absolute;
width: 8px;
height: 8px;
border-radius: 4px;
top: 20px;
left: 0;
}
.number {
color: #333;
font-size: 16px;
margin-bottom: 2px;
}
.word {
color: #999;
}
}
}
}
.study-chart {
width: 100%;
height: 432px;
......
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