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 0f70c03f
authored
Sep 23, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商品未配置
1 parent
c978a0ee
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
101 additions
and
50 deletions
src/api/shopmallApi.js
src/assets/css/crowdfunding.scss
src/assets/images/active-empty.png
src/components/LiveBox.vue
src/views/crowdfunding/index.vue
src/api/shopmallApi.js
View file @
0f70c03
...
@@ -7,7 +7,8 @@ export default {
...
@@ -7,7 +7,8 @@ export default {
data
:
{
data
:
{
method
:
'scrm.api.shopmall.weapp.activity.detail'
,
method
:
'scrm.api.shopmall.weapp.activity.detail'
,
id
id
}
},
returnAll
:
true
})
})
},
},
/**参团人数 */
/**参团人数 */
...
@@ -17,7 +18,8 @@ export default {
...
@@ -17,7 +18,8 @@ export default {
data
:
{
data
:
{
method
:
'scrm.api.shopmall.weapp.activity.group'
,
method
:
'scrm.api.shopmall.weapp.activity.group'
,
id
,
id
,
}
},
returnAll
:
true
})
})
},
},
/** 创建订单(立即购买) */
/** 创建订单(立即购买) */
...
...
src/assets/css/crowdfunding.scss
View file @
0f70c03
...
@@ -35,6 +35,28 @@
...
@@ -35,6 +35,28 @@
.layout
{
.layout
{
padding-bottom
:
100px
;
padding-bottom
:
100px
;
.empty-page
{
position
:
absolute
;
top
:
0
;
left
:
0
;
bottom
:
0
;
box-sizing
:
border-box
;
width
:
100%
;
height
:
100vh
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
font-size
:
14px
;
color
:
#ACACAC
;
}
.empty-img
{
width
:
223px
;
height
:
120px
;
margin-bottom
:
30px
;
}
.to-top
{
.to-top
{
position
:
fixed
;
position
:
fixed
;
right
:
10px
;
right
:
10px
;
...
...
src/assets/images/active-empty.png
0 → 100644
View file @
0f70c03
21.9 KB
src/components/LiveBox.vue
View file @
0f70c03
...
@@ -4,15 +4,16 @@
...
@@ -4,15 +4,16 @@
<div
class=
"mask"
@
click=
"openFullscreen"
>
<div
class=
"mask"
@
click=
"openFullscreen"
>
<div
class=
"sprite-icon icon-live-close"
@
click=
"handleClose"
></div>
<div
class=
"sprite-icon icon-live-close"
@
click=
"handleClose"
></div>
<div
class=
"status flex"
>
<div
class=
"status flex"
>
<div
class=
"live-line"
>
<div
v-if=
"liveStatus[liveDetail.status] == 'live'"
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>
<div
class=
"text"
>
正在直播
</div>
<div
class=
"text"
>
{{
liveStatus
[
liveDetail
.
status
]
==
'live'
?
'正在直播'
:
'直播回放'
}}
</div>
</div>
</div>
<template
v-if=
"isShowGif"
>
<template
v-if=
"isShowGif"
>
<img
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
v-else
src=
"https://wimg.588ku.com/gif620/20/04/23/79a7882dfb0c59497976fd8b3bfe60ef.gif"
alt=
""
/>
</
template
>
</
template
>
</div>
</div>
<div
class=
"fullscreen-btn"
@
click=
"openFullscreen(false)"
>
<div
class=
"fullscreen-btn"
@
click=
"openFullscreen(false)"
>
...
@@ -37,10 +38,12 @@ export default {
...
@@ -37,10 +38,12 @@ export default {
videoFullscreen
:
false
,
videoFullscreen
:
false
,
showKf
:
false
,
showKf
:
false
,
isShowGif
:
false
,
isShowGif
:
false
,
// detail: {
videoStyle
:
''
,
// customerServiceQrImg: 'https://img02.glsx.com.cn/weapp/resource/h5/images/123.png'
liveStatus
:
{
// },
0
:
'ready'
,
videoStyle
:
''
1
:
'live'
,
2
:
'end'
}
}
}
},
},
props
:
{
props
:
{
...
@@ -75,31 +78,20 @@ export default {
...
@@ -75,31 +78,20 @@ export default {
// bind them together
// bind them together
_this
.
hls
.
attachMedia
(
_this
.
video
)
_this
.
hls
.
attachMedia
(
_this
.
video
)
}
}
_this
.
player
=
TCPlayer
(
'player-container-id'
,
{
let
playParams
=
{
// fileID: '387702305074716718', // 点播ID
// appID: '1311227058', // 点播APPID
// src: 'webrtc://play.glsx.com.cn/crowdFunding/7f65f8f80989b46',
autoplay
:
true
,
// 自动播放
autoplay
:
true
,
// 自动播放
loop
:
true
,
// 循环播放
loop
:
true
,
// 循环播放
volume
:
1
,
// muted: false, // 是否静音
muted
:
false
,
// 是否静音
controlBar
:
{
// 控制条配置
controlBar
:
{
// 控制条配置
// fullscreenToggle: false // 隐藏全屏按钮
fullscreenToggle
:
false
// 隐藏全屏按钮
playToggle
:
false
,
progressControl
:
false
,
// volumePanel: false,
currentTimeDisplay
:
false
,
durationDisplay
:
false
,
timeDivider
:
false
,
playbackRateMenuButton
:
false
,
fullscreenToggle
:
false
,
QualitySwitcherMenuButton
:
false
},
},
webrtcConfig
:
{
// webrtcConfig 参数列表
webrtcConfig
:
{
// webrtcConfig 参数列表
showLog
:
true
// 打印webrtc日志
showLog
:
true
// 打印webrtc日志
}
}
})
}
_this
.
player
.
src
(
'webrtc://play.glsx.com.cn/live/live_normal'
)
_this
.
player
=
TCPlayer
(
'player-container-id'
,
playParams
)
let
src
=
this
.
liveStatus
[
this
.
liveDetail
.
status
]
==
'live'
?
this
.
liveDetail
.
playPath
:
(
this
.
liveDetail
.
liveBroadcastRecordingFileList
.
length
?
this
.
liveDetail
.
liveBroadcastRecordingFileList
[
0
].
videoUrl
:
''
)
_this
.
player
.
src
(
src
)
wx
.
getNetworkType
({
wx
.
getNetworkType
({
success
:
(
result
)
=>
{
success
:
(
result
)
=>
{
_this
.
player
.
ready
(
function
()
{
// 设置播放器初始化完成后的回调
_this
.
player
.
ready
(
function
()
{
// 设置播放器初始化完成后的回调
...
@@ -109,12 +101,12 @@ export default {
...
@@ -109,12 +101,12 @@ export default {
})
})
}
}
})
})
_this
.
player
.
on
(
'play'
,
()
=>
{
//
_this.player.on('play', () => {
this
.
changeGifStatus
()
//
this.changeGifStatus()
})
//
})
_this
.
player
.
on
(
'pause'
,
()
=>
{
//
_this.player.on('pause', () => {
this
.
changeGifStatus
()
//
this.changeGifStatus()
})
//
})
_this
.
dealTcPlayerErr14
()
_this
.
dealTcPlayerErr14
()
})
})
},
},
...
@@ -125,6 +117,7 @@ export default {
...
@@ -125,6 +117,7 @@ export default {
let
[
volumePanel
]
=
document
.
getElementsByClassName
(
'vjs-volume-panel '
)
let
[
volumePanel
]
=
document
.
getElementsByClassName
(
'vjs-volume-panel '
)
let
[
volume
]
=
volumePanel
.
getElementsByClassName
(
'vjs-mute-control'
)
let
[
volume
]
=
volumePanel
.
getElementsByClassName
(
'vjs-mute-control'
)
volume
.
click
()
volume
.
click
()
console
.
log
(
volume
)
this
.
player
.
play
()
this
.
player
.
play
()
this
.
videoFullscreen
=
status
this
.
videoFullscreen
=
status
live
.
id
=
status
?
''
:
'live-box'
live
.
id
=
status
?
''
:
'live-box'
...
...
src/views/crowdfunding/index.vue
View file @
0f70c03
<
template
>
<
template
>
<div
class=
"layout"
>
<div
class=
"layout"
>
<div
v-if=
"liveDetail"
>
<div
class=
"empty-page"
v-if=
"noPro"
>
<img
webp
class=
"empty-img"
src=
"@/assets/images/active-empty.png"
/>
活动重新配置中,请稍后重试
</div>
<div
v-else
>
<div
v-if=
"detail.liveBroadcastRoomId && liveDetail"
>
<live-box
ref=
"liveBox"
:detail=
"detail"
:liveDetail=
"liveDetail"
@
handleLiveFull=
"handleLiveFull"
></live-box>
<live-box
ref=
"liveBox"
:detail=
"detail"
:liveDetail=
"liveDetail"
@
handleLiveFull=
"handleLiveFull"
></live-box>
</div>
</div>
<!--👇 点击回到顶部 -->
<!--👇 点击回到顶部 -->
...
@@ -65,21 +70,12 @@
...
@@ -65,21 +70,12 @@
<div>
<span>
{{
groupInfo
.
viewAmount
}}
</span>
人已浏览
</div>
<div>
<span>
{{
groupInfo
.
viewAmount
}}
</span>
人已浏览
</div>
</div>
</div>
<template
v-if=
"detail.showAvatarNicknameFlag == 2 && groupInfo.arr && groupInfo.arr.length"
>
<template
v-if=
"detail.showAvatarNicknameFlag == 2 && groupInfo.arr && groupInfo.arr.length"
>
<van-swipe
<van-swipe
class=
"group-swipe"
vertical
:show-indicators=
"false"
:touchable=
"false"
autoplay=
"5000"
>
class=
"group-swipe"
vertical
:show-indicators=
"false"
:touchable=
"false"
autoplay=
"5000"
>
<template
v-for=
"(item, ind) in groupInfo.arr"
>
<template
v-for=
"(item, ind) in groupInfo.arr"
>
<van-swipe-item
:key=
"ind"
>
<van-swipe-item
:key=
"ind"
>
<div
class=
"group-box"
>
<div
class=
"group-box"
>
<template
v-for=
"(i, index) in item"
>
<template
v-for=
"(i, index) in item"
>
<div
<div
class=
"item"
:key=
"index"
>
class=
"item"
:key=
"index"
>
<img
:src=
"i.imageUrl"
/>
<img
:src=
"i.imageUrl"
/>
<div
class=
"name"
>
{{
i
.
name
}}
</div>
<div
class=
"name"
>
{{
i
.
name
}}
</div>
</div>
</div>
...
@@ -124,7 +120,7 @@
...
@@ -124,7 +120,7 @@
<!-- 👇 服务说明 -->
<!-- 👇 服务说明 -->
<serve
:list=
"detail.activityServices || []"
/>
<serve
:list=
"detail.activityServices || []"
/>
<!-- 👇 玩家心得&商品答疑 -->
<!-- 👇 玩家心得&商品答疑 -->
<share-goods
:evaList=
"detail.activityExperienceDTOs || []"
:faqList=
"detail.activityCommoditys || []"
:detail=
"detail"
/>
<share-goods
:evaList=
"detail.activityExperienceDTOs || []"
:faqList=
"detail.activityCommoditys || []"
:detail=
"detail"
/>
<!--👇 活动视频 -->
<!--👇 活动视频 -->
<
template
v-if=
"detail.activityVideos && detail.activityVideos.length"
>
<
template
v-if=
"detail.activityVideos && detail.activityVideos.length"
>
<div
:class=
"['video-box flex',
{ onlyone: detail.activityVideos.length == 1 }, { onlytwo: detail.activityVideos.length == 2 }]">
<div
:class=
"['video-box flex',
{ onlyone: detail.activityVideos.length == 1 }, { onlytwo: detail.activityVideos.length == 2 }]">
...
@@ -192,6 +188,7 @@
...
@@ -192,6 +188,7 @@
</video>
</video>
</
template
>
</
template
>
</div>
</div>
</div>
</template>
</template>
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
...
@@ -217,7 +214,8 @@ export default {
...
@@ -217,7 +214,8 @@ export default {
count
:
0
,
count
:
0
,
step
:
1
,
step
:
1
,
isLiveFull
:
false
,
isLiveFull
:
false
,
liveDetail
:
null
liveDetail
:
null
,
noPro
:
false
}
}
},
},
beforeRouteEnter
(
to
,
from
,
next
)
{
beforeRouteEnter
(
to
,
from
,
next
)
{
...
@@ -239,10 +237,13 @@ export default {
...
@@ -239,10 +237,13 @@ export default {
'openLocation'
,
'openLocation'
,
'getNetworkType'
,
'getNetworkType'
,
'onMenuShareAppMessage'
,
'onMenuShareAppMessage'
,
'onMenuShareTimeline'
'onMenuShareTimeline'
,
'showMenuItems'
,
'hideAllNonBaseMenuItem'
]
]
wxConfig
.
init
(
jsApiList
).
then
(()
=>
{
wxConfig
.
init
(
jsApiList
).
then
(()
=>
{
wxConfig
.
ready
(()
=>
{
wxConfig
.
ready
(()
=>
{
wx
.
hideAllNonBaseMenuItem
()
this
.
getActivityGroup
()
this
.
getActivityGroup
()
})
})
})
})
...
@@ -282,7 +283,12 @@ export default {
...
@@ -282,7 +283,12 @@ export default {
getActivityDetail
(
id
)
{
getActivityDetail
(
id
)
{
this
.
showLoading
()
this
.
showLoading
()
bigdatautilApi
.
reportTrack
(
id
)
bigdatautilApi
.
reportTrack
(
id
)
shopmallApi
.
getActivityDetail
(
id
).
then
(
data
=>
{
shopmallApi
.
getActivityDetail
(
id
).
then
(
res
=>
{
this
.
judgeIsPro
(
res
)
if
(
this
.
noPro
)
{
return
true
}
var
data
=
res
.
data
this
.
hideLoading
()
this
.
hideLoading
()
this
.
viewFlag
=
true
this
.
viewFlag
=
true
console
.
log
(
JSON
.
parse
(
JSON
.
stringify
(
data
)))
console
.
log
(
JSON
.
parse
(
JSON
.
stringify
(
data
)))
...
@@ -296,6 +302,7 @@ export default {
...
@@ -296,6 +302,7 @@ export default {
if
(
!
document
.
webkitIsFullScreen
&&
data
.
activityMusic
)
{
if
(
!
document
.
webkitIsFullScreen
&&
data
.
activityMusic
)
{
let
{
currentVideoIndex
}
=
this
let
{
currentVideoIndex
}
=
this
this
.
audioAutoPlay
()
this
.
audioAutoPlay
()
console
.
log
(
'音乐加载完了----------'
)
this
.
$refs
[
`video-
${
currentVideoIndex
}
`
][
0
].
pause
()
this
.
$refs
[
`video-
${
currentVideoIndex
}
`
][
0
].
pause
()
}
}
})
})
...
@@ -328,6 +335,10 @@ export default {
...
@@ -328,6 +335,10 @@ export default {
},
},
getLiveDetail
(
id
)
{
getLiveDetail
(
id
)
{
shopmallApi
.
getLiveDetail
(
id
).
then
(
res
=>
{
shopmallApi
.
getLiveDetail
(
id
).
then
(
res
=>
{
// 直播结束,录制视频未返回
if
(
res
.
status
==
2
&&
!
res
.
liveBroadcastRecordingFileList
.
length
)
{
return
true
}
this
.
liveDetail
=
res
this
.
liveDetail
=
res
})
})
},
},
...
@@ -368,6 +379,9 @@ export default {
...
@@ -368,6 +379,9 @@ export default {
imgUrl
:
posterImg
||
activityImg
,
imgUrl
:
posterImg
||
activityImg
,
link
link
}
}
wx
.
showMenuItems
({
menuList
:
[
'menuItem:share:appMessage'
,
'menuItem:share:timeline'
,
'menuItem:favorite'
]
})
wxConfig
.
onMenuShareAppMessage
(
shareInfo
).
then
(()
=>
{
wxConfig
.
onMenuShareAppMessage
(
shareInfo
).
then
(()
=>
{
console
.
log
(
'------------------分享----------------------'
)
console
.
log
(
'------------------分享----------------------'
)
bigdatautilApi
.
reportTrack
(
id
,
false
)
bigdatautilApi
.
reportTrack
(
id
,
false
)
...
@@ -394,6 +408,21 @@ export default {
...
@@ -394,6 +408,21 @@ export default {
})
})
})
})
},
},
// 活动是否有商品
judgeIsPro
(
data
)
{
// session过期
if
(
data
.
code
==
'21'
)
{
window
.
reLogin
()
return
false
}
// 活动未配置商品
this
.
noPro
=
data
.
code
==
'-1'
&&
data
.
errId
==
'20103'
if
(
this
.
noPro
)
{
this
.
hideLoading
()
document
.
title
=
'商品配置中'
}
return
this
.
noPro
},
getActivityGroup
()
{
getActivityGroup
()
{
let
{
id
}
=
this
.
getQuery
()
let
{
id
}
=
this
.
getQuery
()
let
params
=
this
.
getLocalStorage
(
'wx_scrm_link_params'
)
let
params
=
this
.
getLocalStorage
(
'wx_scrm_link_params'
)
...
@@ -413,7 +442,12 @@ export default {
...
@@ -413,7 +442,12 @@ export default {
}
}
}
}
this
.
id
=
id
this
.
id
=
id
shopmallApi
.
getActivityGroup
(
this
.
id
).
then
(
data
=>
{
shopmallApi
.
getActivityGroup
(
this
.
id
).
then
(
res
=>
{
this
.
judgeIsPro
(
res
)
if
(
this
.
noPro
)
{
return
true
}
var
data
=
res
.
data
let
arr
=
[],
items
=
[]
let
arr
=
[],
items
=
[]
// console.log(JSON.parse(JSON.stringify(data)))
// console.log(JSON.parse(JSON.stringify(data)))
data
.
progress
=
data
.
fictitiousLadderQuantity
!=
0
data
.
progress
=
data
.
fictitiousLadderQuantity
!=
0
...
...
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