warningDetail.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <div class="warning-detail">
  3. <custom-header name="查看详情"></custom-header>
  4. <div class="article-content">
  5. <div class="article-header">
  6. <div class="title">{{ warningDetail.title }}</div>
  7. <div class="author-info">
  8. <el-avatar :size="16" :src="warningDetail.icon" />
  9. <span class="author-name">{{ warningDetail.name }}</span>
  10. <span class="qa-date">{{ warningDetail?.createTime && warningDetail?.createTime?.slice(0, 10) }}</span>
  11. </div>
  12. </div>
  13. <div class="article-image">
  14. <img :src="warningDetail?.media && warningDetail?.media[0]" alt="荔枝开花图片" />
  15. </div>
  16. <div class="article-text">
  17. <span v-html="warningDetail.content"></span>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script setup>
  23. import customHeader from "@/components/customHeader.vue";
  24. import { ref,onActivated } from "vue";
  25. import { useRoute } from "vue-router";
  26. const route = useRoute();
  27. const warningDetail = ref({});
  28. onActivated(() => {
  29. getWarningDetail();
  30. });
  31. const getWarningDetail = () => {
  32. const params = {
  33. id: route.query.id,
  34. };
  35. VE_API.home.warningDetail(params).then((res) => {
  36. warningDetail.value = res.data || {};
  37. });
  38. };
  39. </script>
  40. <style scoped lang="scss">
  41. .warning-detail {
  42. position: relative;
  43. width: 100%;
  44. height: 100vh;
  45. .article-content {
  46. padding: 8px 16px;
  47. overflow-y: auto;
  48. height: calc(100% - 40px);
  49. box-sizing: border-box;
  50. .article-header {
  51. .title {
  52. font-size: 18px;
  53. font-weight: bold;
  54. margin-bottom: 6px;
  55. text-align: left;
  56. }
  57. .author-info {
  58. display: flex;
  59. align-items: center;
  60. gap: 10px;
  61. padding-bottom: 12px;
  62. border-bottom: 1px solid #f5f5f5;
  63. .author-name,.qa-date {
  64. font-size: 14px;
  65. color: #666;
  66. font-weight: normal;
  67. }
  68. }
  69. }
  70. .article-image {
  71. width: 100%;
  72. margin: 12px 0 20px 0;
  73. img {
  74. width: 100%;
  75. height: 175px;
  76. border-radius: 5px;
  77. object-fit: cover;
  78. }
  79. }
  80. .article-text{
  81. ::v-deep{
  82. img {
  83. width: 100%;
  84. height: 175px;
  85. border-radius: 5px;
  86. object-fit: cover;
  87. }
  88. }
  89. }
  90. }
  91. }
  92. </style>