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

114 lines
2.6 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months 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. methods: {
  37. goToDetail(item) {
  38. uni.navigateTo({
  39. url: '/subPages/index/announcementDetail?id=' + item.id
  40. })
  41. },
  42. // mixinSetParams() {
  43. // return {
  44. // type: 1
  45. // }
  46. // }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .announcement-page {
  52. background-color: $uni-bg-color-grey;
  53. min-height: 100vh;
  54. padding: 20rpx;
  55. }
  56. .announcement-list {
  57. .announcement-item {
  58. background-color: $uni-bg-color;
  59. border-radius: 16rpx;
  60. margin-bottom: 20rpx;
  61. padding: 30rpx;
  62. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  63. .item-content {
  64. display: flex;
  65. justify-content: space-between;
  66. align-items: flex-start;
  67. .text-content {
  68. flex: 1;
  69. margin-right: 20rpx;
  70. .title {
  71. font-size: 32rpx;
  72. font-weight: bold;
  73. color: #000000;
  74. margin-bottom: 16rpx;
  75. line-height: 1.4;
  76. }
  77. .description {
  78. font-size: 28rpx;
  79. color: #0F2248;
  80. line-height: 1.5;
  81. margin-bottom: 20rpx;
  82. display: -webkit-box;
  83. -webkit-box-orient: vertical;
  84. -webkit-line-clamp: 2;
  85. overflow: hidden;
  86. text-overflow: ellipsis;
  87. }
  88. .time {
  89. font-size: 24rpx;
  90. color: $uni-text-color-grey;
  91. }
  92. }
  93. .image-content {
  94. flex-shrink: 0;
  95. .announcement-image {
  96. width: 220rpx;
  97. height: 200rpx;
  98. border-radius: 15rpx;
  99. background-color: $uni-bg-color-grey;
  100. }
  101. }
  102. }
  103. }
  104. }
  105. </style>