Commit d14a6e9e by xuzhenghua

pull

parent 9783df22
...@@ -166,7 +166,7 @@ class App extends Component { ...@@ -166,7 +166,7 @@ class App extends Component {
return return
} }
http.get(`${API['home']}/m/wx_loginInfo/code/${code}?redirect=${encodeURIComponent(window.location.href)}`) http.get(`${API["passport-api"]}/m/wx_loginInfo/code/${code}?redirect=${encodeURIComponent(window.location.href)}`)
.then(res => { .then(res => {
let data = res.data let data = res.data
if (data.errno == 200) { if (data.errno == 200) {
...@@ -277,12 +277,7 @@ class App extends Component { ...@@ -277,12 +277,7 @@ class App extends Component {
} }
render() { render() {
return <> return <Routes/>
<Routes/>
<Link className={'year19-index'} to="/year/yearindex">
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/gift-package.png" alt=""/>
</Link>
</>
} }
} }
......
...@@ -512,18 +512,3 @@ input[type="radio"]:checked:before { ...@@ -512,18 +512,3 @@ input[type="radio"]:checked:before {
color: #333; color: #333;
font-size: 15px; font-size: 15px;
} }
.year19-index {
display: block;
width: 58px;
height: 70px;
position: fixed;
top: 50%;
right: 0;
margin-top: -35px;
z-index: 9;
img {
width: 100%;
height: 100%;
}
}
\ No newline at end of file
...@@ -38,6 +38,7 @@ class Landing extends Component { ...@@ -38,6 +38,7 @@ class Landing extends Component {
} }
componentDidMount() { componentDidMount() {
this.getStage();
this.fetchPageData() this.fetchPageData()
window.showFollowAlert = this.remind.bind(this, 'create') window.showFollowAlert = this.remind.bind(this, 'create')
document.title = '七月在线年终大回馈,幸运宝箱随你开,100%有奖!' document.title = '七月在线年终大回馈,幸运宝箱随你开,100%有奖!'
...@@ -64,8 +65,23 @@ class Landing extends Component { ...@@ -64,8 +65,23 @@ class Landing extends Component {
this.shareTipPopup && this.shareTipPopup.remove() this.shareTipPopup && this.shareTipPopup.remove()
} }
createMeta = (title, dec, imgname) => { // 获取活动以及宝箱的阶段
let meta = document.createElement('meta') getStage = () => {
http.get(`${API.home}/activity/stage`).then(res => {
const {code, data, msg} = res.data
if (code === 200) {
if(Number(data.activity_stage) === 0) {
this.props.history.push('/');
return;
}
} else {
Toast.info(msg, 2)
}
})
}
createMeta = (title,dec,imgname) => {
let meta = document.createElement('meta');
meta.setAttribute('name', 'description') meta.setAttribute('name', 'description')
meta.setAttribute('itemprop', 'description') meta.setAttribute('itemprop', 'description')
meta.setAttribute('content', dec) meta.setAttribute('content', dec)
......
...@@ -51,6 +51,8 @@ class MyTreasure extends Component { ...@@ -51,6 +51,8 @@ class MyTreasure extends Component {
const {userInfo} = nextProp const {userInfo} = nextProp
if (!userInfo.uid) { if (!userInfo.uid) {
history.push('/passport') history.push('/passport')
}else {
this.fetchMyTreasure();
} }
} }
...@@ -307,6 +309,10 @@ class MyTreasure extends Component { ...@@ -307,6 +309,10 @@ class MyTreasure extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data} = res.data const {code, data} = res.data
if (code === 200) { if (code === 200) {
if(Number(data.activity_stage) === 0) {
this.props.history.push('/');
return;
}
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内 // treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
if (data.treasure_stage === 0) { if (data.treasure_stage === 0) {
this.startCountDown() this.startCountDown()
......
...@@ -88,7 +88,7 @@ class LiveRoom extends Component { ...@@ -88,7 +88,7 @@ class LiveRoom extends Component {
this.toLogin(); this.toLogin();
}else{ }else{
const vCourseId = url.split('/')[0]; const vCourseId = url.split('/')[0];
history.push(`/play/video?id=${vCourseId}`) window.location.href = `/play/video?id=${vCourseId}`
} }
} }
// 关闭弹框 // 关闭弹框
......
...@@ -605,11 +605,13 @@ class YearCourse extends Component { ...@@ -605,11 +605,13 @@ 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'}>
{/*浮框*/} {/*浮框*/}
{
Number(treasureStage) === 1 &&
<div className='nav-right'> <div className='nav-right'>
<span onClick={this.toBoxList} className='nav-right__link'> <span onClick={this.toBoxList} className='nav-right__link'>
未开宝箱 未开宝箱
...@@ -626,6 +628,23 @@ class YearCourse extends Component { ...@@ -626,6 +628,23 @@ class YearCourse extends Component {
} }
</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,6 +692,8 @@ class YearCourse extends Component { ...@@ -673,6 +692,8 @@ class YearCourse extends Component {
</CommonContainer> </CommonContainer>
{/* 人气好课免费学 */} {/* 人气好课免费学 */}
{
Number(stage) !== 3 &&
<CommonContainer title='人气好课免费学' id='year-free'> <CommonContainer title='人气好课免费学' id='year-free'>
<a className='boss__add' href="/active/givecourse?activename=shuangdan">更有42本技术书籍免费送</a> <a className='boss__add' href="/active/givecourse?activename=shuangdan">更有42本技术书籍免费送</a>
{ {
...@@ -720,10 +741,11 @@ class YearCourse extends Component { ...@@ -720,10 +741,11 @@ class YearCourse extends Component {
</> </>
} }
</CommonContainer> </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 +1020,7 @@ class YearCourse extends Component { ...@@ -998,7 +1020,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'>
......
...@@ -416,5 +416,12 @@ ...@@ -416,5 +416,12 @@
line-height: 14px; line-height: 14px;
} }
} }
.nav-right-wish {
background-image: url("https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/fanc-bx.png");
.nav-right__link{
top: 60px;
left: 10px;
}
}
} }
\ No newline at end of file
...@@ -110,11 +110,25 @@ export default class index extends Component { ...@@ -110,11 +110,25 @@ export default class index extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data, msg} = res.data const {code, data, msg} = res.data
if (code === 200) { if (code === 200) {
if(Number(data.activity_stage) === 0) {
this.props.history.push('/');
return;
}
// treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内 // treasure_stage,宝箱阶段,0-不在活动时间,1-活动时间内
this.setState({ this.setState({
activity_stage: data.activity_stage, activity_stage: data.activity_stage,
treasure_stage: data.treasure_stage treasure_stage: data.treasure_stage
}) })
if(data.activity_stage == 3){
this.setState({
banner: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/m_banner_fc.png',
})
} else {
this.setState({
banner: 'https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/newyear20/H5/m_banner_bj%402x.png',
})
}
} else { } else {
Toast.info(msg, 2) Toast.info(msg, 2)
} }
...@@ -133,7 +147,7 @@ export default class index extends Component { ...@@ -133,7 +147,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>
...@@ -148,7 +162,7 @@ export default class index extends Component { ...@@ -148,7 +162,7 @@ export default class index extends Component {
} }
{/* 课程 */} {/* 课程 */}
<YearCourse stage={activity_stage} isAppUpdate={this.state.isAppUpdate} /> <YearCourse stage={activity_stage} treasureStage={treasure_stage} isAppUpdate={this.state.isAppUpdate} />
{/*好友加入队伍提醒;获得宝箱提醒;开售提醒弹窗,需要自取,注意修改文案*/} {/*好友加入队伍提醒;获得宝箱提醒;开售提醒弹窗,需要自取,注意修改文案*/}
{ {
...@@ -181,6 +195,9 @@ export default class index extends Component { ...@@ -181,6 +195,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,22 +48,23 @@ class TreasureNav extends Component { ...@@ -48,22 +48,23 @@ 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) {
data = navs.filter(item => item.id !== 'year-treasure')
}
if(activeStage === 3) {
data = data.filter(item => item.id !== 'year-free')
}
this.setState({ this.setState({
formatNavs: navs.filter(item => item.id !== 'year-treasure') formatNavs: data
});
}else {
this.setState({
formatNavs: navs
}) })
} }
}
calcNavActive = () => { calcNavActive = () => {
const { formatNavs } = this.state; const { formatNavs } = this.state;
......
...@@ -46,6 +46,11 @@ class YarnWish extends Component { ...@@ -46,6 +46,11 @@ class YarnWish extends Component {
http.get(`${API.home}/activity/stage`).then(res => { http.get(`${API.home}/activity/stage`).then(res => {
const {code, data} = res.data const {code, data} = res.data
if (code === 200) { if (code === 200) {
if(Number(data.activity_stage) === 0) {
this.props.history.push('/');
return;
}
this.setState({ this.setState({
activityStage: data.activity_stage // 0-不在活动时间 1-预热 2-正式 3-返场 activityStage: data.activity_stage // 0-不在活动时间 1-预热 2-正式 3-返场
}) })
...@@ -149,7 +154,7 @@ class YarnWish extends Component { ...@@ -149,7 +154,7 @@ class YarnWish extends Component {
list.length > 0 list.length > 0
? <> ? <>
{ {
activityStage === 2 && activityStage !== 1 &&
<> <>
<CommonContainer> <CommonContainer>
...@@ -322,7 +327,7 @@ class YarnWish extends Component { ...@@ -322,7 +327,7 @@ class YarnWish extends Component {
</> </>
} }
{ {
activityStage !== 2 && activityStage === 1 &&
<> <>
<CommonContainer> <CommonContainer>
<div className='groupcourse course-box'> <div className='groupcourse course-box'>
......
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