Commit 591fea8d by zhanghaozhe

限时免费

parent 903baf13
...@@ -14,44 +14,8 @@ class LimitFree extends Component { ...@@ -14,44 +14,8 @@ class LimitFree extends Component {
nav nav
state = { state = {
tab: { tab: {},
0: 'tab0', courses: [],
1: 'tab1',
2: 'tab2',
3: 'tab3',
4: 'tab4',
5: 'tab5',
6: 'tab6',
7: 'tab7',
8: 'tab8',
9: 'tab9',
},
courses: [
{
img: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/20a86c1353.jpg',
title: 'NLP到Word2Vec实战班',
count: '1212',
status: 1,
price: 99,
price1: 199,
},
{
img: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/20a86c1353.jpg',
title: 'NLP到Word2Vec实战班',
count: '1212',
status: 1,
price: 99,
price1: 199,
},
{
img: 'https://julyedu-img-public.oss-cn-beijing.aliyuncs.com/Public/Image/20a86c1353.jpg',
title: 'NLP到Word2Vec实战班',
count: '1212',
status: 1,
price: 99,
price1: 199,
},
],
navItemStyle: {}, navItemStyle: {},
tabActiveIndex: 0 tabActiveIndex: 0
} }
...@@ -127,7 +91,7 @@ class LimitFree extends Component { ...@@ -127,7 +91,7 @@ class LimitFree extends Component {
{ {
tab && !!Object.keys(tab).length && Object.keys(tab).map(key => { tab && !!Object.keys(tab).length && Object.keys(tab).map(key => {
return ( return (
<li key={key}> <li key={key} className={'category'}>
<h2 id={`category${key}`}> <h2 id={`category${key}`}>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/time_limited_free/M/category-icon.png" <img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/time_limited_free/M/category-icon.png"
alt=""/> alt=""/>
...@@ -136,16 +100,23 @@ class LimitFree extends Component { ...@@ -136,16 +100,23 @@ class LimitFree extends Component {
<ul className={'courses'}> <ul className={'courses'}>
{ {
courses && courses.length && courses.map((item, index) => { courses && courses.length && courses.map((item, index) => {
if(item.category_id != key){
return null
}
/*
* course_status:
* 0未领取 1已领取未过期 2 已领取已过期 3 正常已购买
* */
let des, bottom let des, bottom
switch (item.status) { switch (item.course_status) {
case 1: case 0:
des = <div className={'learner'}> des = <div className={'learner'}>
<i className='iconfont iconRectangleCopy4'/> <i className='iconfont iconRectangleCopy4'/>
<span>{item.play_times}人学习</span> <span>{item.play_times}人学习</span>
</div> </div>
bottom = <div className={'bottom'}> bottom = <div className={'bottom'}>
<span className={'red'}>限时免费</span> <span className={'red'}>限时免费</span>
<span className={'origin-price'}>¥{item.price1}</span> <span className={'origin-price'}>¥{item.price0}</span>
<button>免费领取</button> <button>免费领取</button>
</div> </div>
break break
......
...@@ -69,17 +69,26 @@ ...@@ -69,17 +69,26 @@
.course-list { .course-list {
border-top: 1px solid transparent; border-top: 1px solid transparent;
padding: 0 12px; }
background: #fff;
.category {
padding: 12px 12px 0;
background: #fff;
margin-bottom: 8px;
} }
.course-list li{
scroll-margin-top: 100px; h2 {
scroll-margin-top: 45px;
} }
.courses li:nth-last-child(1) { .courses li:nth-last-child(1) {
margin-bottom: 0; margin-bottom: 0;
& div {
border-bottom: none;
}
} }
.v-list-base-item { .v-list-base-item {
......
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