国外MOSE官网
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.

152 lines
4.1 KiB

6 days 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 announcementList"
  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">{{ item.description }}</view>
  15. <view class="time">{{ item.time }}</view>
  16. </view>
  17. <view class="image-content" v-if="item.image">
  18. <image :src="item.image" class="announcement-image" mode="aspectFill"></image>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default {
  27. name: 'Announcement',
  28. data() {
  29. return {
  30. announcementList: [
  31. {
  32. id: 1,
  33. title: '活动公告标题',
  34. description: '建筑学文字说明文字说明文字说明文字说明文字说明文字说明......',
  35. time: '2025/06/14 16:47:21',
  36. image: '/static/bannerImage.png'
  37. },
  38. {
  39. id: 2,
  40. title: '活动公告标题',
  41. description: '考古学文字说明文字说明文字说明文字说明考古学文字说明文字说明文字说明文字说明文字说明......',
  42. time: '2025/06/14 16:47:21',
  43. image: ''
  44. },
  45. {
  46. id: 3,
  47. title: '活动公告标题',
  48. description: '建筑学文字说明文字说明文字说明文字说明文字说明文字说明......',
  49. time: '2025/06/14 16:47:21',
  50. image: '/static/bannerImage.png'
  51. },
  52. {
  53. id: 4,
  54. title: '活动公告标题',
  55. description: '建筑学文字说明文字说明文字说明文字说明文字说明文字说明......',
  56. time: '2025/06/14 16:47:21',
  57. image: '/static/bannerImage.png'
  58. },
  59. {
  60. id: 5,
  61. title: '活动公告标题',
  62. description: '考古学文字说明文字说明文字说明文字说明考古学文字说明文字说明文字说明文字说明文字说明......',
  63. time: '2025/06/14 16:47:21',
  64. image: ''
  65. },
  66. {
  67. id: 6,
  68. title: '活动公告标题',
  69. description: '建筑学文字说明文字说明文字说明文字说明文字说明文字说明......',
  70. time: '2025/06/14 16:47:21',
  71. image: '/static/bannerImage.png'
  72. }
  73. ]
  74. }
  75. },
  76. onLoad() {
  77. // 页面加载时的逻辑
  78. },
  79. methods: {
  80. goToDetail(item) {
  81. uni.navigateTo({
  82. url: `/subPages/index/announcementDetail?id=${item.id}`
  83. })
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss" scoped>
  89. .announcement-page {
  90. background-color: $uni-bg-color-grey;
  91. min-height: 100vh;
  92. padding: 20rpx;
  93. }
  94. .announcement-list {
  95. .announcement-item {
  96. background-color: $uni-bg-color;
  97. border-radius: 16rpx;
  98. margin-bottom: 20rpx;
  99. padding: 30rpx;
  100. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  101. .item-content {
  102. display: flex;
  103. justify-content: space-between;
  104. align-items: flex-start;
  105. .text-content {
  106. flex: 1;
  107. margin-right: 20rpx;
  108. .title {
  109. font-size: 32rpx;
  110. font-weight: bold;
  111. color: #000000;
  112. margin-bottom: 16rpx;
  113. line-height: 1.4;
  114. }
  115. .description {
  116. font-size: 28rpx;
  117. color: #0F2248;
  118. line-height: 1.5;
  119. margin-bottom: 20rpx;
  120. display: -webkit-box;
  121. -webkit-box-orient: vertical;
  122. -webkit-line-clamp: 2;
  123. overflow: hidden;
  124. text-overflow: ellipsis;
  125. }
  126. .time {
  127. font-size: 24rpx;
  128. color: $uni-text-color-grey;
  129. }
  130. }
  131. .image-content {
  132. flex-shrink: 0;
  133. .announcement-image {
  134. width: 220rpx;
  135. height: 200rpx;
  136. border-radius: 15rpx;
  137. background-color: $uni-bg-color-grey;
  138. }
  139. }
  140. }
  141. }
  142. }
  143. </style>