linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
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
<template>
    <view class="">
        <view class="notice-list" @click="navToDetail(item.id,item.eventType,item.pdId)" v-for="(item,index) in data"
            :key="index">
            <view v-if="item.url" class="notice-inner flex j-c-s-b">
                <view class="notice-list-left flex f-d-c j-c-s-b">
                    <text class="notice-title f-26">{{item.title}}</text>
                    <view class="flex j-c-s-b a-i-c">
                        <view class="flex a-i-c">
                            <tag-cell v-if="item.dictValue" :text="item.dictValue" />
                            <view class="flex a-i-c">
                                <u-icon name="eye-fill" size="14" color="#CECECE"></u-icon>
                                <text class="f-24 c-99 ml-5">{{item.viewNumber}}</text>
                            </view>
                        </view>
                        <text class="f-24 c-99">{{item.createTime}}</text>
                    </view>
                </view>
                <u-image :src="setUrl(item.url)" width="200rpx" height="140rpx"></u-image>
            </view>
            <view v-else class="notice-inner flex f-d-c j-c-s-b">
                <text class="notice-title f-26">{{item.title}}</text>
                <view class="flex j-c-s-b a-i-c">
                    <view class="flex a-i-c">
                        <tag-cell :text="item.dictValue" />
                        <view class="flex a-i-c">
                            <u-icon name="eye-fill" size="14" color="#CECECE"></u-icon>
                            <text class="f-24 c-99 ml-5">{{item.viewNumber}}</text>
                        </view>
                    </view>
                    <text class="f-24 c-99">{{item.createTime}}</text>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    import tagCell from './tagCell'
    import {
        minioBaseUrl
    } from '@/common/setting.js'
    export default {
        name: "noticeList",
        props: {
            data: Array,
            pageType: String
        },
        components: {
            tagCell
        },
        data() {
            return {
 
            }
        },
        methods: {
 
            setUrl(url) {
                return `${minioBaseUrl}${url}`
            },
 
            navToDetail(id, type, pdId) {
                if (this.pageType) {
                    uni.navigateTo({
                        url: `/subPackage/article/detail?id=${id}&type=${this.pageType}`
                    })
                } else {
                    uni.navigateTo({
                        url: `/subPackage/article/detail?id=${id}`
                    })
                }
 
                // if(type == 0 || type == 1){
                //     uni.navigateTo({
                //         url: `/subPackage/article/detail?id=${id}&type=${type}&pdId=${pdId}`
                //     })
                // }else {
                //     uni.navigateTo({
                //         url: `/subPackage/article/detail?id=${id}`
                //     })
                // }
            }
        }
    }
</script>
 
<style scoped lang="scss">
    .notice-list {
        padding: 30rpx 0;
        border-bottom: 1px solid #f5f5f5;
 
        .notice-inner {
            width: 100%;
            height: 140rpx;
        }
    }
 
    .notice-list-left {
        width: calc(100% - 200rpx - 20rpx);
        height: 140rpx;
    }
 
    .notice-title {
        width: 100%;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }
 
    .ml-5 {
        margin-left: 5rpx;
    }
</style>