Commit 786efef2 by zhanghaozhe

Merge branch 'limit-free' into dev

parents 9151ad2c f9c3641f
......@@ -103,9 +103,10 @@ class Video extends Component {
singleType: 1,// 单集购买需要
nowPrice: 0,// 单集购买需要
laterPrice: 0,// 单集购买需要
limitFreeNoPromptChecked: false,
limitFreeNoPromptChecked: false,//是否勾选"不再显示此弹框"选项
showLimitFreePopup: false,
limitFreePopup: {}
limitFreePopup: {},
isShowNeverShowPopupOption: false //限时免费课程 播放结束后是否显示"不再显示此弹框"选项
}
......@@ -152,7 +153,6 @@ class Video extends Component {
}
// 购买单集
toSingleset = (item) => {
// console.log(item);
this.setState({
singleBox: true,
singleType: 1,
......@@ -360,7 +360,6 @@ class Video extends Component {
const data = JSON.parse(e.data);
data.code == 4040 && (this.reconnect = false);
if (data.code === 0) {
console.log("上次的学习记录" + JSON.stringify(data));
if (data.data && data.data.position) {
this.player.currentTime(data.data.position);
}
......@@ -398,7 +397,6 @@ class Video extends Component {
countSchedule = () => {
const {videoList, activeIndex, vCourseId, course = {}} = this.state
if (Number(course.course_id) === 0 || course.course_id === '') {
console.log('免费课程 拦截');
return;
}
let ctype = 0;
......@@ -423,7 +421,6 @@ class Video extends Component {
const {videoList, activeIndex, vCourseId, course = {}} = this.state
// 免费课程不发送
// if (Number(course.course_id) === 0 || course.course_id === '') {
// console.log('免费课程 拦截');
// return;
// }
// 时间为0 不发送消息
......@@ -436,7 +433,6 @@ class Video extends Component {
}
// 时间足够不发送
// if(this.timeEnough) {
// console.log('5001 时间足够');
// return;
// }
this.sendMessage({
......@@ -560,7 +556,6 @@ class Video extends Component {
if (index === this.state.activeIndex) {
return
}
console.log('selectVideo 先发送时间 再发送进度 在重置定时器');
this.isCurrentVideoFirstPlay = true; // 切换视频则重置这个变量 因为新视频肯定是首次播放
this.sendWatchTime(this.watchSec, this.currentPlaybackRate)
this.countSchedule(); // 计算进度 -- 选择新视频(可能是M端特有的)
......@@ -624,7 +619,6 @@ class Video extends Component {
// is_aist,是否AI特训营
const {course = {}} = this.state;
// if (Number(course.course_id) === 0 || course.course_id === '') {
// console.log('免费课程 拦截');
// }else{
let _this = this;
this.setupWS();
......@@ -760,6 +754,9 @@ class Video extends Component {
})
}
checkNeverShowLimitFreePopup = () => {
if (!this.state.limitFreeNoPromptChecked) {
return
}
http.post(`${API.home}/sys/checklist`, {
course_id: this.state.course.course_id
})
......@@ -770,7 +767,7 @@ class Video extends Component {
limitFreePopup: {...this.state.limitFreePopup, is_free: 0}
})
}else {
} else {
Toast.info(msg, 2, null, false)
}
......@@ -788,7 +785,8 @@ class Video extends Component {
singleBox,
singleType,
showLimitFreePopup,
limitFreePopup
limitFreePopup,
isShowNeverShowPopupOption
} = this.state;
let toHref = '';
if (location.state && location.state.to && location.state.to === 'detail') {
......@@ -934,8 +932,11 @@ class Video extends Component {
<span>长按/扫码识别</span>
<span>添加时请备注<span>{course.course_id}</span>哦</span>
<div className="no-prompt">
{
isShowNeverShowPopupOption &&
<label htmlFor="no-prompt">
<span className={`checkbox-label ${this.state.limitFreeNoPromptChecked ? 'checked' : 'unchecked'}`}>
<span
className={`checkbox-label ${this.state.limitFreeNoPromptChecked ? 'checked' : 'unchecked'}`}>
<i className={'iconfont iconiconfront-73'}/>
</span>
<input type="checkbox" id={'no-prompt'} onChange={(e) => {
......@@ -945,11 +946,13 @@ class Video extends Component {
}}/>
<span>本课程不再提示</span>
</label>
}
</div>
</div>
<i className={'close-btn iconfont iconiconfront-2'} onClick={() => {
this.setState({
showLimitFreePopup: false
showLimitFreePopup: false,
isShowNeverShowPopupOption: true
})
this.checkNeverShowLimitFreePopup()
}}/>
......
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