index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="container">
  3. <page-title>公告详情</page-title>
  4. <view class="cards-list">
  5. <view class="card only-card">
  6. <view class="card-item first-card-item">
  7. <view class="card-item-announcement-detail">{{pageForm.title}}</view>
  8. </view>
  9. <view class="card-item">
  10. <view class="card-item-name">发布时间: {{pageForm.publishDate}}</view>
  11. </view>
  12. </view>
  13. <view class="card">
  14. <view class="card-item" style="padding-top: 40rpx;">
  15. <view class="card-item-announcement">详情内容:</view>
  16. </view>
  17. <view class="card-parse">
  18. <u-parse :content="pageForm.content"></u-parse>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script setup>
  25. import {
  26. ref
  27. } from "vue"
  28. import {
  29. onLoad
  30. } from "@dcloudio/uni-app"
  31. import {
  32. getannouncemenDetail,
  33. } from "@/api/home.js"
  34. let pageForm = ref({
  35. title: null,
  36. publishDate: null,
  37. content: null
  38. })
  39. onLoad(options => {
  40. getannouncemenDetail({
  41. id: options.id
  42. }).then(res => {
  43. pageForm.value.title = res.data.title;
  44. pageForm.value.publishDate = res.data.publishDate;
  45. pageForm.value.content = res.data.content;
  46. })
  47. })
  48. </script>
  49. <style lang="scss" scoped>
  50. .card-parse {
  51. margin-top: 32rpx;
  52. }
  53. </style>