quanwei
2025-12-31 48d31672b4d88900080093cd1632f9d2eb978d4d
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<template>
    <view class="diy-article">
        <view class="hdzq-icon">
            <image :src="itemData.style.image" mode="aspectFill"></image>
        </view>
        <view class="diy-bg" :style="'background-image:url('+itemData.style.background+');'">
            
            <!---列表-->
            <swiper class="swiper" :autoplay="autoplay" :interval="interval" :duration="duration" @change="changeSwiper">
                <!---第一个-->
            <swiper-item v-if="listData.length > 0">    
            <view class="article-item" v-for="(item, index) in listData" :class="'show-type__'+ itemData.style.display"
                :key="index" @click="gotoPageFunc(item)" v-if="index < 4">
                <template>
                    <view class="f24 text-ellipsis-2 lh200" :style="'color:'+itemData.style.textColor+';'">
                        {{ item.name }}
                    </view>
                </template>
            </view>
            </swiper-item>
            <!---第一个-->
            
            <!---第二个-->
            <swiper-item v-if="listData.length > 4">
            <view class="article-item" v-for="(item, index) in listData" :class="'show-type__'+ itemData.style.display"
                :key="index" @click="gotoPageFunc(item)"  v-if="index > 3 && index < 8">
                <template>
                    <view class="f24 text-ellipsis-2 lh200" :style="'color:'+itemData.style.textColor+';'">
                        {{ item.name }}
                    </view>
                </template>
            </view>
            </swiper-item>
            <!---第二个-->
            
            <!---第三个-->
            <swiper-item v-if="listData.length > 8">
            <view class="article-item" v-for="(item, index) in listData" :class="'show-type__'+ itemData.style.display"
                :key="index" @click="gotoPageFunc(item)"  v-if="index > 7 && index < 12">
                <template>
                    <view class="f24 text-ellipsis-2 lh200" :style="'color:'+itemData.style.textColor+';'">
                        {{ item.name }}
                    </view>
                </template>
            </view>
            </swiper-item>
            <!---第三个-->
            
            <!--列表-->
            </swiper>
            
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                /*数据列表*/
                listData: [],
                indicatorDots: true,
                autoplay: true,
                interval: 2000,
                duration: 500,
                indicatorActiveColor: '#ffffff',
                current: 0
            };
        },
        props: ['itemData'],
        created() {
            this.listData = this.itemData.data;
        },
        methods: {
            
            changeSwiper(e) {
                this.current = e.detail.current;
            },
 
            /*跳转页面*/
            gotoPageFunc(e) {
                if(e.is_check == 1){
                    let url = 'pages3/release/project/detail?project_id=' + e.project_id
                    this.gotoPage(url);
                }else{
                    uni.showToast({
                        title: '请开通查看权限'
                    });
                }
                
            },
            add0(m) {
                return m < 10 ? '0' + m : m
            },
            format(t) {
                //shijianchuo是整数,否则要parseInt转换
                var time = new Date(t);
                var y = time.getFullYear();
                var m = time.getMonth() + 1;
                var d = time.getDate();
                return y + '-' + this.add0(m) + '-' + this.add0(d);
            }
        }
    };
</script>
 
<style>
    .mr15{
        margin-right: 15rpx;
    }
    .diy-article {
        background: #ffffff;
        margin: 20rpx 0px;
        padding:0px 10rpx;
        border-radius: 6rpx;
        box-shadow: 0px 8rpx 3rpx 0px rgba(6, 0, 1, 0.03);
    }
    swiper {
        height: 350rpx;
    }
 
    .diy-bg{
        width: 100%;
        height: 350rpx;
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover;
    }
 
    .diy-article .show-type__10,
    .diy-article .show-type__20 {
        display: flex;
        padding: 20rpx;
        border-bottom: 1rpx solid #eeeeee;
        white-space: nowrap;  /* 不换行 */
        overflow: hidden;     /* 超出部分隐藏 */
        text-overflow: ellipsis; /* 超出显示省略号 */
    }
 
    .diy-article .show-type__10:last-child,
    .diy-article .show-type__20:last-child {
        border-bottom: none;
    }
 
    .diy-article .show-type__10 .picture {
        width: 246rpx;
        height: 140rpx;
        border-radius: 12rpx;
 
    }
 
    .diy-article .show-type__10 .title {
        height: 80rpx;
    }
 
    .diy-article .show-type__10 .des {
        height: 36rpx;
    }
 
    .diy-article .show-type__10 .icon.iconfont {
        font-size: 18rpx;
        color: #999999;
    }
    
    .diy-article .hdzq-icon {
        width: 100%;
    }
    
    .diy-article .hdzq-icon image {
        width: auto;
        height: 80rpx;
    }
</style>