Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2cd51d79
authored
Sep 27, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
增加观看视频时跳转页面返回增加继续播放事件
1 parent
2cffd84e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
45 deletions
src/components/LiveBox.vue
src/views/crowdfunding/index.vue
src/components/LiveBox.vue
View file @
2cd51d7
<
template
>
<
template
>
<!-- v-if="LiveProps[liveDetail.status].isLive" -->
<!-- v-if="LiveProps[liveDetail.status].isLive" -->
<div
class=
"videoContainer"
>
<div
class=
"videoContainer"
>
<div
class=
"small-box"
<div
@
click=
"isSmallBox = false"
class=
"small-box"
v-show=
"isSmallBox"
>
@
click=
"isSmallBox = false"
<img
class=
"icon-small-live"
v-show=
"isSmallBox"
src=
"@/assets/images/icon-small-live.png"
/>
>
<img
class=
"icon-small-live"
src=
"@/assets/images/icon-small-live.png"
/>
<div
class=
"flex small-content"
>
<div
class=
"flex small-content"
>
<!--
<div
v-if=
"LiveStatus[liveDetail.status] == 'live'"
class=
"live-line"
>
-->
<!--
<div
v-if=
"LiveStatus[liveDetail.status] == 'live'"
class=
"live-line"
>
-->
<div
class=
"live-line"
>
<div
class=
"live-line"
>
...
@@ -19,29 +23,37 @@
...
@@ -19,29 +23,37 @@
</div>
</div>
</div>
</div>
<!-- @click="openFullscreen" -->
<!-- @click="openFullscreen" -->
<div
:style=
"videoStyle"
<div
id=
"live-box"
:style=
"videoStyle"
:class=
"['live-box',
{ videoFullscreen: videoFullscreen }]"
id=
"live-box"
v-show="!isSmallBox">
:class=
"['live-box',
{ videoFullscreen: videoFullscreen }]"
<div
class=
"sprite-icon icon-live-close"
v-show="!isSmallBox"
v-show=
"!videoFullscreen && !isSmallBox"
>
@
click=
"isSmallBox = true"
></div>
<div
class=
"sprite-icon icon-live-close"
v-show=
"!videoFullscreen && !isSmallBox"
@
click=
"isSmallBox = true"
></div>
<div
:class=
"
{ videoShort: isAction }">
<div
:class=
"
{ videoShort: isAction }">
<div
class=
"mask"
>
<div
class=
"mask"
>
<div
class=
"status flex"
>
<div
class=
"status flex"
>
<!--
<div
v-if=
"LiveStatus[liveDetail.status] == 'live'"
class=
"live-line"
>
-->
<!--
<div
v-if=
"LiveStatus[liveDetail.status] == 'live'"
class=
"live-line"
>
-->
<div
v-if=
"LiveProps[liveDetail.status].isLive"
<div
class=
"live-line"
>
v-if=
"LiveProps[liveDetail.status].isLive"
class=
"live-line"
>
<div
class=
"side"
></div>
<div
class=
"side"
></div>
<div
class=
"center side"
></div>
<div
class=
"center side"
></div>
<div
class=
"side"
></div>
<div
class=
"side"
></div>
</div>
</div>
<!-- 回放图标 -->
<!-- 回放图标 -->
<!-- :src="" -->
<!-- :src="" -->
<img
v-if=
"!LiveProps[liveDetail.status].isLive"
<img
:src=
"IMAGES.REPLAY_ICON"
v-if=
"!LiveProps[liveDetail.status].isLive"
class=
"live-replayIcon"
/>
:src=
"IMAGES.REPLAY_ICON"
class=
"live-replayIcon"
/>
<!--
<div
class=
"text"
>
{{
LiveStatus
[
liveDetail
.
status
]
==
'live'
?
'正在直播'
:
'直播回放'
}}
</div>
-->
<!--
<div
class=
"text"
>
{{
LiveStatus
[
liveDetail
.
status
]
==
'live'
?
'正在直播'
:
'直播回放'
}}
</div>
-->
<div
class=
"text"
>
{{
LiveProps
[
liveDetail
.
status
].
text
}}
</div>
<div
class=
"text"
>
{{
LiveProps
[
liveDetail
.
status
].
text
}}
</div>
...
@@ -49,32 +61,44 @@
...
@@ -49,32 +61,44 @@
<template
v-if=
"isShowGif"
>
<template
v-if=
"isShowGif"
>
<!-- v-if="LiveProps[liveDetail.status].covergif" -->
<!-- v-if="LiveProps[liveDetail.status].covergif" -->
<!--
<img
v-if=
"LiveStatus[liveDetail.status] == 'live'"
src=
"https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif"
alt=
""
/>
-->
<!--
<img
v-if=
"LiveStatus[liveDetail.status] == 'live'"
src=
"https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif"
alt=
""
/>
-->
<img
class=
"coverGif"
<img
:src=
"LiveProps[liveDetail.status].covergif"
class=
"coverGif"
alt=
""
/>
:src=
"LiveProps[liveDetail.status].covergif"
alt=
""
/>
<!--
<img
v-else
<!--
<img
v-else
:src=
"IMAGES.COVER_REPLAY"
:src=
"IMAGES.COVER_REPLAY"
alt=
""
/>
-->
alt=
""
/>
-->
</
template
>
</
template
>
</div>
</div>
<div
class=
"fullscreen-btn"
<div
@
click=
"openFullscreen(false)"
>
class=
"fullscreen-btn"
@
click=
"openFullscreen(false)"
>
<img
:src=
"IMAGES.FULL_SCREEN"
/>
<img
:src=
"IMAGES.FULL_SCREEN"
/>
</div>
</div>
<div
class=
"poster-btn"
<div
@
click=
"showKf = true"
>
class=
"poster-btn"
@
click=
"showKf = true"
>
<img
:src=
"detail.floatingMaskDiagram"
/>
<img
:src=
"detail.floatingMaskDiagram"
/>
</div>
</div>
<video
id=
"player-container-id"
<video
preload=
"auto"
id=
"player-container-id"
playsinline
preload=
"auto"
webkit-playsinline
></video>
playsinline
<group-modal
v-model=
"showKf"
webkit-playsinline
:detail=
"detail"
/>
></video>
<group-modal
v-model=
"showKf"
:detail=
"detail"
/>
</div>
</div>
<action
:bgBlack=
"true"
<action
class=
"BgAction"
:bgBlack=
"true"
v-show=
"videoFullscreen && isAction"
></action>
class=
"BgAction"
v-show=
"videoFullscreen && isAction"
></action>
</div>
</div>
</div>
</div>
</template>
</template>
...
@@ -107,7 +131,7 @@ const LiveProps = Object.freeze({
...
@@ -107,7 +131,7 @@ const LiveProps = Object.freeze({
const
PLAYERDOMID
=
'player-container-id'
const
PLAYERDOMID
=
'player-container-id'
export
default
{
export
default
{
name
:
'LiveBox'
,
name
:
'LiveBox'
,
data
()
{
data
()
{
return
{
return
{
player
:
null
,
player
:
null
,
videoFullscreen
:
false
,
videoFullscreen
:
false
,
...
@@ -122,7 +146,7 @@ export default {
...
@@ -122,7 +146,7 @@ export default {
}
}
},
},
computed
:
{
computed
:
{
isAction
()
{
isAction
()
{
const
{
activityStatus
,
buyFlag
}
=
this
.
detail
const
{
activityStatus
,
buyFlag
}
=
this
.
detail
return
activityStatus
!=
3
&&
buyFlag
!=
2
//TODO CONSTANT
return
activityStatus
!=
3
&&
buyFlag
!=
2
//TODO CONSTANT
}
}
...
@@ -147,7 +171,7 @@ export default {
...
@@ -147,7 +171,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
console
.
log
(
this
.
liveDetail
,
'============'
)
console
.
log
(
this
.
liveDetail
,
'============'
)
this
.
createPlayerCover
()
this
.
createPlayerCover
()
this
.
createPlayer
()
this
.
createPlayer
()
...
@@ -198,13 +222,13 @@ export default {
...
@@ -198,13 +222,13 @@ export default {
// })
// })
},
},
methods
:
{
methods
:
{
createPlayerCover
()
{
createPlayerCover
()
{
!
this
.
IsIOS
&&
(
this
.
isShowGif
=
true
)
!
this
.
IsIOS
&&
(
this
.
isShowGif
=
true
)
},
},
createPlayer
()
{
createPlayer
()
{
this
.
player
=
TCPlayer
(
PLAYERDOMID
,
TCPlayerConfig
)
this
.
player
=
TCPlayer
(
PLAYERDOMID
,
TCPlayerConfig
)
},
},
play
()
{
play
()
{
wxConfig
.
ready
(()
=>
{
wxConfig
.
ready
(()
=>
{
wx
.
getNetworkType
({
wx
.
getNetworkType
({
success
:
(
result
)
=>
{
success
:
(
result
)
=>
{
...
@@ -224,7 +248,8 @@ export default {
...
@@ -224,7 +248,8 @@ export default {
})
})
})
})
},
},
fixHls
()
{
fixHls
()
{
if
(
Hls
.
isSupported
())
{
if
(
Hls
.
isSupported
())
{
this
.
video
=
document
.
getElementById
(
PLAYERDOMID
)
this
.
video
=
document
.
getElementById
(
PLAYERDOMID
)
this
.
hls
=
new
Hls
()
this
.
hls
=
new
Hls
()
...
@@ -234,7 +259,7 @@ export default {
...
@@ -234,7 +259,7 @@ export default {
}
}
},
},
// 打开关闭全屏
// 打开关闭全屏
openFullscreen
(
status
=
true
)
{
openFullscreen
(
status
=
true
)
{
console
.
log
(
'openFullscreen'
)
console
.
log
(
'openFullscreen'
)
this
.
isShowGif
=
false
this
.
isShowGif
=
false
const
[
live
]
=
document
.
getElementsByClassName
(
'live-box'
)
const
[
live
]
=
document
.
getElementsByClassName
(
'live-box'
)
...
@@ -247,7 +272,7 @@ export default {
...
@@ -247,7 +272,7 @@ export default {
this
.
$emit
(
'handleLiveFull'
,
{
isFull
:
this
.
videoFullscreen
})
this
.
$emit
(
'handleLiveFull'
,
{
isFull
:
this
.
videoFullscreen
})
},
},
// 处理tcplayer错误码14
// 处理tcplayer错误码14
dealTcPlayerErr14
()
{
dealTcPlayerErr14
()
{
this
.
hls
.
on
(
Hls
.
Events
.
ERROR
,
function
(
event
,
data
)
{
this
.
hls
.
on
(
Hls
.
Events
.
ERROR
,
function
(
event
,
data
)
{
if
(
data
.
fatal
)
{
if
(
data
.
fatal
)
{
switch
(
data
.
type
)
{
switch
(
data
.
type
)
{
...
@@ -268,12 +293,15 @@ export default {
...
@@ -268,12 +293,15 @@ export default {
}
}
})
})
},
},
changeGifStatus
()
{
changeGifStatus
()
{
this
.
isShowGif
=
!
this
.
isShowGif
this
.
isShowGif
=
!
this
.
isShowGif
},
},
handleClose
()
{
handleClose
()
{
// e.stopPropagation()
// e.stopPropagation()
console
.
log
(
'关闭--22222222222222222'
)
console
.
log
(
'关闭--22222222222222222'
)
},
continueVideo
()
{
this
.
player
.
play
()
}
}
}
}
}
}
...
...
src/views/crowdfunding/index.vue
View file @
2cd51d7
...
@@ -326,7 +326,11 @@ export default {
...
@@ -326,7 +326,11 @@ export default {
if
(
from
.
name
==
'crowdfunding.success'
)
window
.
location
.
reload
()
if
(
from
.
name
==
'crowdfunding.success'
)
window
.
location
.
reload
()
else
{
else
{
if
(
vm
.
detail
&&
vm
.
detail
.
activityName
)
document
.
title
=
vm
.
detail
.
activityName
if
(
vm
.
detail
&&
vm
.
detail
.
activityName
)
document
.
title
=
vm
.
detail
.
activityName
if
(
vm
.
isLiveFull
)
return
if
(
vm
.
isLiveFull
)
{
console
.
log
(
vm
.
$refs
)
vm
.
$refs
.
liveBox
.
continueVideo
()
return
}
if
(
window
.
$AUDIO
&&
vm
.
userOff
!=
1
)
{
if
(
window
.
$AUDIO
&&
vm
.
userOff
!=
1
)
{
window
.
$AUDIO
.
toggleBGM
()
window
.
$AUDIO
.
toggleBGM
()
vm
.
musicOff
=
false
vm
.
musicOff
=
false
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment