Commit 217f0976 by xuzhenghua

pull

parent 043f3d73
...@@ -135,8 +135,9 @@ class BlessingGetPrize extends Component { ...@@ -135,8 +135,9 @@ class BlessingGetPrize extends Component {
{ {
(!prize_data || prize_data.length === 0) && ( (!prize_data || prize_data.length === 0) && (
<div className="active_over_container"> <div className="active_over_container">
<img src='https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/acitve__over.png' alt=''/> <p>AI充电节返场已开启</p>
<p>七月在线双十一抽奖活动已结束, 感谢你的参与!</p> <p>狂欢不能停~</p>
<a href='/blessingPreheat' className='to_active'>立即查看</a>
</div> </div>
) )
} }
......
...@@ -199,22 +199,30 @@ ...@@ -199,22 +199,30 @@
.active_over_container { .active_over_container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: center;
align-items: center; align-items: center;
margin-top: 70px; width: 340px;
img { height: 156px;
width: 170px; margin: 4px auto;
height: 134px; background: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/active_over.png') center center no-repeat;
} background-size: 100% 100%;
p { p {
width:238px; font-size:18px;
height:39px; font-weight:500;
font-size:16px; color:rgba(76,33,239,1);
font-weight:400; line-height:27px;
}
.to_active {
width:298px;
height:44px;
background:linear-gradient(90deg,rgba(255,105,5,1) 0%,rgba(255,180,5,1) 100%);
border-radius:5px;
font-size:18px;
font-weight:500;
color:rgba(255,255,255,1); color:rgba(255,255,255,1);
line-height:24px; display: flex;
text-align: center; justify-content: center;
text-align-last: center; align-items: center;
margin-top: 20px; margin-top: 20px;
} }
} }
......
...@@ -64,7 +64,7 @@ class Banner extends Component { ...@@ -64,7 +64,7 @@ class Banner extends Component {
// } else { // } else {
// !nav.classList.contains('fixed') && nav.classList.add('fixed') // !nav.classList.contains('fixed') && nav.classList.add('fixed')
// } // }
// if (swipeDirection === 'up') { // if (swipeDirection === 'up') {
// if (y + 30 + 30 >= top) { // if (y + 30 + 30 >= top) {
// this.setState({ // this.setState({
...@@ -80,7 +80,7 @@ class Banner extends Component { ...@@ -80,7 +80,7 @@ class Banner extends Component {
// } // }
// this.prevY = y // this.prevY = y
// } // }
// } // }
// toSection = (i, e) => { // toSection = (i, e) => {
...@@ -97,10 +97,10 @@ class Banner extends Component { ...@@ -97,10 +97,10 @@ class Banner extends Component {
render() { render() {
const { toSection, navs, index, isFormal } = this.props; const { toSection, navs, index, isFormal, onlyShow } = this.props;
return ( return (
<div id={'main-banner'}> <div id={'main-banner'}>
<div className={`banner ${isFormal ? 'formal_banner' : ''}`}></div> <div className={`banner ${isFormal ? 'formal_banner' : ''} ${onlyShow ? 'fc_banner' : ''}`}></div>
<nav id={'main-nav'}> <nav id={'main-nav'}>
<ul> <ul>
{ {
......
#main-banner{ #main-banner{
overflow: auto; overflow: auto;
margin-bottom: 70px;
.banner{ .banner{
width: 375px; width: 375px;
height: 183px; height: 183px;
...@@ -11,6 +10,10 @@ ...@@ -11,6 +10,10 @@
background: url("https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/formal_banner.png") no-repeat; background: url("https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/formal_banner.png") no-repeat;
background-size: contain; background-size: contain;
} }
.fc_banner {
background: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/fc_banner.png') center center no-repeat;
background-size: 100% 100%;
}
#main-nav{ #main-nav{
position: absolute; position: absolute;
top: 183px; top: 183px;
......
...@@ -28,7 +28,7 @@ class CollectBlessing extends Component { ...@@ -28,7 +28,7 @@ class CollectBlessing extends Component {
range: '50~100', range: '50~100',
rules: [ rules: [
{id: 1, text: '1.每天一次抽奖机会;'}, {id: 1, text: '1.每天一次抽奖机会;'},
{id: 2, text: '2.中奖概率翻2倍', des: '(热力值越高,中奖概率越大);'}, {id: 2, text: '2.中奖概率翻2倍', des: '(福气值越高,中奖概率越大);'},
{id: 3, text: '3.满111减11、满1111减111。'}, {id: 3, text: '3.满111减11、满1111减111。'},
] ]
}, },
...@@ -36,7 +36,7 @@ class CollectBlessing extends Component { ...@@ -36,7 +36,7 @@ class CollectBlessing extends Component {
range: '101~190', range: '101~190',
rules: [ rules: [
{id: 1, text: '1.每天两次抽奖机会;'}, {id: 1, text: '1.每天两次抽奖机会;'},
{id: 2, text: '2.中奖概率翻3倍', des: '(热力值越高,中奖概率越大);'}, {id: 2, text: '2.中奖概率翻3倍', des: '(福气值越高,中奖概率越大);'},
{id: 3, text: '3.满111减31、满1111减211;'}, {id: 3, text: '3.满111减31、满1111减211;'},
{id: 4, text: '4.AI水平测试增加1次。'}, {id: 4, text: '4.AI水平测试增加1次。'},
] ]
...@@ -45,7 +45,7 @@ class CollectBlessing extends Component { ...@@ -45,7 +45,7 @@ class CollectBlessing extends Component {
range: '>190', range: '>190',
rules: [ rules: [
{id: 1, text: '1.每天三次抽奖机会;'}, {id: 1, text: '1.每天三次抽奖机会;'},
{id: 2, text: '2.中奖概率翻4倍', des: '(热力值越高,中奖概率越大);'}, {id: 2, text: '2.中奖概率翻4倍', des: '(福气值越高,中奖概率越大);'},
{id: 3, text: '3.满111减51、满1111减411;'}, {id: 3, text: '3.满111减51、满1111减411;'},
{id: 4, text: '4.AI水平测试增加2次。'}, {id: 4, text: '4.AI水平测试增加2次。'},
] ]
...@@ -138,7 +138,7 @@ class CollectBlessing extends Component { ...@@ -138,7 +138,7 @@ class CollectBlessing extends Component {
if(code === 200) { if(code === 200) {
if(data.today_shared_platforms.some(item => item === key)) { if(data.today_shared_platforms.some(item => item === key)) {
handleToShowShare(); handleToShowShare();
Toast.info('今日已分享,记得明天来~', 2, null, false); Toast.info('今日已+2点福气值”~', 2, null, false);
}else { }else {
handleToShowShare(); handleToShowShare();
this.shareTimer && clearInterval(this.shareTimer); this.shareTimer && clearInterval(this.shareTimer);
......
...@@ -34,35 +34,35 @@ class FormalDraw extends Component { ...@@ -34,35 +34,35 @@ class FormalDraw extends Component {
} }
shouldComponentUpdate(nextProps, nextState, nextContext) { shouldComponentUpdate(nextProps, nextState, nextContext) {
if(this.props.isApp !== nextProps.isApp) { if (this.props.isApp !== nextProps.isApp) {
this.getPrizeData() this.getPrizeData()
return false; return false
} }
return true; return true
} }
getPrizeData = () => { getPrizeData = () => {
http.get(`${API.home}/sys/activity/prize_data`) http.get(`${API.home}/sys/activity/prize_data`)
.then(res => { .then(res => {
const {data, code, msg} = res.data const {data, code, msg} = res.data
if (code == 200) { if (code == 200) {
const {today} = data.value let oneDay = data.list.find(item => item.date === data.value.today) || data.list[0]
const oneDay = data.list.filter(item => item.date === data.value.today) const today = oneDay.date
const activeIndex = oneDay[0]['son'].findIndex(item => item.status == 3) const activeIndex = oneDay['son'].findIndex(item => item.status == 3)
this.setState({ this.setState({
tabs: data.list.map(item => ({title: item.date})), tabs: data.list.map(item => ({title: item.date})),
today, today,
initialPageIndex: data.list.findIndex(item => item.date == today) || 0, initialPageIndex: data.list.findIndex(item => item.date == today) || 0,
list: data.list, list: data.list,
userValue: data.value, userValue: data.value,
activeTimeRangeIndex: activeIndex < 0 ? 0 : activeIndex activeTimeRangeIndex: activeIndex < 0 ? 0 : activeIndex
}, () => { }, () => {
this.initializeSwiper() this.initializeSwiper()
}) })
} else { } else {
Toast.info(msg, 2, null, false) Toast.info(msg, 2, null, false)
} }
}) })
} }
initializeSwiper = () => { initializeSwiper = () => {
...@@ -161,25 +161,40 @@ class FormalDraw extends Component { ...@@ -161,25 +161,40 @@ class FormalDraw extends Component {
if (this.subscribePopupInstance) { if (this.subscribePopupInstance) {
return return
} }
http.get(`${API["base-api"]}/sys/activity/create_pre_qrcode`,{params:{id}}) if (!this.state.userValue['is_pre']) {
.then(res => { http.get(`${API["base-api"]}/sys/activity/create_pre_qrcode`, {params: {id}})
const {code, data, msg} = res.data .then(res => {
if (code == 200) { const {code, data, msg} = res.data
this.subscribePopupInstance = QRCode.toDataURL(data.url, (err, url) => { if (code == 200) {
Popup({ this.subscribePopupInstance = QRCode.toDataURL(data.url, (err, url) => {
title: '微信扫码“七月在线”服务号即可预约', Popup({
className: 'subscribe', title: '微信扫码“七月在线”服务号即可预约',
content: <img src={url} alt="" className="qr-code"/>, className: 'subscribe',
close: () => new Promise(resolve => { content: <img src={url} alt="" className="qr-code"/>,
this.subscribePopupInstance = null close: () => new Promise(resolve => {
resolve() this.subscribePopupInstance = null
resolve()
})
}) })
}) })
}) } else {
} else { Toast.info(msg, 2, null, false)
Toast.info(msg, 2, null, false) }
} })
}) } else {
http.get(`${API["base-api"]}/activity_pre/${id}`)
.then(res => {
const {code} = res.data
if (code == 200) {
Toast.info('预约成功', 2, null, false)
}
})
.catch(err => {
console.log(err)
})
}
} }
render() { render() {
......
#formal-draw { #formal-draw {
position: relative; position: relative;
width: 355px; width: 355px;
min-height: 147px;
background: rgba(57, 0, 201, 1); background: rgba(57, 0, 201, 1);
border: 1px solid rgba(89, 112, 255, 1); border: 1px solid rgba(89, 112, 255, 1);
border-radius: 5px; border-radius: 5px;
margin: 0 auto; margin: 0 auto;
.am-tabs-content-wrap {
min-height: 423px;
}
&::before { &::before {
content: ''; content: '';
display: block; display: block;
......
...@@ -51,6 +51,7 @@ class BlessingPreheat extends Component { ...@@ -51,6 +51,7 @@ class BlessingPreheat extends Component {
timelineShareVisible: false, timelineShareVisible: false,
showRecordList: false, showRecordList: false,
isFormal: false, // 1正式 0 预热 isFormal: false, // 1正式 0 预热
onlyShow: false, // 14号返场
isServer: false, isServer: false,
serverUrl: '', serverUrl: '',
shareMark: false, shareMark: false,
...@@ -104,6 +105,28 @@ class BlessingPreheat extends Component { ...@@ -104,6 +105,28 @@ class BlessingPreheat extends Component {
id: 'live' id: 'live'
}, },
], ],
encoreNavs: [
{
text: '精品特惠',
id: 'best-courses'
},
{
text: '大咖直播',
id: 'live'
},
{
text: '幸运大抽奖',
id: 'lucky-draw'
},
{
text: '积福气',
id: 'lucky-value'
},
{
text: 'AI测试',
id: 'ai-test'
},
],
index: 0, index: 0,
userHasError: props.user.hasError, userHasError: props.user.hasError,
isApp: false, isApp: false,
...@@ -119,9 +142,13 @@ class BlessingPreheat extends Component { ...@@ -119,9 +142,13 @@ class BlessingPreheat extends Component {
} }
componentDidMount() { componentDidMount() {
const _this = this;
this.fetchUserBlessing() this.fetchUserBlessing()
this.setInitialNavActiveStatus() // setTimeout(function(){
window.addEventListener('scroll', throttle(this.calcNavActive, 100)) // // 这里有获取ID的步骤,由于运营过多的调整,导致顺序不定,所以包含ID的title必须要放到判断中(防止出现多个title),设置定时器是因为如果返回较慢 获取不到ID导致报错
// _this.setInitialNavActiveStatus()
// }, 50);
// window.addEventListener('scroll', throttle(this.calcNavActive, 100))
if (is_weixin()) { if (is_weixin()) {
wxShare({ wxShare({
title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!', title: 'AI充电节,积福气享1折秒课,超10万元奖品来就送!!',
...@@ -155,9 +182,12 @@ class BlessingPreheat extends Component { ...@@ -155,9 +182,12 @@ class BlessingPreheat extends Component {
} }
componentWillUpdate() { componentWillUpdate() {
const {isFormal} = this.state; const {isFormal,onlyShow} = this.state;
if(isFormal === 1) { if(isFormal === 1) {
document.title = `11.11-11.13 AI充电节,为AI出击!重磅好课1折秒,海量奖品来就送-七月在线` document.title = `11.11-11.13 AI充电节,为AI出击!重磅好课1折秒,海量奖品来就送-七月在线`
if(onlyShow) {
document.title = `11.14 AI充电节 返场钜惠!200本纸质书送完即止!`
}
}else{ }else{
document.title = `11.11-11.13 AI充电节,预热来袭!积福气享1折秒课,海量奖品来就送-七月在线` document.title = `11.11-11.13 AI充电节,预热来袭!积福气享1折秒课,海量奖品来就送-七月在线`
} }
...@@ -237,6 +267,9 @@ class BlessingPreheat extends Component { ...@@ -237,6 +267,9 @@ class BlessingPreheat extends Component {
return findIndex(navs, item => item.id === str) return findIndex(navs, item => item.id === str)
} }
componentWillUnmount () {
window.removeEventListener('scroll', this.calcNavActive);
}
setInitialNavActiveStatus = () => { setInitialNavActiveStatus = () => {
const observer = new MutationObserver(debounce((list, observer) => { const observer = new MutationObserver(debounce((list, observer) => {
...@@ -254,11 +287,26 @@ class BlessingPreheat extends Component { ...@@ -254,11 +287,26 @@ class BlessingPreheat extends Component {
} }
initNav = (isFormal) => { initNav = (isFormal) => {
const {formalNavs} = this.state const {formalNavs, onlyShow, encoreNavs} = this.state
if (isFormal) { if (isFormal) {
this.setState({ if(onlyShow) {
navs: formalNavs this.setState({
}) navs: encoreNavs
}, () => {
this.setInitialNavActiveStatus()
window.addEventListener('scroll', throttle(this.calcNavActive, 100))
})
} else {
this.setState({
navs: formalNavs
}, () => {
this.setInitialNavActiveStatus()
window.addEventListener('scroll', throttle(this.calcNavActive, 100))
})
}
} }
} }
...@@ -269,12 +317,21 @@ class BlessingPreheat extends Component { ...@@ -269,12 +317,21 @@ class BlessingPreheat extends Component {
fetchUserBlessing = () => { fetchUserBlessing = () => {
const {userInfo} = this.state const {userInfo} = this.state
const {history} = this.props;
http.get(`${API.home}/sys/user/blessing`).then(res => { http.get(`${API.home}/sys/user/blessing`).then(res => {
const {code, data} = res.data const {code, data} = res.data
if (code === 200) { if (code === 200) {
this.setState({ if(data.is_over) {
if(!getParam('version')) {
history.push('/');
} else {
SendMessageToApp("toQualityCourse");
}
}
this.setState(()=>({
isSign: !!data.today_signed, isSign: !!data.today_signed,
isFormal: data.is_activity, isFormal: data.is_activity,
onlyShow: data.onlyShow,
testSum: parseInt(data.user_test_total, 10) || 0, testSum: parseInt(data.user_test_total, 10) || 0,
userInfo: Object.assign({}, userInfo, { userInfo: Object.assign({}, userInfo, {
isFollow: data.subscribed, isFollow: data.subscribed,
...@@ -282,7 +339,7 @@ class BlessingPreheat extends Component { ...@@ -282,7 +339,7 @@ class BlessingPreheat extends Component {
buyBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.buy_course) ? data.types_total_blessing_value.buy_course : 0, buyBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.buy_course) ? data.types_total_blessing_value.buy_course : 0,
inviteBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.invite) ? data.types_total_blessing_value.invite : 0, inviteBlessing: (data.types_total_blessing_value && data.types_total_blessing_value.invite) ? data.types_total_blessing_value.invite : 0,
}) })
}) }));
if (data.is_login === 1) { if (data.is_login === 1) {
this.handleToSign() this.handleToSign()
} }
...@@ -411,14 +468,23 @@ class BlessingPreheat extends Component { ...@@ -411,14 +468,23 @@ class BlessingPreheat extends Component {
calcNavActive = () => { calcNavActive = () => {
const {navs, index} = this.state const {navs, index} = this.state
const y = window.scrollY const y = window.scrollY
let swipeDirection = y > this.prevY ? 'up' : 'down' let swipeDirection = y > this.prevY ? 'up' : 'down'
let _index let _index
if (swipeDirection === 'up') { if (swipeDirection === 'up') {
_index = (index + 1) >= navs.length ? index : index + 1 if(Number.isInteger(index)){
_index = (index + 1) >= navs.length ? index : index + 1
}else {
_index = 0
}
} else { } else {
_index = (index - 1) <= 0 ? 0 : index - 1 if(Number.isInteger(index)){
_index = (index - 1) <= 0 ? 0 : index - 1
}else {
_index = 0
}
} }
let el = document.querySelector(`#${navs[_index].id}`) let el = document.querySelector(`#${navs[_index].id}`)
let nav = document.querySelector('#main-nav') let nav = document.querySelector('#main-nav')
...@@ -565,6 +631,7 @@ class BlessingPreheat extends Component { ...@@ -565,6 +631,7 @@ class BlessingPreheat extends Component {
testSum, testSum,
address, address,
addressPopupVisible, addressPopupVisible,
onlyShow,
} = this.state } = this.state
const {history} = this.props const {history} = this.props
const isLogin = !this.props.user.hasError const isLogin = !this.props.user.hasError
...@@ -575,13 +642,40 @@ class BlessingPreheat extends Component { ...@@ -575,13 +642,40 @@ class BlessingPreheat extends Component {
navs={navs} navs={navs}
toSection={this.toSection} toSection={this.toSection}
index={index} index={index}
onlyShow={onlyShow}
/> />
{/* 精品课程特惠专区--返场 */}
{
onlyShow && (
<>
<ListHeader id={'best-courses'} text="精品课程特惠专区" styles={{margin: '60px 0 15px'}}/>
<CourseList
isApp={isApp}
isFormal={isFormal}
isLogin={isLogin}
history={this.props.history}
toLogin={this.toLogin}
/>
</>
)
}
{/* 大咖直播--返场 */}
{
onlyShow && <Live isFormal={isFormal} isLogin={isLogin}/>
}
{/* 抽奖--正式 */} {/* 抽奖--正式 */}
{ {
isFormal === 1 && isFormal === 1 &&
<> <>
<ListHeader id={'lucky-draw'} text="幸运大抽奖" styles={{margin: '30px 0 10px'}}/> <ListHeader id={'lucky-draw'} text="幸运大抽奖" styles={{margin: onlyShow ? '30px 0 10px' : '60px 0 10px'}}/>
{
onlyShow ? (
<p className='active_over'>活动已结束</p>
) : null
}
<div className="formal-draw-btns"> <div className="formal-draw-btns">
<button className="luck-draw__button" onClick={() => this.handleToShow('isRule')}>活动规则></button> <button className="luck-draw__button" onClick={() => this.handleToShow('isRule')}>活动规则></button>
<button className='prize-record' onClick={this.getMyPrizeRecord}>中奖记录></button> <button className='prize-record' onClick={this.getMyPrizeRecord}>中奖记录></button>
...@@ -593,7 +687,12 @@ class BlessingPreheat extends Component { ...@@ -593,7 +687,12 @@ class BlessingPreheat extends Component {
{/* 积福气 */} {/* 积福气 */}
<ListHeader id={'lucky-value'} text="积福气,享受更多福利" styles={{margin: '30px 0 15px'}}/> <ListHeader id={'lucky-value'} text="积福气,享受更多福利" styles={{margin: '30px 0 15px'}}/>
<Link className="luck-draw__button" to="/blessingRank">福气排行榜></Link> {
onlyShow ? (
<p className='active_over'>活动已结束</p>
) : null
}
<Link className="blessing__sort" to="/blessingRank"></Link>
<CollectBlessing <CollectBlessing
...@@ -630,14 +729,20 @@ class BlessingPreheat extends Component { ...@@ -630,14 +729,20 @@ class BlessingPreheat extends Component {
} }
{/* 精品课程特惠专区 */} {/* 精品课程特惠专区 */}
<ListHeader id={'best-courses'} text="精品课程特惠专区" styles={{margin: '30px 0 15px'}}/> {
<CourseList !onlyShow && (
isApp={isApp} <>
isFormal={isFormal} <ListHeader id={'best-courses'} text="精品课程特惠专区" styles={{margin: '30px 0 15px'}}/>
isLogin={isLogin} <CourseList
history={this.props.history} isApp={isApp}
toLogin={this.toLogin} isFormal={isFormal}
/> isLogin={isLogin}
history={this.props.history}
toLogin={this.toLogin}
/>
</>
)
}
{ {
isRule && isRule &&
...@@ -660,7 +765,11 @@ class BlessingPreheat extends Component { ...@@ -660,7 +765,11 @@ class BlessingPreheat extends Component {
<SharePopup isClose={isClose} toClose={() => this.handleToHide('shareMark')}/> <SharePopup isClose={isClose} toClose={() => this.handleToHide('shareMark')}/>
} }
<ListHeader id={'ai-test'} text="全国AI工程师水平测试" styles={{margin: '30px 0 15px'}}/> <ListHeader id={'ai-test'} text="全国AI工程师水平测试" styles={{margin: '30px 0 15px'}}/>
{
onlyShow ? (
<p className='active_over'>活动已结束</p>
) : null
}
<div className="test__record" onClick={() => this.handleToShow('showRecordList', true)}> <div className="test__record" onClick={() => this.handleToShow('showRecordList', true)}>
测试记录> 测试记录>
</div> </div>
...@@ -674,7 +783,11 @@ class BlessingPreheat extends Component { ...@@ -674,7 +783,11 @@ class BlessingPreheat extends Component {
<RankList></RankList> <RankList></RankList>
<Live isFormal={isFormal} isLogin={isLogin}/> {/* 大咖直播 -- 正式活动 */}
{
!onlyShow && <Live isFormal={isFormal} isLogin={isLogin}/>
}
{ {
addressPopupVisible && addressPopupVisible &&
<div className="address-mask"> <div className="address-mask">
...@@ -692,7 +805,7 @@ class BlessingPreheat extends Component { ...@@ -692,7 +805,7 @@ class BlessingPreheat extends Component {
/> />
<input type="tel" <input type="tel"
placeholder={'联系方式'} placeholder={'联系方式'}
name={'tel'} name={'phone'}
onChange={e => { onChange={e => {
this.setAddressState(e) this.setAddressState(e)
}} }}
......
#blessing-preheat { #blessing-preheat {
background: #5327FA; background: #5327FA;
padding-bottom: 30px;
.active_over {
font-size: 20px;
color: #fff604;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 10px;
}
} }
.test__record { .test__record {
...@@ -76,6 +87,14 @@ ...@@ -76,6 +87,14 @@
cursor: pointer; cursor: pointer;
outline: none; outline: none;
} }
.blessing__sort {
display: block;
margin: 0 auto 15px;
width: 120px;
height: 28px;
background: url('https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/m/m11_enter_icon.png') center center no-repeat;
background-size: 100% 100%;
}
.formal-draw-btns { .formal-draw-btns {
display: flex; display: flex;
......
...@@ -29,6 +29,10 @@ class LevelTest extends Component { ...@@ -29,6 +29,10 @@ class LevelTest extends Component {
{ {
url: url:
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/AIExam/top8-10.png" "https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/AIExam/top8-10.png"
},
{
url:
"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/active19_1111/AIExam/top11-20.png"
} }
], ],
} }
......
.list-frame { .list-frame {
margin: 0 10px; margin: 0 10px;
min-height: 147px;
border: 1px solid #5970FF; border: 1px solid #5970FF;
border-radius: 5px; border-radius: 5px;
background-color: #3900C9; background-color: #3900C9;
......
...@@ -30,8 +30,8 @@ class Live extends Component { ...@@ -30,8 +30,8 @@ class Live extends Component {
const {data, code, msg} = res.data const {data, code, msg} = res.data
if (code == 200) { if (code == 200) {
let tabs = uniqBy(data, item => item.date) let tabs = uniqBy(data, item => item.date)
let todayIndex = tabs.findIndex(item => item['is_today'])
tabs = tabs.map(item => ({title: item.date})) tabs = tabs.map(item => ({title: item.date}))
let todayIndex = data.findIndex(item => item['is_today'])
this.setState({ this.setState({
tabs, tabs,
...@@ -87,6 +87,21 @@ class Live extends Component { ...@@ -87,6 +87,21 @@ class Live extends Component {
} }
} }
checkVideo = (url) => {
let version = getParam('version');
const {history, user} = this.props;
if(!version) {
if (user.hasError) {
this.toLogin()
}else{
const vCourseId = url.split('/')[0];
history.push(`/play/video?id=${vCourseId}`)
}
}else{
Toast.info('当前版本不支持此功能,请前往h5/pc查看回放该直播', 2, null, false);
}
}
makeSubscribe = id => { makeSubscribe = id => {
const {user} = this.props const {user} = this.props
if (user.hasError) { if (user.hasError) {
...@@ -161,7 +176,7 @@ class Live extends Component { ...@@ -161,7 +176,7 @@ class Live extends Component {
todayLives && todayLives.map((item, index) => { todayLives && todayLives.map((item, index) => {
return ( return (
<LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe} <LiveContent item={item} key={index} makeSubscribe={this.makeSubscribe}
toLiveRoom={this.toLiveRoom}/> toLiveRoom={this.toLiveRoom} checkVideo={this.checkVideo}/>
) )
}) })
} }
...@@ -178,7 +193,7 @@ class Live extends Component { ...@@ -178,7 +193,7 @@ class Live extends Component {
} }
} }
function LiveContent({item, makeSubscribe, toLiveRoom}) { function LiveContent({item, makeSubscribe, toLiveRoom, checkVideo}) {
return ( return (
<div className="content"> <div className="content">
{ {
...@@ -217,7 +232,7 @@ function LiveContent({item, makeSubscribe, toLiveRoom}) { ...@@ -217,7 +232,7 @@ function LiveContent({item, makeSubscribe, toLiveRoom}) {
}}>正在直播</button> }}>正在直播</button>
: :
item['is_end'] item['is_end']
? <button className={'subscribed'}>已结束</button> ? item.transcribe_url === '' ? <button className={'subscribed'}>已结束</button> : <button className={'on-living'} onClick={() => checkVideo(item.transcribe_url)}>查看回放</button>
: item['is_subscribe'] : item['is_subscribe']
? <button className={'subscribed'}>已预约</button> ? <button className={'subscribed'}>已预约</button>
: <button className={'subscribe'} : <button className={'subscribe'}
......
...@@ -176,6 +176,10 @@ ...@@ -176,6 +176,10 @@
} }
.am-tabs-content-wrap {
min-height: 423px;
}
.am-tabs { .am-tabs {
width: 330px; width: 330px;
margin: 0 auto; margin: 0 auto;
......
...@@ -12,7 +12,7 @@ export default class RankList extends Component { ...@@ -12,7 +12,7 @@ export default class RankList extends Component {
} }
componentDidMount() { componentDidMount() {
http.get(`${API.home}/sys/ai_test/ranking/10`).then(res => { http.get(`${API.home}/sys/ai_test/ranking/50`).then(res => {
let data = res.data.data; let data = res.data.data;
let code = res.data.code; let code = res.data.code;
if(code === 200) { if(code === 200) {
...@@ -42,7 +42,7 @@ export default class RankList extends Component { ...@@ -42,7 +42,7 @@ export default class RankList extends Component {
<> <>
<ListHeader text="测试排行榜" styles={{margin: '20px 0 10px'}} size='middle' /> <ListHeader text="测试排行榜" styles={{margin: '20px 0 10px'}} size='middle' />
<div className="sort__rules"> <div className="sort__rules">
仅显示前10 仅显示前50
</div> </div>
<div className="rank__list_module"> <div className="rank__list_module">
<div className="rank__table_head"> <div className="rank__table_head">
......
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
} }
.rank__table_body { .rank__table_body {
height: 504px;
overflow: auto;
.table__tr { .table__tr {
height: 48px; height: 48px;
display: flex; display: flex;
......
...@@ -24,8 +24,8 @@ export default class RecordPopup extends Component { ...@@ -24,8 +24,8 @@ export default class RecordPopup extends Component {
handleToTestRecord = (e, id) => { handleToTestRecord = (e, id) => {
e.preventDefault(); e.preventDefault();
const { history } = this.props; const { history } = this.props;
if(getParam('version')) { if(!getParam('version')) {
location.href = `${API.m}/levelTest/report?id=${id}&version=${getParam('version')}`; location.href = `${API.m}/levelTest/report?id=${id}`;
} else { } else {
location.href = `${API.m}/levelTest/report?id=${id}&version=${getParam('version')}`; location.href = `${API.m}/levelTest/report?id=${id}&version=${getParam('version')}`;
} }
......
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