index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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="line"></view>
  10. <view class="card-item">
  11. <view class="card-item-name">发布时间: {{pageForm.publishDate}}</view>
  12. </view>
  13. </view>
  14. <view class="card" style="margin-top: 120rpx;border-radius: 12rpx 12rpx 12rpx 0px !important;">
  15. <view class="card-item" style="position: relative;">
  16. <view class="card-item-announcement">详情内容</view>
  17. </view>
  18. <view class="card-parse">
  19. <u-parse :content="pageForm.content"></u-parse>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script setup>
  26. import {
  27. ref
  28. } from "vue"
  29. import {
  30. onLoad
  31. } from "@dcloudio/uni-app"
  32. import {
  33. getannouncemenDetail,
  34. } from "@/api/home.js"
  35. let pageForm = ref({
  36. title: null,
  37. publishDate: null,
  38. content: null
  39. })
  40. onLoad(options => {
  41. getannouncemenDetail({
  42. id: options.id
  43. }).then(res => {
  44. pageForm.value.title = res.data.title;
  45. pageForm.value.publishDate = res.data.publishDate;
  46. pageForm.value.content = res.data.content;
  47. })
  48. })
  49. </script>
  50. <style lang="scss" scoped>
  51. .card-parse {
  52. margin-top: 32rpx;
  53. min-height: 400rpx;
  54. }
  55. .card-item {
  56. .card-item-announcement-detail {
  57. font-weight: 500;
  58. font-size: 28rpx;
  59. color: #222222;
  60. line-height: 44rpx;
  61. }
  62. .card-item-name {
  63. width: auto;
  64. font-size: 24rpx;
  65. }
  66. .card-item-announcement {
  67. position: absolute;
  68. top: -64rpx;
  69. left: 0;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. width: 200rpx;
  74. height: 64rpx;
  75. background: linear-gradient(180deg, #005CA2 0%, #002F69 100%);
  76. border-radius: 12rpx 36rpx 0px 0px;
  77. font-weight: 500;
  78. font-size: 32rpx;
  79. color: #FFFFFF;
  80. }
  81. }
  82. .line {
  83. width: 100%;
  84. height: 1px;
  85. border-top: 1px dashed #DDDDDD;
  86. margin: 10rpx auto;
  87. }
  88. .card{
  89. }
  90. </style>