<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>
|