index.vue 4.99 KB
Newer Older
程智春 committed
1 2
<template>
    <div class="container" :style="{'padding-top':navHeight +'px'}">
程智春 committed
3
        <div class="masker"></div>
程智春 committed
4
        <image class="bg-img" :src="overInfo.coverUrl" mode="aspectFill" alt=""></image>
程智春 committed
5 6 7 8
        <div class="conbox">
            <div class="live-over">
                <div class="over-text">直播已结束</div>
                <div class="live-time">直播时长:{{overInfo.liveTime}}</div>
程智春 committed
9
            </div>
程智春 committed
10 11 12 13 14 15 16 17 18 19 20

            <div class="live-info">
                <div class="info-row item-row-one">
                    <div class="info-item">
                        <div class="item-num">{{overInfo.watchNum}}</div>
                        <div class="item-text">观看</div>
                    </div>
                    <div class="info-item">
                        <div class="item-num">{{overInfo.goodsClickNum}}</div>
                        <div class="item-text">商品点击</div>
                    </div>
程智春 committed
21
                </div>
程智春 committed
22 23 24 25 26 27 28 29 30 31 32 33 34
                <div class="info-row">
                    <div class="info-item">
                        <div class="item-num">{{overInfo.shareNum}}</div>
                        <div class="item-text">分享</div>
                    </div>
                    <div class="info-item">
                        <div class="item-num">{{overInfo.guestBookNum}}</div>
                        <div class="item-text">评论</div>
                    </div>
                    <div class="info-item">
                        <div class="item-num">{{overInfo.likeNum}}</div>
                        <div class="item-text"></div>
                    </div>
程智春 committed
35 36 37
                </div>
            </div>
        </div>
程智春 committed
38 39 40
        <navBar :navTop="navTop" :liveInfo="liveInfo" :navHeight="navHeight" :type="type"></navBar>

        
程智春 committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75

    </div>
</template>

<script>
import navBar from '@/components/common/navbar.vue'
import { getNavbarInfo,DFSImg } from '../../utils/common.js'

import liveApi from '@/api/liveing'
export default {
    data(){
        return{
            navTop : '',
            navHeight : '',

            type : 2,

            overInfo : {},

            liveInfo : {}
        }
    },
    components:{
        navBar
    },
    created(){
        //获取导航栏信息
        getNavbarInfo((res) => {
            this.navTop = res.navTop
            this.navHeight = res.navHeight
        })

        
    },
    onShow(){
程智春 committed
76
        // this.overInfo = {}
程智春 committed
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
    },
    onLoad(options){

        this.overInfo = {}

        if(options.type){
            this.type = options.type;
        }

        this.liveInfo = JSON.parse(options.liveInfo)
        
        this.getOverInfo(options.id)
        
    },
    methods:{
        getOverInfo(id){
            liveApi.queryCompleteDetail({
                id : id
            }).then(res => {
                // console.log(res.data.code == 200)
                if(res.data.code == 200){

                    // console.log(res.data.data)
                    res.data.data.coverUrl = DFSImg(res.data.data.coverUrl)
                    this.overInfo = res.data.data

                    console.log(this.overInfo)
                }
            })
        }   
    },

    
}
</script>

<style scoped lang="scss">
    .container{
        width: 100%;
        height: 100vh;
        box-sizing: border-box;
        background-color: rgba(102,102,102,.38);
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
程智春 committed
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
        .conbox{
            width: 100%;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 10;
        }
        .masker{
            width: 100%;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
            z-index: 1;
            background-color: rgba(102,102,102,.38);
        }
程智春 committed
140 141 142 143 144 145
        .bg-img{
            width: 100%;
            height: 100vh;
            position: fixed;
            top: 0;
            left: 0;
程智春 committed
146
            background-color: rgba(102,102,102,.38);
程智春 committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
        }
        .live-over{
            color: white;
            text-align: center;
            padding-top: 25vh;
            .over-text{
                font-size: 36px;
                color: #FFFFFF;
                font-weight: bold;
            }
            .live-time{
                font-size: 15px;
                line-height: 30px;
            }
        }
        .live-info{
            font-size: 18px;
            color: white;
            margin-top: 10vh;
            width: 100%;
            .info-row{
                display: flex;
                justify-content: space-around;
                align-items: center;
                margin-bottom: 40px;
                font-weight: bold;
                .info-item{
                    text-align: center;
                }
            }
            .item-row-one{
                width: 100%;
                padding: 0 60px;
                box-sizing: border-box;
                .info-item{
                    width: 50%;
                }
            }
        }
    }
</style>