Commit e6852237 by 李嘉林

直播详情页初始化

parent 9f0baae2
{ {
"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",
......
<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() {
...@@ -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
{ {
"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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment