introduction.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view class="page-content">
  3. <mx-nav-bar title="院校动态"/>
  4. <view class="bg-white px-20 pt-20">
  5. <uv-text size="18" bold :text="prevData.title"/>
  6. </view>
  7. <uv-sticky>
  8. <view class="fx-row fx-bet-cen bg-white mx-border-b p-20">
  9. <uv-text size="13" :icon-style="{width: '22px', height: '20px'}" :prefix-icon="prevData.logo"
  10. :text="prevData.editor"/>
  11. <text class="text-tips text-xs">{{ prevData.createTime.split(' ')[0] }}</text>
  12. </view>
  13. </uv-sticky>
  14. <view class="mt-20 bg-white p-30 text-xs text-content">
  15. <uv-parse :content="detail.content||prevData.content"/>
  16. </view>
  17. <uv-back-top :scroll-top="scrollTop"/>
  18. </view>
  19. </template>
  20. <script setup>
  21. import {ref, onMounted} from 'vue'
  22. import {getUniversitiesEnrollBrochureDetail} from "@/api/webApi/collegemajor";
  23. import {useTransfer} from "@/hooks/useTransfer";
  24. import {useCacheStore} from "@/hooks/useCacheStore";
  25. import {useProvidePageScroll} from "@/hooks/usePageScrollInjection";
  26. const detail = ref({})
  27. const {prevData} = useTransfer()
  28. const {dispatchCache} = useCacheStore()
  29. const scrollTop = useProvidePageScroll()
  30. onMounted(async () => {
  31. const {id, content} = prevData.value
  32. if (id && !content) {
  33. const payload = {id}
  34. const res = await dispatchCache(getUniversitiesEnrollBrochureDetail, payload)
  35. detail.value = res.data
  36. }
  37. })
  38. </script>
  39. <style>
  40. </style>