裂变星小程序-25.03.04
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.3 KiB

  1. <template>
  2. <view>
  3. <navbar title="动态详情" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="content">
  5. <view class="title">{{ detail.title || '' }}</view>
  6. <view class="desc">{{ detail.createTime ? `发布于${detail.createTime}` : '' }}</view>
  7. <uv-parse :content="detail.details"></uv-parse>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import popupUnlock from '../components/popupUnlock.vue'
  13. import popupQrCode from '../components/popupQrCode.vue'
  14. export default {
  15. components: {
  16. popupUnlock,
  17. popupQrCode,
  18. },
  19. data() {
  20. return {
  21. detail: {
  22. id: null,
  23. title: null,
  24. image: null,
  25. details: null,
  26. createTime: null,
  27. },
  28. isLocked: true,
  29. }
  30. },
  31. async onLoad(option) {
  32. const { id } = option
  33. await this.fetchDetails(id)
  34. },
  35. methods: {
  36. async fetchDetails(id) {
  37. try {
  38. this.detail = await this.$fetch('getNewsById', { id })
  39. } catch (err) {
  40. }
  41. },
  42. }
  43. }
  44. </script>
  45. <style scoped lang="scss">
  46. .content {
  47. padding: 40rpx 20rpx;
  48. }
  49. .title {
  50. color: #474747;
  51. font-size: 36rpx;
  52. font-weight: 700;
  53. }
  54. .desc {
  55. color: #A2A2A2;
  56. font-size: 24rpx;
  57. margin-top: 6rpx;
  58. }
  59. </style>