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

96 lines
2.7 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
10 months ago
10 months ago
  1. <template>
  2. <view class="announcement-detail">
  3. <!-- 标题 -->
  4. <view class="title">{{ announcementData.title }}</view>
  5. <!-- 时间 -->
  6. <view class="time">{{ announcementData.createTime }}</view>
  7. <!-- 图片 -->
  8. <!-- <view class="image-container" v-if="announcementData.image">
  9. <image :src="announcementData.image" class="detail-image" mode="aspectFill"></image>
  10. </view> -->
  11. <!-- 正文内容 -->
  12. <!-- <view class="content">
  13. <text class="content-text">{{ announcementData.content }}</text>
  14. </view> -->
  15. <rich-text :nodes="announcementData.details"></rich-text>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'AnnouncementDetail',
  21. data() {
  22. return {
  23. announcementData: {
  24. id: '',
  25. title: '活动公告标题标题内容',
  26. time: '2025/06/14 16:47:21',
  27. image: '/static/bannerImage.png',
  28. content: '正文内容 文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明文字说明。'
  29. }
  30. }
  31. },
  32. onLoad(options) {
  33. // 接收传递的参数
  34. if (options.id) {
  35. this.announcementData.id = options.id;
  36. // 这里可以根据id获取具体的公告详情
  37. this.getAnnouncementDetail(options.id);
  38. }
  39. },
  40. methods: {
  41. async getAnnouncementDetail(id) {
  42. // 模拟获取公告详情的方法
  43. // 实际项目中这里应该调用API获取数据
  44. const res = await this.$api.home.queryNoticeById({noticeId:id })
  45. this.announcementData = res.result
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. // @import '@/uni.scss';
  52. .announcement-detail {
  53. padding: 40rpx;
  54. background-color: #fff;
  55. min-height: 100vh;
  56. .title {
  57. font-size: 34rpx;
  58. font-weight: bold;
  59. color: #000000;
  60. line-height: 1.5;
  61. margin-bottom: 20rpx;
  62. }
  63. .time {
  64. font-size: 24rpx;
  65. color: #999999;
  66. margin-bottom: 30rpx;
  67. }
  68. .image-container {
  69. margin-bottom: 30rpx;
  70. .detail-image {
  71. width: 100%;
  72. height: 250rpx;
  73. border-radius: 16rpx;
  74. // object-fit: cover;
  75. }
  76. }
  77. .content {
  78. .content-text {
  79. font-size: 28rpx;
  80. color: #000000;
  81. line-height: 1.8;
  82. text-align: justify;
  83. }
  84. }
  85. }
  86. </style>