123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <view class="announcement">
- <view @click="itemClick(item,index)" v-for="(item,index) in list " :key="index" class="announcement-item">
- <view class="announcement-item-title">
- <view class="announcement-item-title-left">
- {{item.title}}
- </view>
- <view :style="`color:${item.is_read ? '#05CCA1':'#FDAB45'};`" class="announcement-item-title-right">
- <view v-if="!item.is_read" class="announcement-item-title-right-color">
- </view>
- <uni-icons v-else type="checkmarkempty" color="#05CCA1" size="16"></uni-icons>
- {{item.is_read ? '已读' :'未读'}}
- </view>
- </view>
- <view class="announcement-item-content">
- {{item.content}}
- </view>
- <view class="announcement-item-date">
- 发布时间 {{item.created_at}}
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: "Announcement",
- props: {
- list: {
- type: Array,
- default: () => []
- }
- },
- data() {
- return {
- };
- },
- methods: {
- itemClick(item) {
- this.$emit('itemClick', item)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .announcement-item-title-left {
- width: 500rpx;
- }
- .announcement {
- width: 100%;
- box-sizing: border-box;
- }
- .announcement-item {
- width: 100%;
- box-sizing: border-box;
- padding: 32rpx;
- background-color: #fff;
- border-radius: 5.33px;
- box-shadow: 0px 0px 6.67px 0px rgba(147, 147, 147, 0.20);
- margin-bottom: 32rpx;
- .announcement-item-content {
- padding: 24rpx 0;
- color: #666;
- }
- .announcement-item-date {
- color: #999;
- font-size: 24rpx;
- }
- .announcement-item-title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding-bottom: 24rpx;
- border-bottom: 1px solid #f2f2f2;
- .announcement-item-title-right {
- display: flex;
- align-items: center;
- .announcement-item-title-right-color {
- width: 16rpx;
- height: 16rpx;
- border-radius: 50%;
- margin-right: 10rpx;
- background-color: #FDAB45;
- }
- }
- }
- }
- </style>
|