Commit 786efef2 by zhanghaozhe

Merge branch 'limit-free' into dev

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