huangsijun
2025-09-22 a78c011de350b188afb03beb2f26a73f35f71986
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
76
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<template>
    <view class="diy-live" v-if="itemData.data.length>0"  :style="{ background: itemData.style.background }">
        <view class="diy-head d-e-c"   :style="'background-image: url('+itemData.style.background_image+');'">
            <view class="right" @click="gotoList">
                <text @click="gotoPage('/pagesLive/live/index')" class="white">更多</text>
                <text class="iconfont icon-jiantou mr20" style="font-size: 24rpx;color: #999999;"></text>
            </view>
        </view>
        <view class="list d-s-c f-w">
            <view class="item" v-for="(item, index) in itemData.data" :key="index" @click="gotoDetail(item)">
                <view class="pic pr">
                    <text class="state" :class="{bg101:item.live_status==101,bg102:item.live_status==102,bg103:item.live_status==104}"
                     v-if="item.live_status==101||item.live_status==102||item.live_status==104">
                        {{convertStatus(item.live_status)}}
                    </text>
                    <image :src="item.share.file_path" mode="aspectFit"></image>
                    <view class="anchor">{{item.anchor_name}}</view>
                </view>
                <view class="text-ellipsis f30 live_name tc">{{ item.name }}</view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        components: {},
        data() {
            return {};
        },
        props: ['itemData'],
        created() {
 
        },
        methods: {
 
            scroll(e) {},
 
            /*状态转换*/
            convertStatus(num) {
                let str = '';
                switch (num) {
                    case 101:
                        str = '直播中';
                        break;
                    case 102:
                        str = '未开始';
                        break;
                    case 103:
                        str = '已结束';
                        break;
                    case 104:
                        str = '禁播';
                        break;
                    case 105:
                        str = '暂停';
                        break;
                    case 106:
                        str = '异常';
                        break;
                    case 107:
                        str = '已过期';
                        break;
                }
                return str;
            },
 
            /*跳转列表*/
            gotoList() {
                this.gotoPage('/pages/plus/live/wx/list');
            },
            /*跳转产品详情*/
            gotoDetail(item) {
                // 第三方直播
                this.gotoPage('/pagesLive/live/live?room_id=' + item.room_id + "&sence=join");
            }
        }
    };
</script>
 
<style lang="scss">
.diy-live {
    margin: 20rpx;
    border-radius: 20rpx;
    background: #ffffff;
    // box-shadow: 0 0 8rpx rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.diy-live .diy-head {
    height: 90rpx;
    align-items: center;background-size: 100% 100%;
    
}
.diy-live .diy-head .name {
    font-size: 36rpx;
    font-weight: bold;
    width: 200rpx;
}
.diy-live .list{
    padding: 20rpx;
}
.diy-live .list .item {
    width: 246rpx;
    margin-right: 20rpx;
    height: 330rpx;
    background-color: #f6f6f6;
    border-radius: 12rpx;
    overflow: hidden;
}
.diy-live .list .item:nth-child(2n + 0) {
    margin-right: 0;
}
.diy-live .list .item .pic {
    width: 246rpx;
    height: 246rpx;
}
.diy-live .list .item .pic .state{ 
    position: absolute;
    z-index: 90;
    top: 20rpx;
    left: 20rpx;
    padding: 4rpx 8rpx;
    background: red;
    color: #FFFFFF;
    border-radius: 8rpx;
}
.diy-live .list .item .pic .state.bg101{
    background: red;
}
.diy-live .list .item .pic .state.bg102{
    background: #ffb100;
}
.diy-live .list .item .pic .state.bg103{
    background: #333333;
}
.diy-live .list .item image {
    width: 246rpx;
    height: 246rpx;
    border-radius: 16rpx;
}
.diy-live  .anchor{
    position: absolute;
    bottom: 12rpx;
    left: 18rpx;
    font-size: 24rpx;
    line-height: 24rpx;
    
}
</style>