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
5e0a77ec
Commit
5e0a77ec
authored
Dec 27, 2018
by
wangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
神策埋点
parent
d6c6d172
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
144 additions
and
28 deletions
+144
-28
index.vue
src/components/map/index.vue
+5
-5
audio.vue
src/components/newLesson/audio.vue
+79
-13
index.vue
src/components/newLesson/index.vue
+31
-3
look.vue
src/components/newLesson/look.vue
+1
-1
video.vue
src/components/newLesson/video.vue
+28
-6
No files found.
src/components/map/index.vue
View file @
5e0a77ec
...
...
@@ -295,12 +295,10 @@
},
// 进入课程
goDetail
(){
// 神策埋点 选择课时
this
.
$sa
.
track
(
'StartCourse'
,{
elementID
:
this
.
thisLesson
.
id
.
toString
(),
is_view_today
:
''
is_view_today
:
!!
new
Date
().
setHours
(
0
,
0
,
0
,
0
)
===
new
Date
(
this
.
push_time
).
setHours
(
0
,
0
,
0
,
0
)
});
if
(
this
.
thisLesson
.
content
.
tips
){
let
query
=
{
...
...
@@ -310,7 +308,9 @@
course_type
:
this
.
$route
.
query
.
course_type
,
parent_category_id
:
this
.
parent_category_id
,
};
localStorage
.
setItem
(
'lessonDetail'
,
JSON
.
stringify
(
this
.
thisLesson
));
let
lessonData
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
thisLesson
));
lessonData
.
push_time
=
this
.
push_time
;
localStorage
.
setItem
(
'lessonDetail'
,
JSON
.
stringify
(
lessonData
));
this
.
$router
.
push
({
name
:
'newLesson'
,
query
:
query
})
}
else
{
let
query
=
{
...
...
@@ -321,7 +321,7 @@
course_type
:
this
.
$route
.
query
.
course_type
,
type
:
'1'
};
//
this.$router.push({name:'lesson',query:query})
this
.
$router
.
push
({
name
:
'lesson'
,
query
:
query
})
}
},
// 切换主题
...
...
src/components/newLesson/audio.vue
View file @
5e0a77ec
...
...
@@ -35,12 +35,12 @@
</div>
</div>
<div
class=
"btn-group"
>
<i
class=
"playImage toBig"
@
click=
"imgPop=true"
></i>
<i
class=
"playImage list"
@
click=
"popupVisible=!popupVisible"
></i>
<i
class=
"playImage toBig"
@
click=
"imgPop=true
;sendConsole('放大图片')
"
></i>
<i
class=
"playImage list"
@
click=
"popupVisible=!popupVisible
;sendConsole('展开列表')
"
></i>
<i
class=
"playImage last"
@
click=
"lastOne()"
></i>
<i
class=
"playImage play"
v-if=
"!playFlag"
@
click=
"onPlay"
></i>
<i
class=
"playImage stop"
v-if=
"playFlag"
@
click=
"onStop"
></i>
<i
class=
"playImage next"
@
click=
"nextOne()"
></i>
<i
class=
"playImage play"
v-if=
"!playFlag"
@
click=
"onPlay
(true)
"
></i>
<i
class=
"playImage stop"
v-if=
"playFlag"
@
click=
"onStop
(true)
"
></i>
<i
class=
"playImage next"
@
click=
"nextOne(
true
)"
></i>
<i
:class=
"
{playImage:true,replay:playType===1,replayAll:playType===0,listPlay:playType==2}" @click="changeType()">
</i>
<i
:class=
"
{playImage:true,collectDefault:!hasCollect,collect:!!hasCollect}" @click="changeCollect">
</i>
</div>
...
...
@@ -50,16 +50,16 @@
<div
v-if=
"contentData.age === 2"
>
4-6岁
<i
class=
"playImage _154722344142123489"
></i></div>
</div>
<div
class=
"age-change-block"
v-show=
"ageShow"
v-if=
"contentData.content.age"
>
<div
@
click=
"contentData.age = 1"
>
0-3岁
<i
class=
"playImage _282918034425091245"
v-if=
"contentData.age === 1"
></i></div>
<div
@
click=
"contentData.age = 2"
>
4-6岁
<i
class=
"playImage _282918034425091245"
v-if=
"contentData.age === 2"
></i></div>
<div
@
click=
"contentData.age = 1
;sendConsole('选择分龄')
"
>
0-3岁
<i
class=
"playImage _282918034425091245"
v-if=
"contentData.age === 1"
></i></div>
<div
@
click=
"contentData.age = 2
;sendConsole('选择分龄')
"
>
4-6岁
<i
class=
"playImage _282918034425091245"
v-if=
"contentData.age === 2"
></i></div>
</div>
<div
v-if=
"showObj.change"
class=
"change-block-HP"
@
click=
"contentData.type = 'video'"
>
<div
v-if=
"showObj.change"
class=
"change-block-HP"
@
click=
"contentData.type = 'video'
;sendConsole('切换视频教学')
"
>
<div
class=
""
>
<img
:src=
"tapToVideo"
/>
</div>
</div>
<div
v-if=
"showObj.change"
class=
"change-block"
>
<div
@
click=
"contentData.type = 'video'"
>
视频教学
</div>
<div
@
click=
"contentData.type = 'video'
;sendConsole('切换视频教学')
"
>
视频教学
</div>
<div
class=
"active"
>
音频教学
</div>
</div>
</div>
...
...
@@ -68,7 +68,7 @@
v-model=
"popupVisible"
position=
"bottom"
style=
"background: transparent"
>
<div
class=
"list-popup"
v-if=
"showObj.audio"
>
<div
:class=
"
{'list-block':true,active:i=== index}" v-for="(data,i) in this.showObj.audio" @click="changeIndex(i)">
<div
:class=
"
{'list-block':true,active:i=== index}" v-for="(data,i) in this.showObj.audio" @click="changeIndex(i)
;sendConsole('列表选择音频')
">
{{
data
.
title
}}
<i
:class=
"
{playImage:true,zDefaultIcon:i !== index,zIcon:i === index}">
</i>
</div>
...
...
@@ -128,15 +128,34 @@
this
.
checkCollect
();
},
methods
:{
sendConsole
(
data
){
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
data
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
},
// 改变收藏状态
changeCollect
(){
if
(
this
.
hasCollect
){
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'取消收藏'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
delUserCollectApi
(
this
.
hasCollect
).
then
(
res
=>
{
this
.
hasCollect
=
false
;
Toast
(
'取消收藏'
);
this
.
checkCollect
()
})
}
else
{
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'添加收藏'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
let
lessonDetail
=
JSON
.
parse
(
localStorage
.
getItem
(
'lessonDetail'
));
let
json
=
{
category_id
:
lessonDetail
.
id
,
...
...
@@ -162,10 +181,23 @@
})
},
// 播放音频
onPlay
(){
onPlay
(
flag
){
if
(
flag
){
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'播放音频'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
}
this
.
$refs
.
audio
.
play
();
},
lastOne
(){
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'上一首'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
if
(
this
.
index
>
0
){
this
.
index
--
;
this
.
keepPlay
()
...
...
@@ -193,7 +225,15 @@
})
}
},
nextOne
(){
nextOne
(
flag
){
if
(
flag
){
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'下一首'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
}
if
(
this
.
index
<
this
.
showObj
.
audio
.
length
-
1
){
this
.
index
++
;
this
.
keepPlay
()
...
...
@@ -261,7 +301,15 @@
},
// 播放暂停
onStop
(){
onStop
(
flag
){
if
(
flag
){
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'暂停播放'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
}
this
.
$refs
.
audio
.
pause
();
this
.
playFlag
=
false
},
...
...
@@ -304,12 +352,30 @@
window
.
localStorage
.
setItem
(
'playType'
,
this
.
playType
);
switch
(
this
.
playType
)
{
case
1
:
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'单曲循环'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
Toast
(
'单曲循环'
);
break
;
case
2
:
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'顺序播放'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
Toast
(
'顺序播放'
);
break
;
case
0
:
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'列表循环'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
Toast
(
'列表循环'
);
break
}
...
...
src/components/newLesson/index.vue
View file @
5e0a77ec
...
...
@@ -65,6 +65,12 @@
},
methods
:{
backList
(){
// 神策埋点 按钮点击
this
.
$sa
.
track
(
'learnPart'
,{
buttonName
:
'返回课程列表'
,
partName
:
this
.
nowShow
==
1
?
'爸妈看一看'
:
this
.
nowShow
==
2
?
'宝贝玩一玩'
:
this
.
nowShow
==
3
?
'磨磨小耳朵'
:
''
,
elementID
:
this
.
lesson
.
id
.
toString
(),
});
let
json
=
{
page_type
:
0
,
page_id
:
this
.
page_id
,
...
...
@@ -93,40 +99,62 @@
});
switch
(
type
)
{
case
1
:
json
.
page_id
=
1
;
// 神策埋点 板块切换
this
.
$sa
.
track
(
'learnPart'
,{
partName
:
'爸妈看一看'
,
elementID
:
this
.
lesson
.
id
.
toString
(),
is_view_today
:
!!
new
Date
().
setHours
(
0
,
0
,
0
,
0
)
===
new
Date
(
this
.
lesson
.
push_time
).
setHours
(
0
,
0
,
0
,
0
)
});
this
.
page_id
=
1
;
this
.
nowLesson
=
{
type
:
'text'
,
partName
:
'爸妈看一看'
,
content
:
this
.
lesson
.
content
.
look
,
age
:
this
.
nowLesson
.
age
};
break
;
case
2
:
json
.
page_id
=
2
;
// 神策埋点 板块切换
this
.
$sa
.
track
(
'learnPart'
,{
partName
:
'宝贝玩一玩'
,
elementID
:
this
.
lesson
.
id
.
toString
(),
is_view_today
:
!!
new
Date
().
setHours
(
0
,
0
,
0
,
0
)
===
new
Date
(
this
.
lesson
.
push_time
).
setHours
(
0
,
0
,
0
,
0
)
});
this
.
page_id
=
2
;
if
(
this
.
lesson
.
content
.
play
.
type
){
this
.
nowLesson
=
{
type
:
'audio'
,
partName
:
'宝贝玩一玩'
,
content
:
this
.
lesson
.
content
.
play
,
age
:
this
.
nowLesson
.
age
};
}
else
{
this
.
nowLesson
=
{
type
:
'video'
,
partName
:
'宝贝玩一玩'
,
content
:
this
.
lesson
.
content
.
play
,
age
:
this
.
nowLesson
.
age
};
}
break
;
case
3
:
json
.
page_id
=
5
;
this
.
$sa
.
track
(
'learnPart'
,{
partName
:
'磨磨小耳朵'
,
elementID
:
this
.
lesson
.
id
.
toString
(),
is_view_today
:
!!
new
Date
().
setHours
(
0
,
0
,
0
,
0
)
===
new
Date
(
this
.
lesson
.
push_time
).
setHours
(
0
,
0
,
0
,
0
)
});
this
.
page_id
=
5
;
if
(
this
.
lesson
.
content
.
fun
.
type
){
this
.
nowLesson
=
{
type
:
'audio'
,
partName
:
'磨磨小耳朵'
,
content
:
this
.
lesson
.
content
.
fun
,
age
:
this
.
nowLesson
.
age
};
}
else
{
this
.
nowLesson
=
{
type
:
'video'
,
partName
:
'磨磨小耳朵'
,
content
:
this
.
lesson
.
content
.
fun
,
age
:
this
.
nowLesson
.
age
};
...
...
src/components/newLesson/look.vue
View file @
5e0a77ec
...
...
@@ -115,7 +115,7 @@
margin-top
:
20px
;
box-sizing
:
border-box
;
}
.look-content
img
,
video
{
.look-content
img
,
video
,
audio
{
max-width
:
100%
;
}
@font-face
{
font-family
:
hanti
;
src
:
url(https://cdn.singsingenglish.com/template/SentyZHAO.ttf)
}
...
...
src/components/newLesson/video.vue
View file @
5e0a77ec
...
...
@@ -6,7 +6,7 @@
<img
:src=
"imgURL.luolalaila"
class=
"text"
v-if=
"nowShow === 2"
>
</div>
<div
class=
"video-block hp-video"
v-if=
"showObj.video[videoIndex]"
>
<video
:src=
"showObj.video[videoIndex].url"
@
ended=
"videoEnd"
controls
:poster=
"showObj.video[videoIndex].url+'?vframe/jpg/offset/3'"
></video>
<video
:src=
"showObj.video[videoIndex].url"
@
ended=
"videoEnd"
@
play=
"videoPlay()"
controls
:poster=
"showObj.video[videoIndex].url+'?vframe/jpg/offset/3'"
></video>
</div>
<div
class=
"btn-block"
>
<div
v-if=
"contentData.content.age"
class=
"age-block"
@
click=
"ageShow = !ageShow"
>
...
...
@@ -20,17 +20,17 @@
<div
@
click=
"videoIndex= index;videoShow=false"
v-for=
"(item,index) in showObj.video"
>
视频(
{{
index
+
1
}}
)
<i
:class=
"
{'playImage _282918034425091245':index === videoIndex}" v-if="contentData.age === 1">
</i></div>
</div>
<div
class=
"age-change-block"
v-show=
"ageShow"
v-if=
"contentData.content.age && ageShow"
>
<div
@
click=
"contentData.age = 1;ageShow=false"
>
0-3岁
<i
class=
"playImage _282918034425091245"
v-if=
"contentData.age === 1"
></i></div>
<div
@
click=
"contentData.age = 2;ageShow=false"
>
4-6岁
<i
class=
"playImage _282918034425091245"
v-if=
"contentData.age === 2"
></i></div>
<div
@
click=
"contentData.age = 1;ageShow=false
;sendConsole('选择分龄')
"
>
0-3岁
<i
class=
"playImage _282918034425091245"
v-if=
"contentData.age === 1"
></i></div>
<div
@
click=
"contentData.age = 2;ageShow=false
;sendConsole('选择分龄')
"
>
4-6岁
<i
class=
"playImage _282918034425091245"
v-if=
"contentData.age === 2"
></i></div>
</div>
<div
v-if=
"showObj.change"
class=
"change-block-HP"
@
click=
"changeAudio()"
>
<div
v-if=
"showObj.change"
class=
"change-block-HP"
@
click=
"changeAudio(
true
)"
>
<div
class=
""
>
<img
:src=
"imgURL.tapToAudio"
/>
</div>
</div>
<div
v-if=
"showObj.change"
class=
"change-block"
>
<div
class=
"active"
>
视频教学
</div>
<div
@
click=
"changeAudio()"
>
音频教学
</div>
<div
@
click=
"changeAudio(
true
)"
>
音频教学
</div>
</div>
</div>
</div>
...
...
@@ -75,9 +75,31 @@
videoEnd
(
event
){
event
.
srcElement
.
play
()
},
changeAudio
(){
sendConsole
(
data
){
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
data
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
},
changeAudio
(
flag
){
if
(
flag
){
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'切换音频教学'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
}
this
.
contentData
.
type
=
'audio'
},
videoPlay
(){
// 神策埋点 点击操作
this
.
$sa
.
track
(
'watchClick'
,{
buttonName
:
'播放视频'
,
partName
:
this
.
contentData
.
partName
,
elementID
:
this
.
$route
.
query
.
elementId
.
toString
(),
});
},
changeAge
(
value
){
if
(
this
.
contentData
.
content
.
age
&&
value
===
2
){
this
.
showObj
=
{
...
...
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