Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
h5-base
Project
Project
Details
Activity
Releases
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
new-sing
h5-base
Commits
c734d013
Commit
c734d013
authored
Aug 26, 2019
by
chenyishuai@singsingenglish.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
826
parent
9c134c52
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
107 additions
and
115 deletions
+107
-115
audio.vue
src/components/newLesson/audio.vue
+46
-55
index.vue
src/components/newLesson/index.vue
+1
-0
video.vue
src/components/newLesson/video.vue
+57
-57
main.js
src/main.js
+3
-3
No files found.
src/components/newLesson/audio.vue
View file @
c734d013
...
...
@@ -49,7 +49,7 @@
<div
class=
"tips"
>
{{
showObj
.
audio
[
index
].
tips
}}
</div>
</div>
<!-- @click="imgPop=true" -->
<div
:class=
"
{'image-block':true}" ref="imageBlock"
>
<div
:class=
"
{'image-block':true}" ref="imageBlock">
<img
ref=
"imgItem"
@
click=
"ImagePreviewF(index)"
:src=
"showObj.audio[index].image"
/>
</div>
<div
class=
"btnBox"
>
...
...
@@ -141,9 +141,9 @@
<no-finish-dia
/>
</div>
</mt-popup>
<div
v-if=
"imgModel"
class=
'imgBox'
style=
"background: transparent"
>
<div
class=
"box"
>
<img
ref=
"imgItem"
:src=
"showObj.audio[index].image"
/>
<div
v-if=
"imgModel"
class=
"imgBox"
style=
"background: transparent"
>
<div
class=
"box"
>
<img
ref=
"imgItem"
:src=
"showObj.audio[index].image"
/>
</div>
</div>
<div
v-if=
"share_show"
>
...
...
@@ -151,7 +151,8 @@
@
backList=
"backList()"
ref=
"sharePage"
@
closeShare=
"closeShare()"
:contentData=
"contentData"
/>
:contentData=
"contentData"
/>
</div>
<audio
ref=
"audioDom"
id=
"audioDom"
class=
"audio"
:src=
"audioPoint"
></audio>
</div>
...
...
@@ -161,7 +162,7 @@
import
{
Toast
}
from
"vant"
;
import
{
Popup
}
from
"mint-ui"
;
import
tapToVideo
from
"../../assets/tapToVideo.png"
;
import
{
ImagePreview
}
from
'vant'
;
import
{
ImagePreview
}
from
"vant"
;
import
{
getUserCollectApi
,
addUserCollectApi
,
...
...
@@ -187,7 +188,7 @@ export default {
},
data
()
{
return
{
imgModel
:
false
,
imgModel
:
false
,
userCourse
:
{},
finishStuat
:
finishStuat
,
popupVisible
:
false
,
...
...
@@ -212,7 +213,7 @@ export default {
timer
:
null
,
playType
:
Number
(
localStorage
.
getItem
(
"playType"
))
|
0
,
audioPoint
:
""
,
stay_time
:
''
stay_time
:
""
};
},
mounted
()
{
...
...
@@ -223,16 +224,14 @@ export default {
}
},
methods
:
{
ImagePreviewF
(
index
){
ImagePreview
({
images
:
[
this
.
showObj
.
audio
[
index
].
image
,
],
lazyLoad
:
true
,
startPosition
:
0
,
showIndex
:
false
});
},
ImagePreviewF
(
index
)
{
ImagePreview
({
images
:
[
this
.
showObj
.
audio
[
index
].
image
],
lazyLoad
:
true
,
startPosition
:
0
,
showIndex
:
false
});
},
changeStar
(
data
)
{
this
.
star
=
data
;
},
...
...
@@ -762,36 +761,29 @@ export default {
page_id
:
5
,
stay_time
:
lookTime
};
getUserWatchApi
({
category_id
:
query
.
category_id
}).
then
(
res
=>
{
this
.
$store
.
dispatch
(
"setWatchDetail"
,
res
);
subUserLessonApi
(
query
.
elementId
,
query
.
category_id
,
query
.
periods_id
,
json
).
then
(
res
=>
{
lessonDetail
.
total_watch_time
=
res
.
total_watch_time
;
lessonDetail
.
nowTime
=
nowTime
;
lessonDetail
.
star_num
=
res
.
total_star_num
;
localStorage
.
setItem
(
"lessonDetail"
,
JSON
.
stringify
(
lessonDetail
));
});
subUserLessonApi
(
query
.
elementId
,
query
.
category_id
,
query
.
periods_id
,
json
).
then
(
res
=>
{
lessonDetail
.
total_watch_time
=
res
.
total_watch_time
;
lessonDetail
.
nowTime
=
nowTime
;
lessonDetail
.
star_num
=
res
.
total_star_num
;
localStorage
.
setItem
(
"lessonDetail"
,
JSON
.
stringify
(
lessonDetail
));
if
(
(
Number
(
lookTime
)
+
Number
(
lessonDetail
.
total_watch_time
))
/
60
<
7
)
{
this
.
popupVisible2
=
true
;
// debugger
}
else
{
this
.
share_show
=
true
;
}
});
if
(
(
Number
(
lookTime
)
+
Number
(
lessonDetail
.
total_watch_time
))
/
60
<
7
)
{
this
.
popupVisible2
=
true
;
}
else
{
this
.
share_show
=
true
;
setTimeout
(()
=>
{
getUserWatchApi
({
category_id
:
query
.
category_id
}).
then
(
res
=>
{
this
.
$store
.
dispatch
(
"setWatchDetail"
,
res
);
this
.
share_show
=
true
;
// debugger
});
setTimeout
(()
=>
{
if
(
this
.
$store
.
state
.
lookStatus
==
0
)
{
this
.
audioPoint
=
audioGood
;
}
else
if
(
this
.
$store
.
state
.
lookStatus
==
1
)
{
...
...
@@ -799,12 +791,13 @@ export default {
}
else
{
this
.
audioPoint
=
audioPerfect
;
}
this
.
$refs
.
audioDom
.
load
()
setTimeout
(()
=>
{
this
.
$refs
.
audioDom
.
play
()
},
100
)
this
.
$refs
.
audioDom
.
load
()
;
setTimeout
(()
=>
{
this
.
$refs
.
audioDom
.
play
()
;
},
100
);
},
300
);
}
});
// this.$refs.sharePage.playAudio()
// this.$refs.sharePage.initPage()
}
...
...
@@ -858,19 +851,19 @@ export default {
background-size: 40 * @toVw 290 * @toVw;
display: inline-block;
}
.imgBox{
position:fixed;
.imgBox
{
position:
fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
.box{
.box
{
width: 100%;
height: 100vh;
transform: translateX(0px);
img
{
img
{
position: absolute;
width:80vw;
width:
80vw;
margin: auto;
top: 0;
left: 0;
...
...
@@ -878,7 +871,6 @@ export default {
bottom: 0;
}
}
}
._282918034425091245 {
height: 8 * @toVw;
...
...
@@ -1181,8 +1173,7 @@ export default {
padding: 20 * @toVw;
}
}
.mint-popup{
.mint-popup {
}
.imgPop-block {
// max-height: 500 * @toVw;
...
...
@@ -1909,7 +1900,7 @@ export default {
}
</
style
>
<
style
>
.van-image-preview__image
{
.van-image-preview__image
{
/* max-height: 150%; */
/* bottom: none; */
}
...
...
src/components/newLesson/index.vue
View file @
c734d013
...
...
@@ -420,6 +420,7 @@ export default {
localStorage
.
setItem
(
"lessonDetail"
,
JSON
.
stringify
(
lessonDetail
));
});
},
120000
)
debugger
this
.
$store
.
dispatch
(
'setTimeout'
,
this
.
saveTime
)
},
initPage
()
{
...
...
src/components/newLesson/video.vue
View file @
c734d013
...
...
@@ -44,7 +44,8 @@
<div
class=
"video-block hp-video"
v-if=
"showObj.video[videoIndex]"
v-show=
"!share_show && !popupVisible && !star"
>
v-show=
"!share_show && !popupVisible && !star"
>
<video
ref=
"videoDom"
id=
"myVideo"
...
...
@@ -218,19 +219,19 @@ export default {
},
false
);
console
.
log
(
videojs
)
//
console.log(videojs)
},
methods
:
{
activity
()
{},
sliceUrl
(){
sliceUrl
()
{
localStorage
.
setItem
(
"clarityType"
,
this
.
clarityType
);
this
.
showObj
.
video
.
forEach
(
el
=>
{
el
.
url
=
el
.
url
.
slice
(
0
,
el
.
url
.
indexOf
(
"_"
))
+
"_"
+
this
.
clarityType
+
el
.
url
.
slice
(
-
4
);
});
this
.
showObj
.
video
.
forEach
(
el
=>
{
el
.
url
=
el
.
url
.
slice
(
0
,
el
.
url
.
indexOf
(
"_"
))
+
"_"
+
this
.
clarityType
+
el
.
url
.
slice
(
-
4
);
});
},
changeClarity
(
a
)
{
// Toast.loading({
...
...
@@ -241,13 +242,13 @@ export default {
this
.
currentTime
=
this
.
$refs
.
videoDom
.
currentTime
;
if
(
a
==
"1280"
)
{
this
.
clarityType
=
1280
;
this
.
sliceUrl
()
this
.
sliceUrl
()
;
}
else
if
(
a
==
"720"
)
{
this
.
clarityType
=
720
;
this
.
sliceUrl
()
this
.
sliceUrl
()
;
}
else
{
this
.
clarityType
=
540
;
this
.
sliceUrl
()
this
.
sliceUrl
()
;
}
this
.
secClarity
=
false
;
// this.$nextTick(()=>{
...
...
@@ -324,46 +325,42 @@ export default {
page_id
:
5
,
stay_time
:
lookTime
};
getUserWatchApi
({
category_id
:
query
.
category_id
}).
then
(
res
=>
{
this
.
$store
.
dispatch
(
"setWatchDetail"
,
res
);
subUserLessonApi
(
query
.
elementId
,
query
.
category_id
,
query
.
periods_id
,
json
).
then
(
res
=>
{
lessonDetail
.
total_watch_time
=
res
.
total_watch_time
;
lessonDetail
.
nowTime
=
nowTime
;
lessonDetail
.
star_num
=
res
.
total_star_num
;
localStorage
.
setItem
(
"lessonDetail"
,
JSON
.
stringify
(
lessonDetail
));
});
subUserLessonApi
(
query
.
elementId
,
query
.
category_id
,
query
.
periods_id
,
json
).
then
(
res
=>
{
lessonDetail
.
total_watch_time
=
res
.
total_watch_time
;
lessonDetail
.
nowTime
=
nowTime
;
lessonDetail
.
star_num
=
res
.
total_star_num
;
localStorage
.
setItem
(
"lessonDetail"
,
JSON
.
stringify
(
lessonDetail
));
if
(
(
Number
(
lookTime
)
+
Number
(
lessonDetail
.
total_watch_time
))
/
60
<
7
)
{
this
.
popupVisible
=
true
;
}
else
{
this
.
share_show
=
true
;
getUserWatchApi
({
category_id
:
query
.
category_id
}).
then
(
res
=>
{
this
.
$store
.
dispatch
(
"setWatchDetail"
,
res
);
this
.
share_show
=
true
;
// debugger
});
setTimeout
(()
=>
{
if
(
this
.
$store
.
state
.
lookStatus
==
0
)
{
this
.
audioPoint
=
audioGood
;
}
else
if
(
this
.
$store
.
state
.
lookStatus
==
1
)
{
this
.
audioPoint
=
audioGreat
;
}
else
{
this
.
audioPoint
=
audioPerfect
;
}
this
.
$refs
.
audioDom
.
load
();
setTimeout
(()
=>
{
this
.
$refs
.
audioDom
.
play
();
},
100
);
},
300
);
}
});
if
((
Number
(
lookTime
)
+
Number
(
lessonDetail
.
total_watch_time
))
/
60
<
7
)
{
this
.
popupVisible
=
true
;
}
else
{
this
.
share_show
=
true
;
setTimeout
(()
=>
{
if
(
this
.
$store
.
state
.
lookStatus
==
0
)
{
this
.
audioPoint
=
audioGood
;
}
else
if
(
this
.
$store
.
state
.
lookStatus
==
1
)
{
this
.
audioPoint
=
audioGreat
;
}
else
{
this
.
audioPoint
=
audioPerfect
;
}
this
.
$refs
.
audioDom
.
load
();
setTimeout
(()
=>
{
this
.
$refs
.
audioDom
.
play
();
},
100
);
},
300
);
}
},
videoEnd
(
event
)
{
event
.
srcElement
.
play
();
...
...
@@ -380,7 +377,10 @@ export default {
JSON
.
parse
(
localStorage
.
getItem
(
"lessonDetail"
)).
domTitle
.
length
),
elementName
:
JSON
.
parse
(
localStorage
.
getItem
(
"lessonDetail"
)).
domTitle
.
slice
(
0
,
9
)
+
JSON
.
parse
(
localStorage
.
getItem
(
"lessonDetail"
)).
domTitle
.
slice
(
0
,
9
)
+
"-"
+
JSON
.
parse
(
localStorage
.
getItem
(
"lessonDetail"
)).
domTitle
.
slice
(
10
,
...
...
@@ -431,7 +431,7 @@ export default {
videoPlay
()
{
// 神策埋点 点击操作
// this.$refs.videoDom.load()
console
.
log
(
'canplay'
)
console
.
log
(
"canplay"
);
var
video
=
document
.
getElementById
(
"myVideo"
);
if
(
this
.
currentTime
)
{
setTimeout
(()
=>
{
...
...
@@ -439,13 +439,13 @@ export default {
this
.
$refs
.
videoDom
.
currentTime
=
this
.
currentTime
;
this
.
currentTime
=
0
;
},
300
);
// video.addEventListener("canplaythrough", ()=> {
// // console.log(video)
// this.$refs.videoDom.play();
// this.$refs.videoDom.currentTime = this.currentTime;
// this.currentTime = 0;
// // console.log('canplay')
// });
// video.addEventListener("canplaythrough", ()=> {
// // console.log(video)
// this.$refs.videoDom.play();
// this.$refs.videoDom.currentTime = this.currentTime;
// this.currentTime = 0;
// // console.log('canplay')
// });
}
this
.
$sa
.
track
(
"watchClick"
,
{
dayModule
:
JSON
.
parse
(
...
...
@@ -482,7 +482,7 @@ export default {
:
1280
;
if
(
this
.
contentData
.
content
.
age
&&
value
===
2
)
{
let
video
=
[];
video
=
this
.
$common
.
deepCopy
(
this
.
contentData
.
content
.
video
)
video
=
this
.
$common
.
deepCopy
(
this
.
contentData
.
content
.
video
)
;
video
.
forEach
(
el
=>
{
let
str
=
el
.
url
;
if
(
this
.
contentData
.
title
==
2
)
{
...
...
@@ -495,7 +495,7 @@ export default {
};
}
else
{
let
video
=
[];
video
=
this
.
$common
.
deepCopy
(
this
.
contentData
.
content
.
video
)
video
=
this
.
$common
.
deepCopy
(
this
.
contentData
.
content
.
video
)
;
video
.
forEach
(
el
=>
{
let
str
=
el
.
url
;
if
(
this
.
contentData
.
title
==
2
)
{
...
...
@@ -509,7 +509,7 @@ export default {
}
if
(
this
.
$refs
.
itembox
&&
this
.
showObj
.
video
.
length
)
{
this
.
$refs
.
itembox
.
style
.
width
=
this
.
showObj
.
video
.
length
*
this
.
videoWidth
+
"px"
;
this
.
showObj
.
video
.
length
*
this
.
videoWidth
+
"px"
;
}
}
},
...
...
src/main.js
View file @
c734d013
...
...
@@ -41,9 +41,9 @@ if (process.env.NODE_ENV == 'production') {
}
Vue
.
prototype
.
$common
=
common
if
(
process
.
env
.
NODE_ENV
!=
'production'
)
{
new
VConsole
();
}
//
if (process.env.NODE_ENV != 'production') {
//
new VConsole();
//
}
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
next
()
...
...
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