a
doum
14 小时以前 307960b07d8cb122d9de0c8267b8cb7a63cfc605
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<template>
    <view class="box">
        <view class="cate">
            <view @click="changeRow(index)" :class="index === i ? 'cate-item active' : 'cate-item'" v-for="(item, index) in list" :key="index">
                {{item}}
                <view class="cate-item-x" v-if="index === i"></view>
            </view>
        </view>
        <view class="list">
            <view class="list-item" v-for="(item, index) in noticeList" :key="index">
                <view class="list-item-a">
                    <text>积分变动通知</text>
                    <view class="dian"></view>
                </view>
                <view class="list-item-b">
                    邀请好友成功,获得500积分
                </view>
                <view class="list-item-xian"></view>
                <view class="list-item-c">
                    <text>2025-11-21 09:00:00</text>
                    <view class="list-item-c-to">
                        <text>查看详情</text>
                        <image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
                    </view>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                i: 0,
                list: ['系统消息', '社区消息'],
                noticeList: [],
                page: 1,
                next: true
            };
        },
        onLoad() {
            this.getList()
        },
        onReachBottom() {
            this.getList()
        },
        methods: {
            changeRow(index) {
                this.i = index
                this.next = true
                this.noticeList = []
                this.page = 1
                this.getList()
            },
            getList() {
                if (!this.next) return;
                this.$u.api.findNoticeCardDTOPage({
                    capacity: 20,
                    page: this.page,
                    model: {
                        queryType: this.i
                    }
                }).then(res => {
                    if (res.code === 200) {
                        this.noticeList.push(...res.data.records)
                        this.page++
                        if (this.noticeList.length === res.data.total) {
                            this.next = false
                        }
                    }
                })
            }
        }
    }
</script>
 
<style>
    page {
        background-color: #F9F9FB;
    }
</style>
<style lang="scss" scoped>
    .box {
        width: 100%;
        .list {
            width: 100%;
            padding: 22rpx 30rpx;
            box-sizing: border-box;
            .list-item {
                width: 100%;
                padding: 30rpx;
                box-sizing: border-box;
                background-color: #ffffff;
                border-radius: 16rpx;
                margin-bottom: 20rpx;
                &:last-child {
                    margin: 0 !important;
                }
                .list-item-a {
                    width: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    text {
                        font-weight: 600;
                        font-size: 30rpx;
                        color: #222222;
                    }
                    .dian {
                        width: 16rpx;
                        height: 16rpx;
                        border-radius: 50%;
                        background: #E4001D;
                    }
                }
                .list-item-b {
                    font-weight: 400;
                    font-size: 26rpx;
                    color: #999999;
                    margin-top: 18rpx;
                }
                .list-item-xian {
                    width: 100%;
                    height: 1rpx;
                    background-color: #E5E5E5;
                    margin-top: 26rpx;
                }
                .list-item-c {
                    width: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    margin-top: 22rpx;
                    text {
                        font-weight: 400;
                        font-size: 24rpx;
                        color: #999999;
                    }
                    .list-item-c-to {
                        display: flex;
                        align-items: center;
                        text {
                            font-weight: 400;
                            font-size: 24rpx;
                            color: #999999;
                        }
                        image {
                            width: 13rpx;
                            height: 21rpx;
                            margin-left: 8rpx;
                        }
                    }
                }
            }
        }
        .cate {
            width: 100%;
            height: 90rpx;
            display: flex;
            align-items: center;
            background: #FFFFFF;
            .active {
                font-weight: 500 !important;
                font-size: 32rpx !important;
                color: #222222 !important;
            }
            .cate-item {
                flex: 1;
                height: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
                font-weight: 400;
                font-size: 30rpx;
                color: #666666;
                position: relative;
                .cate-item-x {
                    position: absolute;
                    bottom: 0;
                    left: 50%;
                    transform: translate(-50%, 0);
                    width: 40rpx;
                    height: 6rpx;
                    background-color: #004096;
                }
            }
        }
    }
</style>