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
e6852237
Commit
e6852237
authored
Mar 12, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播详情页初始化
parent
9f0baae2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
9 deletions
+124
-9
src/app.json
+2
-2
src/pages/lived/index.vue
+118
-6
src/pages/lived/main.json
+4
-1
No files found.
src/app.json
View file @
e6852237
{
"pages"
:
[
"pages/index/main"
,
"pages/lived/main"
,
"pages/login/main"
,
"pages/wxPay/main"
,
"pages/counter/main"
,
"pages/address/main"
,
"pages/contact/main"
,
"pages/lived/main"
"pages/contact/main"
],
"window"
:
{
"backgroundTextStyle"
:
"light"
,
...
...
src/pages/lived/index.vue
View file @
e6852237
<
template
>
<div
class=
"lived"
>
<van-button
type=
"primary"
>
按钮
</van-button>
<!-- 直播展示层 -->
<div
class=
"liveModel"
>
<!-- 自定义返回按钮 -->
<div
class=
"customBack flex"
>
<div
class=
"backIcon"
>
<van-icon
name=
"arrow-left"
@
click=
"back"
/>
</div>
<div
class=
"shopName flex"
>
<div
class=
"img"
>
<img
:src=
"shopLogo"
alt=
""
>
</div>
<div
class=
"info"
>
<p
class=
"name"
v-if=
"shopName"
>
{{
shopName
}}
</p>
<p
class=
"num"
>
<span>
999
</span>
<span>
观看
</span>
</p>
</div>
</div>
</div>
</div>
<live-player
class=
"livePlayer"
:src=
"livedUrl"
mode=
"RTC"
autoplay
bindstatechange=
"statechange"
binderror=
"error"
style=
"width: 100vw;height:99vh;"
/>
</div>
</
template
>
<
script
type=
"text/ecmascript-6"
>
import
{
DFSImg
}
from
"@/utils/index"
;
export
default
{
name
:
""
,
data
()
{
return
{
liveId
:
''
,
//直播间id
livedUrl
:
'rtmp://58.200.131.2:1935/livetv/hunantv'
,
shopName
:
''
,
shopLogo
:
''
,
};
},
components
:
{},
computed
:
{},
created
()
{},
onLoad
(
options
){
this
.
liveId
=
options
.
liveId
;
let
params
=
JSON
.
parse
(
options
.
params
);
this
.
liveId
=
params
.
liveId
;
this
.
shopName
=
params
.
shopName
;
this
.
shopLogo
=
DFSImg
(
params
.
shopLogo
,
40
,
40
);
this
.
init
();
},
mounted
()
{
...
...
@@ -42,15 +67,101 @@ export default {
error
(
err
)
{
console
.
log
(
err
,
"----22"
);
},
back
(){
wx
.
navigateBack
({
delta
:
1
})
},
}
};
</
script
>
<
style
scoped
>
<
style
lang=
"scss"
scoped
>
.flex
{
display
:
flex
;
}
/*清除浮动*/
.clearfix
{
zoom
:
1
;
}
.clearfix
:after
{
clear
:
both
;
content
:
'.'
;
display
:
block
;
width
:
0
;
height
:
0
;
visibility
:
hidden
;
}
/* 一行否则出现省略号 */
.line-clamp1
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
1
;
-webkit-box-orient
:
vertical
;
}
.line-clamp2
{
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-webkit-box
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
line-height
:
22px
;
}
.lived
{
width
:
100vw
;
height
:
99vh
;
background
:
#eee
;
height
:
100vh
;
position
:
relative
;
.liveModel{
width
:
100vw
;
height
:
100vh
;
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
1
;
.customBack{
position
:
absolute
;
top
:
30px
;
left
:
12px
;
width
:
60%
;
align-items
:
center
;
.backIcon{
color
:
#fff
;
font-size
:
20px
;
}
.shopName
{
margin-left
:
20px
;
background
:
rgba
(
0
,
0
,
0
,
0.6
);
border-radius
:
34px
;
.img{
width
:
34px
;
height
:
34px
;
border-radius
:
50%
;
overflow
:
hidden
;
img{
width
:
100%
;
height
:
100%
;
}
}
.info
{
margin-left
:
6px
;
color
:
#fff
;
flex
:
1
;
font-size
:
14px
;
}
}
}
}
.livePlayer
{
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100vw
;
height
:
100vh
;
z-index
:
-1
;
}
}
</
style
>
\ No newline at end of file
src/pages/lived/main.json
View file @
e6852237
{
"navigationStyle"
:
"custom"
,
"navigationBarTextStyle"
:
"white"
,
"usingComponents"
:
{
"van-button"
:
"/static/vant/button/index"
"van-button"
:
"/static/vant/button/index"
,
"van-icon"
:
"/static/vant/icon/index"
}
}
\ No newline at end of file
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