99 行
2.3 KiB
Plaintext
99 行
2.3 KiB
Plaintext
<template>
|
|
<view>
|
|
<template v-if="infoData.live == 1">
|
|
<video :src="infoData.liveUrl" :controls="false" autoplay
|
|
:style="{width: width + 'px',height:height + 'px'}">
|
|
</video>
|
|
<image style="width: 20px;height: 20px;position: fixed;top: 20px;left: 20px;" @click="backHome" src="../../static/live-back.png"></image>
|
|
</template>
|
|
|
|
<!-- <div class="live-box" v-else>
|
|
<image src="../../static/template_empty.png" style="width: 500rpx;" mode="widthFix"></image>
|
|
<text class="zwzb">暂无直播~</text>
|
|
</div> -->
|
|
|
|
<view class="empty-live" v-else>
|
|
|
|
<text style="color: lawngreen;
|
|
font-size: 40rpx;
|
|
font-weight: bold;">直播已结束</text>
|
|
|
|
<image src="../../static/live-icon.jpg" mode="" style="width: 140rpx;height: 140rpx;border-radius: 50%;margin-top: 100rpx;"></image>
|
|
|
|
<text style="color: #fff;margin-top: 10rpx;font-size: 24rpx;">雄戈小酒</text>
|
|
|
|
<view @click="backHome" style="position: absolute;bottom: 140rpx;width: 600rpx;height: 88rpx;background-color: #fff;border-radius: 60rpx;text-align: center;line-height: 88rpx;display: flex;align-items: center;justify-content: center;">
|
|
返回首页
|
|
</view>
|
|
</view>
|
|
<shopro-tabbar></shopro-tabbar>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
width: '',
|
|
height: '',
|
|
infoData: {}
|
|
}
|
|
},
|
|
methods: {
|
|
backHome() {
|
|
uni.switchTab({
|
|
url: '/pages/index/index'
|
|
})
|
|
},
|
|
getVideo(flag) {
|
|
const data = {}
|
|
if(flag) data.check = 1
|
|
uni.$http('common.getVideoUrl',data).then(res => {
|
|
if(flag) {
|
|
this.infoData.live = res.data.live
|
|
}else {
|
|
this.infoData = res.data
|
|
}
|
|
setTimeout(() => {
|
|
this.getVideo(true)
|
|
},5000)
|
|
}).catch(err => {
|
|
})
|
|
}
|
|
},
|
|
onShow() {
|
|
let info = uni.getSystemInfoSync()
|
|
this.width = info.windowWidth
|
|
this.height = info.windowHeight
|
|
|
|
this.getVideo()
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.live-box {
|
|
align-items: center;
|
|
padding-top: 200rpx;
|
|
}
|
|
.empty-live .title{
|
|
|
|
}
|
|
.empty-live{
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background-color: #000;
|
|
align-items: center;
|
|
flex-direction: column;
|
|
padding-top: 100rpx;
|
|
}
|
|
.zwzb {
|
|
margin-top: 50rpx;
|
|
text-align: center;
|
|
color: #666;
|
|
font-size: 40rpx;
|
|
}
|
|
</style> |