news_detail.vue 912 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view class="container">
  3. <!-- 标题区域 -->
  4. <view class="title">{{ info.theme }}</view>
  5. <!-- 时间区域 -->
  6. <view class="time">{{ dayjs(info.createTime).format('YYYY-MM-DD HH:mm:ss') }}</view>
  7. <!-- 内容区域 -->
  8. <view class="content">
  9. <uv-parse :content="info.content"></uv-parse>
  10. </view>
  11. </view>
  12. </template>
  13. <script setup>
  14. import { onLoad } from '@dcloudio/uni-app'
  15. import { ref } from 'vue'
  16. import dayjs from 'dayjs'
  17. // 新闻详情信息
  18. const info = ref({})
  19. onLoad((options) => {
  20. if (options.info) {
  21. info.value = JSON.parse(decodeURIComponent(options.info))
  22. // console.log(info.value)
  23. }
  24. })
  25. </script>
  26. <style lang="scss" scoped>
  27. .container {
  28. padding: 20rpx 18rpx;
  29. min-height: 100vh;
  30. .title {
  31. font-size: 32rpx;
  32. font-weight: bold;
  33. }
  34. .time {
  35. margin-top: 15rpx;
  36. font-size: 24rpx;
  37. color: #808080;
  38. }
  39. .content {
  40. margin-top: 20rpx;
  41. }
  42. }
  43. </style>