You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
zhishifufei_uniapp/pages/my/noticeList.vue

100 lines
2.5 KiB

<template>
<BaseContainer class="notice flex">
<NavBar title="消息中心" />
<view class="notice-list">
<view v-for="(item, index) in noticeList" class="notice-item flex flex-center-x" @click="toDetail(item)">
<image :src="item.pic" mode="aspectFill"></image>
<view class="item-info">
<view>{{ item.title }}</view>
<view>{{ item.content }}</view>
</view>
<view class="item-right">
<view>{{ item.time }}</view>
<view v-if="num > 1" class="num">{{ item.num }}</view>
</view>
</view>
</view>
</BaseContainer>
</template>
<script>
export default {
data() {
return {
noticeList: [
{ pic: '', title: '梦航课程', content: '您预约报名的课程即将开始,请及时您预约报名的课程即将开始,请及时关注', time: '11:16', num: 6},
{ pic: '', title: '通知消息', content: '您的退款已申请通过,请您及时查收账户您的退款已申请通过,请您及时查收账户', time: '2023-12-30', num: 1},
{ pic: '', title: '通知消息', content: '您的退款已申请通过,请您及时查收账户您的退款已申请通过,请您及时查收账户', time: '2023-12-30', num: 1},
]
};
},
methods: {
toDetail(item) {
uni.navigateTo({
url: `/pages/my/noticeDetail?info=${JSON.stringify(item)}`
})
},
},
};
</script>
<style lang="scss" scoped>
.notice {
flex-direction: column;
.notice-list {
flex: 1;
width: 100%;
padding: 20rpx 30rpx;
background: #fff;
.notice-item {
height: 164rpx;
border-bottom: 1px solid #E6E6E6;
image {
width: 84rpx;
height: 84rpx;
}
.item-info {
width: 450rpx;
margin: 0 auto 0 22rpx;
>view {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 24rpx;
line-height: 24rpx;
color: #999;
&:first-child {
font-size: 30rpx;
line-height: 30rpx;
color: #333;
margin-bottom: 20rpx;
}
}
}
.item-right {
display: flex;
flex-direction: column;
align-items: flex-end;
>view{
&:first-child {
font-size: 20rpx;
line-height: 30rpx;
color: #999;
margin-bottom: 28rpx;
}
&.num {
width: 22rpx;
height: 22rpx;
background: #FE4944;
border-radius: 50%;
font-size: 18rpx;
color: #fff;
text-align: center;
line-height: 22rpx;
}
}
}
}
}
}
</style>