小说小程序前端代码仓库(小程序)
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.

137 lines
3.0 KiB

  1. <template>
  2. <view class="announcements-container">
  3. <uv-navbar
  4. title="全部公告"
  5. :autoBack="true"
  6. fixed
  7. placeholder
  8. titleStyle="color: #333; font-weight: 500;"
  9. :border="false"
  10. ></uv-navbar>
  11. <view class="announcements-list">
  12. <view
  13. class="announcement-item"
  14. v-for="(item, index) in announcements"
  15. :key="index"
  16. @click="viewAnnouncement(item)"
  17. >
  18. <view class="item-left">
  19. <text class="tag">通讯</text>
  20. <text class="title">{{ item.title }}</text>
  21. </view>
  22. <view class="item-right">
  23. <uv-icon name="arrow-right" color="#C8C8C8" size="28rpx"></uv-icon>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. components: {
  32. 'uv-navbar': () => import('@/uni_modules/uv-navbar/components/uv-navbar/uv-navbar.vue')
  33. },
  34. data() {
  35. return {
  36. announcements: [
  37. {
  38. id: 1,
  39. title: '2025年2月平台福利活动拟获奖作品公示',
  40. type: '通讯'
  41. },
  42. {
  43. id: 2,
  44. title: '2025年2月平台福利活动拟获奖作品公示',
  45. type: '通讯'
  46. },
  47. {
  48. id: 3,
  49. title: '2025年2月平台福利活动拟获奖作品公示',
  50. type: '通讯'
  51. },
  52. {
  53. id: 4,
  54. title: '2025年2月平台福利活动拟获奖作品公示',
  55. type: '通讯'
  56. },
  57. {
  58. id: 5,
  59. title: '2025年2月平台福利活动拟获奖作品公示',
  60. type: '通讯'
  61. },
  62. {
  63. id: 6,
  64. title: '2025年2月平台福利活动拟获奖作品公示',
  65. type: '通讯'
  66. },
  67. {
  68. id: 7,
  69. title: '2025年2月平台福利活动拟获奖作品公示',
  70. type: '通讯'
  71. }
  72. ]
  73. }
  74. },
  75. methods: {
  76. viewAnnouncement(item) {
  77. uni.navigateTo({
  78. url: `/pages_order/novel/announcement?id=${item.id}`
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss">
  85. .announcements-container {
  86. min-height: 100vh;
  87. background-color: #F8F8F8;
  88. .announcements-list {
  89. padding: 20rpx;
  90. .announcement-item {
  91. display: flex;
  92. justify-content: space-between;
  93. align-items: center;
  94. background-color: #FFFFFF;
  95. padding: 30rpx;
  96. margin-bottom: 20rpx;
  97. border-radius: 12rpx;
  98. .item-left {
  99. flex: 1;
  100. margin-right: 20rpx;
  101. .tag {
  102. display: inline-block;
  103. font-size: 24rpx;
  104. color: #666666;
  105. background-color: #F5F5F5;
  106. padding: 4rpx 12rpx;
  107. border-radius: 6rpx;
  108. margin-bottom: 16rpx;
  109. }
  110. .title {
  111. display: block;
  112. font-size: 28rpx;
  113. color: #333333;
  114. line-height: 1.4;
  115. }
  116. }
  117. .item-right {
  118. display: flex;
  119. align-items: center;
  120. }
  121. &:active {
  122. background-color: #F9F9F9;
  123. }
  124. }
  125. }
  126. }
  127. </style>