木邻有你前端代码仓库
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.

103 lines
2.4 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="announcement-page">
  3. <!-- 公告列表 -->
  4. <view class="announcement-list">
  5. <view
  6. class="announcement-item"
  7. v-for="(item, index) in list"
  8. :key="index"
  9. @click="goToDetail(item)"
  10. >
  11. <view class="item-content">
  12. <view class="text-content">
  13. <view class="title">{{ item.title }}</view>
  14. <!-- <view class="description" v-html="item.details"></view> -->
  15. <rich-text class="description" :nodes="item.details"></rich-text>
  16. <view class="time">{{ item.createTime }}</view>
  17. </view>
  18. <!-- <view class="image-content" v-if="item.image">
  19. <image :src="item.image" class="announcement-image" mode="aspectFill"></image>
  20. </view> -->
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import ListMixin from '@/mixins/list.js'
  28. export default {
  29. name: 'Announcement',
  30. mixins: [ListMixin],
  31. data() {
  32. return {
  33. mixinListApi: 'home.queryNoticeList'
  34. }
  35. },
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .announcement-page {
  40. background-color: $uni-bg-color-grey;
  41. min-height: 100vh;
  42. padding: 20rpx;
  43. }
  44. .announcement-list {
  45. .announcement-item {
  46. background-color: $uni-bg-color;
  47. border-radius: 16rpx;
  48. margin-bottom: 20rpx;
  49. padding: 30rpx;
  50. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  51. .item-content {
  52. display: flex;
  53. justify-content: space-between;
  54. align-items: flex-start;
  55. .text-content {
  56. flex: 1;
  57. margin-right: 20rpx;
  58. .title {
  59. font-size: 32rpx;
  60. font-weight: bold;
  61. color: #000000;
  62. margin-bottom: 16rpx;
  63. line-height: 1.4;
  64. }
  65. .description {
  66. font-size: 28rpx;
  67. color: #0F2248;
  68. line-height: 1.5;
  69. margin-bottom: 20rpx;
  70. display: -webkit-box;
  71. -webkit-box-orient: vertical;
  72. -webkit-line-clamp: 2;
  73. overflow: hidden;
  74. text-overflow: ellipsis;
  75. }
  76. .time {
  77. font-size: 24rpx;
  78. color: $uni-text-color-grey;
  79. }
  80. }
  81. .image-content {
  82. flex-shrink: 0;
  83. .announcement-image {
  84. width: 220rpx;
  85. height: 200rpx;
  86. border-radius: 15rpx;
  87. background-color: $uni-bg-color-grey;
  88. }
  89. }
  90. }
  91. }
  92. }
  93. </style>