国外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.

105 lines
2.8 KiB

4 days ago
  1. <template>
  2. <view class="announcement-detail">
  3. <!-- 标题 -->
  4. <view class="title">{{ announcementData.title }}</view>
  5. <!-- 时间 -->
  6. <view class="time">{{ announcementData.time }}</view>
  7. <!-- 图片 -->
  8. <view class="image-container" v-if="announcementData.images && announcementData.images.length > 0">
  9. <image
  10. v-for="(image, index) in announcementData.images"
  11. :key="index"
  12. :src="image"
  13. class="detail-image"
  14. mode="aspectFill"
  15. ></image>
  16. </view>
  17. <!-- 正文内容 -->
  18. <view class="content">
  19. <text class="content-text">{{ announcementData.content }}</text>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name: 'AnnouncementDetail',
  26. data() {
  27. return {
  28. announcementData: {
  29. id: '',
  30. title: '金海区阳光志愿服务队',
  31. time: '2025/06/14 16:47:21',
  32. images: ['/static/bannerImage.png'],
  33. content: '正文内容 文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明。'
  34. }
  35. }
  36. },
  37. onLoad(options) {
  38. // 接收传递的参数
  39. if (options.id) {
  40. this.announcementData.id = options.id;
  41. // 这里可以根据id获取具体的公告详情
  42. this.getAnnouncementDetail(options.id);
  43. }
  44. },
  45. methods: {
  46. getAnnouncementDetail(id) {
  47. // 模拟获取公告详情的方法
  48. // 实际项目中这里应该调用API获取数据
  49. console.log('获取公告详情:', id);
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. // @import '@/uni.scss';
  56. .announcement-detail {
  57. padding: 40rpx;
  58. background-color: #fff;
  59. min-height: 100vh;
  60. .title {
  61. font-size: 34rpx;
  62. font-weight: bold;
  63. color: #000000;
  64. line-height: 1.5;
  65. margin-bottom: 20rpx;
  66. }
  67. .time {
  68. font-size: 24rpx;
  69. color: #999999;
  70. margin-bottom: 30rpx;
  71. }
  72. .image-container {
  73. margin-bottom: 30rpx;
  74. .detail-image {
  75. width: 100%;
  76. height: 250rpx;
  77. border-radius: 16rpx;
  78. margin-bottom: 20rpx;
  79. // object-fit: cover;
  80. &:last-child {
  81. margin-bottom: 0;
  82. }
  83. }
  84. }
  85. .content {
  86. .content-text {
  87. font-size: 28rpx;
  88. color: #000000;
  89. line-height: 1.8;
  90. text-align: justify;
  91. }
  92. }
  93. }
  94. </style>