Commit 3f3f77ab by xuzhenghua

返场

parent 9488548f
...@@ -605,27 +605,47 @@ class YearCourse extends Component { ...@@ -605,27 +605,47 @@ class YearCourse extends Component {
removable, removable,
sum, sum,
} = this.state } = this.state
const { stage } = this.props const { stage,treasureStage } = this.props
return ( return (
<div className={'year-index-course'}> <div className={'year-index-course'}>
{/*浮框*/} {/*浮框*/}
<div className='nav-right'>
<span onClick={this.toBoxList} className='nav-right__link'> {
Number(treasureStage) === 1 &&
<div className='nav-right'>
<span onClick={this.toBoxList} className='nav-right__link'>
未开宝箱 未开宝箱
{ {
removable > 0 && removable > 0 &&
<i className="nav-right__number">{removable}</i> <i className="nav-right__number">{removable}</i>
} }
</span> </span>
<a onClick={() => this.toYearWish()} className='nav-right__link'> <a onClick={() => this.toYearWish()} className='nav-right__link'>
心愿单 心愿单
{ {
sum > 0 && sum > 0 &&
<i className="nav-right__number">{sum}</i> <i className="nav-right__number">{sum}</i>
} }
</a> </a>
</div> </div>
}
{
Number(treasureStage) === 0 &&
<div className='nav-right-wish nav-right'>
<a onClick={() => this.toYearWish()} className='nav-right__link'>
心愿单
{
sum > 0 &&
<i className="nav-right__number">{sum}</i>
}
</a>
</div>
}
{/* 重磅好课 */} {/* 重磅好课 */}
<CommonContainer title='重磅好课' id='year-course'> <CommonContainer title='重磅好课' id='year-course'>
...@@ -673,57 +693,60 @@ class YearCourse extends Component { ...@@ -673,57 +693,60 @@ class YearCourse extends Component {
</CommonContainer> </CommonContainer>
{/* 人气好课免费学 */} {/* 人气好课免费学 */}
<CommonContainer title='人气好课免费学' id='year-free'> {
<a className='boss__add' href="/active/givecourse?activename=shuangdan">更有42本技术书籍免费送</a> Number(stage) !== 3 &&
{ <CommonContainer title='人气好课免费学' id='year-free'>
(freecourse.course && freecourse.course.length > 0) && <a className='boss__add' href="/active/givecourse?activename=shuangdan">更有42本技术书籍免费送</a>
<> {
<div className='freecourse course-box'> (freecourse.course && freecourse.course.length > 0) &&
<>
<div className='freecourse course-box'>
{
freecourse.course.map(item => (
<CourseItem
image={item.image_name}
key={item.course_id}
id={item.course_id}
toCourse={this.toCourse}
>
<div className="coupon-course__footer">
{
item.is_buy == 1 &&
<a
onClick={() => this.toCourse(item.course_id)}
className="btn to-study"
>开始学习</a>
}
{
item.is_buy == 0 &&
<a
onClick={() => this.freeStudy()}
className="btn free-study"
>点击免费学</a>
}
<p className="free-course-num">
已送出<span>{item.act_num}</span>个课
</p>
</div>
</CourseItem>
))
}
</div>
{ {
freecourse.course.map(item => ( (freecourse.courseList && freecourse.courseList.length > 4) &&
<CourseItem <button
image={item.image_name} className="more-button"
key={item.course_id} onClick={() => this.handleToMore('freecourse')}
id={item.course_id} >{freecourse.isMore ? '查看更多' : '收起'}</button>
toCourse={this.toCourse}
>
<div className="coupon-course__footer">
{
item.is_buy == 1 &&
<a
onClick={() => this.toCourse(item.course_id)}
className="btn to-study"
>开始学习</a>
}
{
item.is_buy == 0 &&
<a
onClick={() => this.freeStudy()}
className="btn free-study"
>点击免费学</a>
}
<p className="free-course-num">
已送出<span>{item.act_num}</span>个课
</p>
</div>
</CourseItem>
))
} }
</div> </>
{ }
(freecourse.courseList && freecourse.courseList.length > 4) && </CommonContainer>
<button }
className="more-button"
onClick={() => this.handleToMore('freecourse')}
>{freecourse.isMore ? '查看更多' : '收起'}</button>
}
</>
}
</CommonContainer>
{/* stage,活动阶段 0-不在活动时间 1-预热 2-正式 3-返场 */} {/* stage,活动阶段 0-不在活动时间 1-预热 2-正式 3-返场 */}
{ {
Number(stage) === 2 && Number(stage) !== 1 &&
<> <>
{/* 精品好课1分开抢 */} {/* 精品好课1分开抢 */}
<CommonContainer title='精品好课1分开抢' id='year-group'> <CommonContainer title='精品好课1分开抢' id='year-group'>
...@@ -998,7 +1021,7 @@ class YearCourse extends Component { ...@@ -998,7 +1021,7 @@ class YearCourse extends Component {
</> </>
} }
{ {
Number(stage) !== 2 && Number(stage) === 1 &&
<> <>
{/* 精品好课1分开抢 */} {/* 精品好课1分开抢 */}
<CommonContainer title='精品好课1分开抢' id='year-group'> <CommonContainer title='精品好课1分开抢' id='year-group'>
......
...@@ -296,7 +296,7 @@ ...@@ -296,7 +296,7 @@
.groupcourse[data-stage="2"] .course-container { .groupcourse[data-stage="2"] .course-container {
height: 215px; height: 215px;
} }
.progree-and-sale { .progree-and-sale {
display: flex; display: flex;
...@@ -416,5 +416,8 @@ ...@@ -416,5 +416,8 @@
line-height: 14px; line-height: 14px;
} }
} }
.nav-right-wish {
}
} }
\ No newline at end of file
...@@ -123,8 +123,8 @@ export default class index extends Component { ...@@ -123,8 +123,8 @@ export default class index extends Component {
render() { render() {
const { const {
banner, banner,
activity_stage, activity_stage,
treasure_stage, treasure_stage,
} = this.state } = this.state
return ( return (
...@@ -133,7 +133,7 @@ export default class index extends Component { ...@@ -133,7 +133,7 @@ export default class index extends Component {
<div id="banner" className="banner-treasure__header" <div id="banner" className="banner-treasure__header"
style={{backgroundImage: `url(${banner})`}}></div> style={{backgroundImage: `url(${banner})`}}></div>
<div className="banner-treasure__nav"> <div className="banner-treasure__nav">
<TreasureNav id="banner" treasure_stage={treasure_stage}/> <TreasureNav id="banner" treasure_stage={treasure_stage} activeStage={activity_stage}/>
</div> </div>
<div className="banner-treasure__decorate"></div> <div className="banner-treasure__decorate"></div>
</div> </div>
...@@ -143,12 +143,12 @@ export default class index extends Component { ...@@ -143,12 +143,12 @@ export default class index extends Component {
{/* 组队开宝箱 */} {/* 组队开宝箱 */}
{ {
treasure_stage === 1 && treasure_stage === 1 &&
<TreasureBox isAppUpdate={this.state.isAppUpdate} getRemovable={this.getRemovable}/> <TreasureBox isAppUpdate={this.state.isAppUpdate} getRemovable={this.getRemovable}/>
} }
{/* 课程 */} {/* 课程 */}
<YearCourse stage={activity_stage} isAppUpdate={this.state.isAppUpdate} /> <YearCourse stage={activity_stage} treasureStage={treasure_stage} isAppUpdate={this.state.isAppUpdate} />
{/*好友加入队伍提醒;获得宝箱提醒;开售提醒弹窗,需要自取,注意修改文案*/} {/*好友加入队伍提醒;获得宝箱提醒;开售提醒弹窗,需要自取,注意修改文案*/}
{ {
...@@ -181,6 +181,9 @@ export default class index extends Component { ...@@ -181,6 +181,9 @@ export default class index extends Component {
</div> </div>
</CommonPopup> </CommonPopup>
} }
<div className={'btm-rule'}>* 本活动解释权归北京七月在线科技有限公司所有 *</div>
</div> </div>
) )
} }
......
...@@ -59,6 +59,12 @@ ...@@ -59,6 +59,12 @@
} }
} }
.btm-rule {
color: #fff;
font-size: 12px;
width: 100%;
text-align: center;
}
} }
.year-index + .year19-index { .year-index + .year19-index {
......
...@@ -48,21 +48,22 @@ class TreasureNav extends Component { ...@@ -48,21 +48,22 @@ class TreasureNav extends Component {
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
this.initNav(nextProps.treasure_stage); this.initNav(nextProps.treasure_stage,nextProps.activeStage);
} }
initNav = (treasure_stage) => { initNav = (treasure_stage,activeStage) => {
let {navs} = this.state; let {navs} = this.state;
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内 // treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
let data = this.state.navs
if(treasure_stage === 0) { if(treasure_stage === 0) {
this.setState({ data = navs.filter(item => item.id !== 'year-treasure')
formatNavs: navs.filter(item => item.id !== 'year-treasure') }
}); if(activeStage === 3) {
}else { data = data.filter(item => item.id !== 'year-free')
this.setState({
formatNavs: navs
})
} }
this.setState({
formatNavs: data
})
} }
calcNavActive = () => { calcNavActive = () => {
...@@ -108,9 +109,9 @@ class TreasureNav extends Component { ...@@ -108,9 +109,9 @@ class TreasureNav extends Component {
<div className={classnames("treasure-nav", {'fixed': isFixed})} data-skip="nav"> <div className={classnames("treasure-nav", {'fixed': isFixed})} data-skip="nav">
{ {
formatNavs.map((item, index) => ( formatNavs.map((item, index) => (
<a <a
href={`#${item.id}`} href={`#${item.id}`}
className={classnames("treasure-nav__item", {'active': index === curIndex})} className={classnames("treasure-nav__item", {'active': index === curIndex})}
key={item.id} key={item.id}
onClick={() => this.selectToNav(index)} onClick={() => this.selectToNav(index)}
>{item.name}</a> >{item.name}</a>
......
...@@ -149,25 +149,25 @@ class YarnWish extends Component { ...@@ -149,25 +149,25 @@ class YarnWish extends Component {
list.length > 0 list.length > 0
? <> ? <>
{ {
activityStage === 2 && activityStage !== 1 &&
<> <>
<CommonContainer> <CommonContainer>
<div className='groupcourse course-box'> <div className='groupcourse course-box'>
{ {
list.map(item => ( list.map(item => (
<CourseItem <CourseItem
image={item.image_name} image={item.image_name}
key={item.course_id} key={item.course_id}
id={item.course_id} id={item.course_id}
time={item.type === 2 || item.type === 7? item.end_time : ''} time={item.type === 2 || item.type === 7? item.end_time : ''}
toCourse={this.toCourse} toCourse={this.toCourse}
> >
{/* {/*
* 拼团,正常:未开团1 已开2;一分:未开团5 已开7 * 拼团,正常:未开团1 已开2;一分:未开团5 已开7
* type 1 立即参团 2 已参团 3 我要砍价 4 已参加砍价 可以继续砍价 5 马上抢 6 开始学习 7 已参加一分钱拼团 8 砍价待支付 * type 1 立即参团 2 已参团 3 我要砍价 4 已参加砍价 可以继续砍价 5 马上抢 6 开始学习 7 已参加一分钱拼团 8 砍价待支付
*/} */}
<div className="coupon-course__footer"> <div className="coupon-course__footer">
{ {
...@@ -306,7 +306,7 @@ class YarnWish extends Component { ...@@ -306,7 +306,7 @@ class YarnWish extends Component {
} }
{ {
item.type === 6 && item.type === 6 &&
<a <a
onClick={() => this.toCourse(item.course_id)} onClick={() => this.toCourse(item.course_id)}
className="btn to-group" className="btn to-group"
data-status="study" data-status="study"
...@@ -322,15 +322,15 @@ class YarnWish extends Component { ...@@ -322,15 +322,15 @@ class YarnWish extends Component {
</> </>
} }
{ {
activityStage !== 2 && activityStage === 1 &&
<> <>
<CommonContainer> <CommonContainer>
<div className='groupcourse course-box'> <div className='groupcourse course-box'>
{ {
list.map(item => ( list.map(item => (
<CourseItem <CourseItem
image={item.image_name} image={item.image_name}
key={item.course_id} key={item.course_id}
id={item.course_id} id={item.course_id}
toCourse={this.toCourse} toCourse={this.toCourse}
> >
...@@ -343,7 +343,7 @@ class YarnWish extends Component { ...@@ -343,7 +343,7 @@ class YarnWish extends Component {
item.is_buy == 1 && item.is_buy == 1 &&
<> <>
<p className={'course-title text-overflow-1'}>{item.course_title}</p> <p className={'course-title text-overflow-1'}>{item.course_title}</p>
<a <a
onClick={() => this.toCourse(item.course_id)} onClick={() => this.toCourse(item.course_id)}
className="btn to-study" className="btn to-study"
>开始学习</a> >开始学习</a>
...@@ -382,7 +382,7 @@ class YarnWish extends Component { ...@@ -382,7 +382,7 @@ class YarnWish extends Component {
<span className="old-price">{item.type == 2 ? '' : '现价:'}<s>¥{item.price1}</s></span> <span className="old-price">{item.type == 2 ? '' : '现价:'}<s>¥{item.price1}</s></span>
</div> </div>
<div className="status"> <div className="status">
<a <a
onClick={() => this.toCourse(item.course_id)} onClick={() => this.toCourse(item.course_id)}
className="status-btn to-buy" className="status-btn to-buy"
>直接购买</a> >直接购买</a>
...@@ -425,7 +425,7 @@ class YarnWish extends Component { ...@@ -425,7 +425,7 @@ class YarnWish extends Component {
<div className="notData"> <div className="notData">
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/PC/icon-empty.png" alt=""/> <img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/PC/icon-empty.png" alt=""/>
{ {
activityStage == 1 activityStage == 1
? <p>你的心愿单目前空空如也,<br/>快去挑选更多优惠课程吧~</p> ? <p>你的心愿单目前空空如也,<br/>快去挑选更多优惠课程吧~</p>
: <p>你的心愿单没有课程哦,<br/>感兴趣的课程可在双旦主会场直接购买!</p> : <p>你的心愿单没有课程哦,<br/>感兴趣的课程可在双旦主会场直接购买!</p>
} }
......
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