detail.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <view class="page-content pb-60">
  3. <uv-loading-page :loading="loading"/>
  4. <mx-nav-bar title="资讯详情"/>
  5. <view class="p-40 text-main">
  6. <view class="text-2xl mb-40">{{ detail.title }}</view>
  7. <view class="fx-row fx-bet-cen">
  8. <view>
  9. <uv-text size="14" prefix-icon="clock-fill" :icon-style="{color: 'var(--primary-color)'}"
  10. :text="detail.sendDate"/>
  11. </view>
  12. <uv-tags v-if="detail.type" size="mini" type="primary" plain plain-fill :text="detail.type"/>
  13. </view>
  14. <view class="html mt-20" v-html="detail.content"/>
  15. </view>
  16. </view>
  17. </template>
  18. <script setup>
  19. import {ref, onMounted} from 'vue'
  20. import {useTransfer} from "@/hooks/useTransfer";
  21. import {info} from "@/api/webApi/career-news";
  22. const detail = ref({})
  23. const loading = ref(false)
  24. const {prevData} = useTransfer()
  25. onMounted(async () => {
  26. loading.value = true
  27. try {
  28. const {data} = await info({id: prevData.value.id})
  29. detail.value = data
  30. } finally {
  31. loading.value = false
  32. }
  33. })
  34. </script>
  35. <style scoped lang="scss">
  36. .html {
  37. font-size: 13px;
  38. ::v-deep img,
  39. ::v-deep table {
  40. width: 100%;
  41. max-width: 100%;
  42. }
  43. ::v-deep p {
  44. line-height: 26px;
  45. }
  46. ::v-deep h1, ::v-deep h2, ::v-deep h3, ::v-deep h4, ::v-deep h5, ::v-deep h6 {
  47. line-height: 40px;
  48. }
  49. }
  50. </style>