Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
c3ebe44f
Commit
c3ebe44f
authored
Mar 24, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播暂停功能
parent
9c5c33c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
22 deletions
+79
-22
src/components/livedModel/isPauseShow.vue
+38
-0
src/components/livedModel/livedControls.vue
+5
-5
src/pages/lived/index.vue
+36
-17
No files found.
src/components/livedModel/isPauseShow.vue
0 → 100644
View file @
c3ebe44f
<
template
>
<!-- 直播暂停 -->
<div
class=
"pauseShow"
>
<p
class=
"tit"
>
主播暂时离开
</p>
</div>
</
template
>
<
script
type=
"text/ecmascript-6"
>
export
default
{
name
:
""
,
data
()
{
return
{};
},
components
:
{},
computed
:
{},
created
()
{},
mounted
()
{},
methods
:
{}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.pauseShow
{
position
:
absolute
;
width
:
70vw
;
top
:
40%
;
left
:
15vw
;
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
.tit
{
font-size
:
30px
;
font-weight
:
bold
;
color
:
#fff
;
}
}
</
style
>
src/components/livedModel/livedControls.vue
View file @
c3ebe44f
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
></livedIsMsg>
></livedIsMsg>
<!-- 带货商品层 -->
<!-- 带货商品层 -->
<livedExplainingCommodities
<livedExplainingCommodities
v-if=
"
info.liveBroadcastState==1
&&list"
v-if=
"
(info.liveBroadcastState==1||info.liveBroadcastState==3)
&&list"
:updateGoods=
"updateGoods"
:updateGoods=
"updateGoods"
:goodsList=
"list"
:goodsList=
"list"
></livedExplainingCommodities>
></livedExplainingCommodities>
...
@@ -175,10 +175,10 @@ export default {
...
@@ -175,10 +175,10 @@ export default {
addLike
(
val
)
{
addLike
(
val
)
{
this
.
imgAni
=
true
;
this
.
imgAni
=
true
;
if
(
val
==
1
)
{
if
(
val
==
1
)
{
if
(
this
.
info
.
liveBroadcastState
<
1
)
{
//
if (this.info.liveBroadcastState
<
1
)
{
this
.
notAgainLive
();
//
this.notAgainLive();
return
;
//
return;
}
//
}
this
.
likeNum
++
;
this
.
likeNum
++
;
let
query
=
{
let
query
=
{
liveBroadcastId
:
this
.
liveId
,
liveBroadcastId
:
this
.
liveId
,
...
...
src/pages/lived/index.vue
View file @
c3ebe44f
...
@@ -31,6 +31,8 @@
...
@@ -31,6 +31,8 @@
</div>
</div>
<!-- 未开始展示 -->
<!-- 未开始展示 -->
<notStarted
v-if=
"liveNoticeInfo.liveBroadcastState==0"
:info=
"liveNoticeInfo"
></notStarted>
<notStarted
v-if=
"liveNoticeInfo.liveBroadcastState==0"
:info=
"liveNoticeInfo"
></notStarted>
<!-- 直播暂停展示 -->
<isPauseShow
v-if=
"liveNoticeInfo.liveBroadcastState==3"
:info=
"liveNoticeInfo"
></isPauseShow>
<!-- 结束展示 -->
<!-- 结束展示 -->
<livedIsEnded
<livedIsEnded
v-if=
"liveNoticeInfo.liveBroadcastState==2"
v-if=
"liveNoticeInfo.liveBroadcastState==2"
...
@@ -40,7 +42,7 @@
...
@@ -40,7 +42,7 @@
></livedIsEnded>
></livedIsEnded>
<!-- 控件层 -->
<!-- 控件层 -->
<livedControls
<livedControls
v-if=
"liveNoticeInfo&&liveNoticeInfo.liveBroadcastState
<
2
"
v-if=
"liveNoticeInfo&&liveNoticeInfo.liveBroadcastState
!=
2"
:info=
"liveNoticeInfo"
:info=
"liveNoticeInfo"
:entryNoticeText=
"entryNoticeText"
:entryNoticeText=
"entryNoticeText"
:guestBookList=
"guestBookList"
:guestBookList=
"guestBookList"
...
@@ -73,11 +75,17 @@
...
@@ -73,11 +75,17 @@
</
template
>
</
template
>
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
import
{
serialize
,
getQueryVariable
,
DFSImg
,
getNavbarInfo
}
from
"@/utils/index"
;
import
{
serialize
,
getQueryVariable
,
DFSImg
,
getNavbarInfo
}
from
"@/utils/index"
;
import
live
from
"@/api/live"
;
import
live
from
"@/api/live"
;
import
notStarted
from
"@/components/livedModel/notStarted"
;
import
notStarted
from
"@/components/livedModel/notStarted"
;
import
livedControls
from
"@/components/livedModel/livedControls"
;
import
livedControls
from
"@/components/livedModel/livedControls"
;
import
livedIsEnded
from
"@/components/livedModel/livedIsEnded"
;
import
livedIsEnded
from
"@/components/livedModel/livedIsEnded"
;
import
isPauseShow
from
"@/components/livedModel/isPauseShow"
;
import
spokesman
from
"@/api/spokesman"
;
import
spokesman
from
"@/api/spokesman"
;
import
shop
from
"@/api/shop"
;
import
shop
from
"@/api/shop"
;
export
default
{
export
default
{
...
@@ -110,21 +118,22 @@ export default {
...
@@ -110,21 +118,22 @@ export default {
userId
:
""
,
userId
:
""
,
hasInvitationStatus
:
0
,
// 邀请资格:0-不能够邀请下级,1-能够邀请下级
hasInvitationStatus
:
0
,
// 邀请资格:0-不能够邀请下级,1-能够邀请下级
spokesmanObj
:
{},
//分销员信息
spokesmanObj
:
{},
//分销员信息
navTop
:
0
,
navTop
:
0
,
navHeight
:
0
,
navHeight
:
0
};
};
},
},
components
:
{
components
:
{
notStarted
,
notStarted
,
livedControls
,
livedControls
,
livedIsEnded
livedIsEnded
,
isPauseShow
},
},
computed
:
{},
computed
:
{},
onLoad
(
options
)
{
onLoad
(
options
)
{
getNavbarInfo
(
res
=>
{
getNavbarInfo
(
res
=>
{
console
.
log
(
res
,
'--------------------125'
)
console
.
log
(
res
,
"--------------------125"
);
this
.
navTop
=
res
.
navTop
this
.
navTop
=
res
.
navTop
;
this
.
navHeight
=
res
.
navHeight
this
.
navHeight
=
res
.
navHeight
;
});
});
wx
.
getNetworkType
({
wx
.
getNetworkType
({
success
:
function
(
res
)
{
success
:
function
(
res
)
{
...
@@ -149,12 +158,12 @@ export default {
...
@@ -149,12 +158,12 @@ export default {
this
.
backPath
=
this
.
params
.
fromPagePath
||
"/"
;
this
.
backPath
=
this
.
params
.
fromPagePath
||
"/"
;
this
.
shopLogo
=
DFSImg
(
this
.
params
.
shopLogo
,
40
,
40
);
this
.
shopLogo
=
DFSImg
(
this
.
params
.
shopLogo
,
40
,
40
);
// 是否有分销员信息
// 是否有分销员信息
if
(
this
.
params
.
spokesmanGroupId
)
{
if
(
this
.
params
.
spokesmanGroupId
)
{
this
.
$store
.
commit
(
"setSpokesman"
,
{
this
.
$store
.
commit
(
"setSpokesman"
,
{
spokesmanGroupId
:
this
.
params
.
spokesmanGroupId
,
spokesmanGroupId
:
this
.
params
.
spokesmanGroupId
,
spokesmanShopId
:
this
.
params
.
spokesmanShopId
,
spokesmanShopId
:
this
.
params
.
spokesmanShopId
,
spokesmanRelId
:
this
.
params
.
spokesmanRelId
spokesmanRelId
:
this
.
params
.
spokesmanRelId
})
})
;
}
}
this
.
init
();
this
.
init
();
this
.
infoTiming
=
setInterval
(()
=>
{
this
.
infoTiming
=
setInterval
(()
=>
{
...
@@ -169,10 +178,10 @@ export default {
...
@@ -169,10 +178,10 @@ export default {
onShareAppMessage
(
options
)
{
onShareAppMessage
(
options
)
{
let
_this
=
this
;
let
_this
=
this
;
if
(
this
.
hasInvitationStatus
==
1
)
{
if
(
this
.
hasInvitationStatus
==
1
)
{
Object
.
assign
(
this
.
params
,
this
.
params
,
this
.
spokesmanObj
);
Object
.
assign
(
this
.
params
,
this
.
params
,
this
.
spokesmanObj
);
}
}
console
.
log
(
this
.
params
,
'--------------161'
)
console
.
log
(
this
.
params
,
"--------------161"
);
let
shareObj
=
{
let
shareObj
=
{
title
:
this
.
liveNoticeInfo
.
title
,
title
:
this
.
liveNoticeInfo
.
title
,
path
:
`/pages/lived/main?params=
${
JSON
.
stringify
(
this
.
params
)}
`
,
path
:
`/pages/lived/main?params=
${
JSON
.
stringify
(
this
.
params
)}
`
,
...
@@ -207,11 +216,11 @@ export default {
...
@@ -207,11 +216,11 @@ export default {
this
.
firstComing
=
true
;
this
.
firstComing
=
true
;
if
(
this
.
infoTiming
)
{
if
(
this
.
infoTiming
)
{
clearInterval
(
this
.
infoTiming
);
clearInterval
(
this
.
infoTiming
);
this
.
infoTiming
=
null
;
this
.
infoTiming
=
null
;
}
}
if
(
this
.
goodTiming
)
{
if
(
this
.
goodTiming
)
{
clearInterval
(
this
.
goodTiming
);
clearInterval
(
this
.
goodTiming
);
this
.
goodTiming
=
null
;
this
.
goodTiming
=
null
;
}
}
},
},
mounted
()
{},
mounted
()
{},
...
@@ -235,7 +244,7 @@ export default {
...
@@ -235,7 +244,7 @@ export default {
}
}
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
!=
2
&&
!
this
.
goodTiming
)
{
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
!=
2
&&
!
this
.
goodTiming
)
{
this
.
goodTiming
=
setInterval
(()
=>
{
this
.
goodTiming
=
setInterval
(()
=>
{
console
.
log
(
"--------获取商品接口"
)
console
.
log
(
"--------获取商品接口"
)
;
this
.
getGoodsList
();
this
.
getGoodsList
();
},
5000
);
},
5000
);
}
else
if
(
}
else
if
(
...
@@ -365,6 +374,16 @@ export default {
...
@@ -365,6 +374,16 @@ export default {
this
.
firstComing
=
false
;
this
.
firstComing
=
false
;
this
.
init
();
this
.
init
();
}
}
}
else
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
1
&&
resData
.
liveState
==
"PAUSE_LIVE"
)
{
this
.
liveNoticeInfo
.
liveBroadcastState
=
3
}
else
if
(
this
.
liveNoticeInfo
.
liveBroadcastState
==
3
&&
resData
.
liveState
==
"IN_LIVE"
)
{
this
.
liveNoticeInfo
.
liveBroadcastState
=
1
}
}
this
.
guestBookList
=
resData
.
guestBookList
;
//评论列表
this
.
guestBookList
=
resData
.
guestBookList
;
//评论列表
this
.
likeInfo
=
resData
.
likeInfo
;
//点赞信息
this
.
likeInfo
=
resData
.
likeInfo
;
//点赞信息
...
...
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