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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
126 additions
and
11 deletions
+126
-11
src/app.json
+2
-2
src/pages/lived/index.vue
+120
-8
src/pages/lived/main.json
+4
-1
No files found.
src/app.json
View file @
e6852237
{
{
"pages"
:
[
"pages"
:
[
"pages/index/main"
,
"pages/index/main"
,
"pages/lived/main"
,
"pages/login/main"
,
"pages/login/main"
,
"pages/wxPay/main"
,
"pages/wxPay/main"
,
"pages/counter/main"
,
"pages/counter/main"
,
"pages/address/main"
,
"pages/address/main"
,
"pages/contact/main"
,
"pages/contact/main"
"pages/lived/main"
],
],
"window"
:
{
"window"
:
{
"backgroundTextStyle"
:
"light"
,
"backgroundTextStyle"
:
"light"
,
...
...
src/pages/lived/index.vue
View file @
e6852237
<
template
>
<
template
>
<div
class=
"lived"
>
<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
<live-player
class=
"livePlayer"
:src=
"livedUrl"
:src=
"livedUrl"
mode=
"RTC"
mode=
"RTC"
autoplay
autoplay
bindstatechange=
"statechange"
bindstatechange=
"statechange"
binderror=
"error"
binderror=
"error"
style=
"width: 100vw;height:99vh;"
/>
/>
</div>
</div>
</
template
>
</
template
>
<
script
type=
"text/ecmascript-6"
>
<
script
type=
"text/ecmascript-6"
>
import
{
DFSImg
}
from
"@/utils/index"
;
export
default
{
export
default
{
name
:
""
,
name
:
""
,
data
()
{
data
()
{
return
{
return
{
liveId
:
''
,
//直播间id
liveId
:
''
,
//直播间id
livedUrl
:
'rtmp://58.200.131.2:1935/livetv/hunantv'
,
livedUrl
:
'rtmp://58.200.131.2:1935/livetv/hunantv'
,
shopName
:
''
,
shopLogo
:
''
,
};
};
},
},
components
:
{},
components
:
{},
computed
:
{},
computed
:
{},
created
()
{},
created
()
{},
onLoad
(
options
){
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
();
this
.
init
();
},
},
mounted
()
{
mounted
()
{
},
},
methods
:
{
methods
:
{
// 初始化数据
// 初始化数据
...
@@ -42,15 +67,101 @@ export default {
...
@@ -42,15 +67,101 @@ export default {
error
(
err
)
{
error
(
err
)
{
console
.
log
(
err
,
"----22"
);
console
.
log
(
err
,
"----22"
);
},
},
back
(){
wx
.
navigateBack
({
delta
:
1
})
},
}
}
};
};
</
script
>
</
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
{
.lived
{
width
:
100vw
;
width
:
100vw
;
height
:
99vh
;
height
:
100vh
;
background
:
#eee
;
position
:
relative
;
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
>
</
style
>
\ No newline at end of file
src/pages/lived/main.json
View file @
e6852237
{
{
"navigationStyle"
:
"custom"
,
"navigationStyle"
:
"custom"
,
"navigationBarTextStyle"
:
"white"
,
"usingComponents"
:
{
"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