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
1f5770ae
Commit
1f5770ae
authored
Apr 03, 2020
by
程智春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播优化
parent
c3309530
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
90 additions
and
17 deletions
+90
-17
src/components/comments/index.vue
+6
-1
src/components/livedModel/livedIsMsg.vue
+9
-3
src/components/livedModel/notStarted.vue
+2
-0
src/pages/live/index.vue
+34
-10
src/pages/liveList/index.vue
+35
-0
src/pages/lived/index.vue
+4
-3
No files found.
src/components/comments/index.vue
View file @
1f5770ae
...
@@ -78,12 +78,17 @@ export default {
...
@@ -78,12 +78,17 @@ export default {
overflow
:
hidden
;
overflow
:
hidden
;
bottom
:
0
;
bottom
:
0
;
padding-left
:
10px
;
padding-left
:
10px
;
background-color
:
rgba
(
0
,
0
,
0
,
0.3
);
.item
{
.item
{
width
:
50vw
;
width
:
50vw
;
padding
:
4px
0
;
padding
:
4px
0
;
display
:
flex
;
display
:
flex
;
align-items
:
flex-start
;
align-items
:
flex-start
;
line-height
:
18px
;
border-radius
:
9px
;
background-color
:
rgba
(
0
,
0
,
0
,
0.3
);
margin-bottom
:
4px
;
padding-left
:
8px
;
box-sizing
:
border-box
;
.user
{
.user
{
.name
{
.name
{
color
:
#f9a93c
;
color
:
#f9a93c
;
...
...
src/components/livedModel/livedIsMsg.vue
View file @
1f5770ae
...
@@ -63,15 +63,21 @@ export default {
...
@@ -63,15 +63,21 @@ export default {
position
:
relative
;
position
:
relative
;
width
:
60vw
;
width
:
60vw
;
.list
{
.list
{
width
:
60vw
;
width
:
50vw
;
max-height
:
24vh
;
overflow
:
hidden
;
overflow
:
hidden
;
bottom
:
0
;
bottom
:
0
;
padding-left
:
10px
;
.item
{
.item
{
width
:
6
0vw
;
width
:
5
0vw
;
padding
:
4px
0
;
padding
:
4px
0
;
display
:
flex
;
display
:
flex
;
align-items
:
flex-start
;
align-items
:
flex-start
;
line-height
:
18px
;
border-radius
:
9px
;
background-color
:
rgba
(
0
,
0
,
0
,
0.3
);
margin-bottom
:
4px
;
padding-left
:
8px
;
box-sizing
:
border-box
;
.user
{
.user
{
.name
{
.name
{
color
:
#f9a93c
;
color
:
#f9a93c
;
...
...
src/components/livedModel/notStarted.vue
View file @
1f5770ae
...
@@ -75,6 +75,8 @@ export default {
...
@@ -75,6 +75,8 @@ export default {
}
}
});
});
}
}
}
else
{
console
.
log
(
'开播失败'
)
}
}
}
catch
(
err
)
{
}
catch
(
err
)
{
console
.
error
(
"subscribeMessage-err"
,
err
);
console
.
error
(
"subscribeMessage-err"
,
err
);
...
...
src/pages/live/index.vue
View file @
1f5770ae
...
@@ -442,6 +442,10 @@ export default {
...
@@ -442,6 +442,10 @@ export default {
if
(
res
.
data
.
code
==
'200'
){
if
(
res
.
data
.
code
==
'200'
){
let
result
=
res
.
data
.
data
let
result
=
res
.
data
.
data
if
(
result
){
result
.
coverUrl
=
DFSImg
(
result
.
coverUrl
)
result
.
coverUrl
=
DFSImg
(
result
.
coverUrl
)
result
.
logoUrl
=
DFSImg
(
result
.
logoUrl
)
result
.
logoUrl
=
DFSImg
(
result
.
logoUrl
)
this
.
liveInfo
=
result
;
this
.
liveInfo
=
result
;
...
@@ -470,18 +474,38 @@ export default {
...
@@ -470,18 +474,38 @@ export default {
// this.getLiveTimeHandler(result.startTime)
// clearInterval(this.openLiveTimer)
// this.openLiveTimer = setInterval(() => {
this
.
getLiveTimeHandler
(
result
.
startTime
)
this
.
getLiveTimeHandler
(
result
.
startTime
)
// },5000)
// this.getProductList(); //获取商品列表
// this.getProductTimer = setInterval(() => {
this
.
getProductList
();
//获取商品列表
this
.
getProductList
();
//获取商品列表
// },30000)
}
else
{
wx
.
showModal
({
title
:
'提示'
,
content
:
'直播已关闭'
,
success
(
res3
)
{
if
(
res3
.
confirm
)
{
wx
.
reLaunch
({
url
:
`../liveList/main`
})
}
else
if
(
res3
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
}
}
else
if
(
res
.
data
.
code
==
'-1'
){
wx
.
showModal
({
title
:
'提示'
,
content
:
'直播已关闭'
,
success
(
res3
)
{
if
(
res3
.
confirm
)
{
wx
.
reLaunch
({
url
:
`../liveList/main`
})
}
else
if
(
res3
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
}
}
})
})
}
}
...
@@ -504,13 +528,13 @@ export default {
...
@@ -504,13 +528,13 @@ export default {
day
=
Math
.
floor
(
getTimeAbs
/
(
3600
*
1000
*
24
))
day
=
Math
.
floor
(
getTimeAbs
/
(
3600
*
1000
*
24
))
hours
=
Math
.
floor
((
getTimeAbs
%
(
24
*
3600
*
1000
))
/
(
3600
*
1000
));
hours
=
Math
.
floor
((
getTimeAbs
%
(
24
*
3600
*
1000
))
/
(
3600
*
1000
));
minute
=
Math
.
ceil
((
getTimeAbs
%
(
24
*
3600
*
1000
)
%
(
3600
*
1000
)
)
/
(
60
*
1000
))
minute
=
Math
.
floor
((
getTimeAbs
%
(
24
*
3600
*
1000
)
%
(
3600
*
1000
)
)
/
(
60
*
1000
))
if
(
getTime
>
0
){
if
(
getTime
>
0
){
if
(
day
>
0
){
if
(
day
>
0
){
this
.
liveTime
=
`
${
day
>=
10
?
day
:
'0'
+
day
}
天
${
hours
>=
10
?
hours
:
'0'
+
hours
}
小时
${
minute
>=
10
?
minute
:
'0'
+
minute
}
分`
this
.
liveTime
=
`
${
day
>=
10
?
day
:
'0'
+
day
}
天
${
hours
>=
10
?
hours
:
'0'
+
hours
}
小时
${
minute
>=
10
?
minute
:
'0'
+
minute
}
分`
}
else
if
(
day
<=
0
&&
hours
>
0
){
}
else
if
(
day
<=
0
&&
hours
>
0
){
this
.
liveTime
=
`
${
hours
>=
10
?
hours
:
'0'
+
hours
}
小时
${
minute
>=
10
?
minute
:
'0'
+
minute
}
分`
this
.
liveTime
=
`
${
hours
>=
10
?
hours
:
'0'
+
hours
}
小时
${
minute
>=
10
?
minute
:
'0'
+
minute
}
分`
}
else
if
(
day
<=
0
&&
hours
<=
0
&&
minute
>
0
){
}
else
if
(
day
<=
0
&&
hours
<=
0
&&
minute
>
=
0
){
this
.
liveTime
=
`
${
minute
>=
10
?
minute
:
'0'
+
minute
}
分`
this
.
liveTime
=
`
${
minute
>=
10
?
minute
:
'0'
+
minute
}
分`
}
}
...
@@ -547,7 +571,7 @@ export default {
...
@@ -547,7 +571,7 @@ export default {
if
(
res2
.
data
.
data
.
liveBroadcastState
==
4
||
res2
.
data
.
data
.
liveBroadcastState
==
2
){
if
(
res2
.
data
.
data
.
liveBroadcastState
==
4
||
res2
.
data
.
data
.
liveBroadcastState
==
2
){
wx
.
showModal
({
wx
.
showModal
({
title
:
'提示'
,
title
:
'提示'
,
content
:
'直播
超时
已关闭'
,
content
:
'直播已关闭'
,
success
(
res3
)
{
success
(
res3
)
{
if
(
res3
.
confirm
)
{
if
(
res3
.
confirm
)
{
wx
.
reLaunch
({
url
:
`../liveList/main`
})
wx
.
reLaunch
({
url
:
`../liveList/main`
})
...
...
src/pages/liveList/index.vue
View file @
1f5770ae
...
@@ -81,6 +81,7 @@ import { getNavbarInfo,DFSImg } from '../../utils/common.js'
...
@@ -81,6 +81,7 @@ import { getNavbarInfo,DFSImg } from '../../utils/common.js'
import
{
wx_decode
}
from
"@/utils/wxIndex.js"
;
import
{
wx_decode
}
from
"@/utils/wxIndex.js"
;
import
login
from
"@/api/login"
;
import
login
from
"@/api/login"
;
import
indexApi
from
'@/api/liveing'
import
indexApi
from
'@/api/liveing'
import
liveApi
from
'@/api/liveing'
export
default
{
export
default
{
data
(){
data
(){
return
{
return
{
...
@@ -171,6 +172,11 @@ export default {
...
@@ -171,6 +172,11 @@ export default {
},
},
//去直播间
//去直播间
toLive
(
id
){
toLive
(
id
){
liveApi
.
queryLiveDetail
({
id
}).
then
(
res
=>
{
console
.
log
(
res
.
data
)
if
(
res
.
data
.
code
==
'200'
){
if
(
res
.
data
.
data
){
let
openId
=
''
;
let
openId
=
''
;
this
.
liveList
.
forEach
(
item
=>
{
this
.
liveList
.
forEach
(
item
=>
{
if
(
item
.
liveBroadcastState
==
3
||
item
.
liveBroadcastState
==
1
){
if
(
item
.
liveBroadcastState
==
3
||
item
.
liveBroadcastState
==
1
){
...
@@ -187,6 +193,35 @@ export default {
...
@@ -187,6 +193,35 @@ export default {
}
else
{
}
else
{
wx
.
navigateTo
({
url
:
'../live/main?id='
+
id
})
wx
.
navigateTo
({
url
:
'../live/main?id='
+
id
})
}
}
}
else
{
wx
.
showModal
({
title
:
'提示'
,
content
:
'直播已关闭'
,
success
:
(
res3
)
=>
{
if
(
res3
.
confirm
)
{
this
.
getLiveList
()
}
else
if
(
res3
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
}
}
else
{
wx
.
showModal
({
title
:
'提示'
,
content
:
'直播已关闭'
,
success
:
(
res3
)
=>
{
if
(
res3
.
confirm
)
{
this
.
getLiveList
()
}
else
if
(
res3
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
}
})
},
},
getUserInfo
(
e
){
getUserInfo
(
e
){
...
...
src/pages/lived/index.vue
View file @
1f5770ae
...
@@ -415,8 +415,8 @@ export default {
...
@@ -415,8 +415,8 @@ export default {
if
(
resData
.
guestBookList
&&
resData
.
guestBookList
.
length
){
if
(
resData
.
guestBookList
&&
resData
.
guestBookList
.
length
){
this
.
newCommentsTime
=
resData
.
guestBookList
[
resData
.
guestBookList
.
length
-
1
].
createTimeStamp
this
.
newCommentsTime
=
resData
.
guestBookList
[
resData
.
guestBookList
.
length
-
1
].
createTimeStamp
}
}
if
(
res
ult
.
entryNoticeList
&&
result
.
entryNoticeList
.
length
){
if
(
res
Data
.
entryNoticeList
&&
resData
.
entryNoticeList
.
length
){
this
.
userActivebeginTime
=
res
ult
.
entryNoticeList
[
result
.
entryNoticeList
.
length
-
1
].
createTimeStamp
this
.
userActivebeginTime
=
res
Data
.
entryNoticeList
[
resData
.
entryNoticeList
.
length
-
1
].
createTimeStamp
}
}
this
.
likeInfo
=
resData
.
likeInfo
;
//点赞信息
this
.
likeInfo
=
resData
.
likeInfo
;
//点赞信息
// 直播中且接口直播中---主要操作
// 直播中且接口直播中---主要操作
...
@@ -432,7 +432,8 @@ export default {
...
@@ -432,7 +432,8 @@ export default {
}
人`
;
//用户进入
}
人`
;
//用户进入
}
}
}
}
this
.
updateVal
=
Math
.
random
();
//监听使用数据
this
.
updateVal
=
new
Date
().
getTime
();
//监听使用数据
}
else
{
}
else
{
// if (this.infoTiming) {
// if (this.infoTiming) {
// clearInterval(this.infoTiming);
// clearInterval(this.infoTiming);
...
...
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