Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
786efef2
Commit
786efef2
authored
Mar 13, 2020
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'limit-free' into dev
parents
9151ad2c
f9c3641f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
23 deletions
+26
-23
src/components/video/index.js
+26
-23
No files found.
src/components/video/index.js
View file @
786efef2
...
...
@@ -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,22 +932,27 @@ class Video extends Component {
<
span
>
长按
/
扫码识别
<
/span
>
<
span
>
添加时请备注
<
span
>
{
course
.
course_id
}
<
/span>哦</
span
>
<
div
className
=
"no-prompt"
>
<
label
htmlFor
=
"no-prompt"
>
<
span
className
=
{
`checkbox-label
${
this
.
state
.
limitFreeNoPromptChecked
?
'checked'
:
'unchecked'
}
`
}
>
<
i
className
=
{
'iconfont iconiconfront-73'
}
/
>
<
/span
>
<
input
type
=
"checkbox"
id
=
{
'no-prompt'
}
onChange
=
{(
e
)
=>
{
this
.
setState
({
limitFreeNoPromptChecked
:
e
.
target
.
checked
})
}}
/
>
<
span
>
本课程不再提示
<
/span
>
<
/label
>
{
isShowNeverShowPopupOption
&&
<
label
htmlFor
=
"no-prompt"
>
<
span
className
=
{
`checkbox-label
${
this
.
state
.
limitFreeNoPromptChecked
?
'checked'
:
'unchecked'
}
`
}
>
<
i
className
=
{
'iconfont iconiconfront-73'
}
/
>
<
/span
>
<
input
type
=
"checkbox"
id
=
{
'no-prompt'
}
onChange
=
{(
e
)
=>
{
this
.
setState
({
limitFreeNoPromptChecked
:
e
.
target
.
checked
})
}}
/
>
<
span
>
本课程不再提示
<
/span
>
<
/label
>
}
<
/div
>
<
/div
>
<
i
className
=
{
'close-btn iconfont iconiconfront-2'
}
onClick
=
{()
=>
{
this
.
setState
({
showLimitFreePopup
:
false
showLimitFreePopup
:
false
,
isShowNeverShowPopupOption
:
true
})
this
.
checkNeverShowLimitFreePopup
()
}}
/
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment