瑶都万能墙
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.

136 lines
2.5 KiB

4 months ago
  1. <template>
  2. <view class="postDetail">
  3. <navbar leftClick @leftClick="$utils.navigateBack" title="动态详情" />
  4. <view class="swipe">
  5. <uv-swiper :list="item.image &&
  6. item.image.split(',')" indicator height="420rpx"></uv-swiper>
  7. </view>
  8. <view class="box">
  9. <view class="title">
  10. {{ item.title }}
  11. </view>
  12. <view class="createBy">
  13. <view class="">
  14. 发布人{{ item.userId }}
  15. </view>
  16. <view class="">
  17. 发布时间{{ $dayjs(item.createTime).format('YYYY-MM-DD') }}
  18. </view>
  19. </view>
  20. <view class="content">
  21. <uv-parse :content="item.content"></uv-parse>
  22. </view>
  23. <!-- <view class="controls">
  24. <contentControls
  25. :type="2"
  26. :up="isThumbs_up"
  27. :down="isThumbs_down"
  28. @loadData="getData"
  29. :detail="item"/>
  30. </view> -->
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. // import contentControls from '@/components/content/contentControls.vue'
  36. export default {
  37. components: {
  38. // contentControls
  39. },
  40. data() {
  41. return {
  42. list: [
  43. ],
  44. item: {},
  45. isThumbs_up: undefined,//是否点赞
  46. isThumbs_down: undefined,//是否踩
  47. id : 0,
  48. }
  49. },
  50. onLoad(options) {
  51. // this.$route.query的参数
  52. console.log(options)
  53. this.id = options.id
  54. },
  55. onPullDownRefresh(){
  56. this.getData()
  57. },
  58. onShow() {
  59. this.getData()
  60. },
  61. onShareAppMessage(res) {
  62. // if (res.from === 'button') {// 来自页面内分享按钮
  63. // console.log(res.target)
  64. // }
  65. return {
  66. title: this.item.title,
  67. desc: this.item.content && this.item.content.slice(0, 30),
  68. path: '/pages/publish/postDetail?id=' + this.id
  69. }
  70. },
  71. methods: {
  72. getData() {
  73. this.$api('indexGetTrendsDetail', {
  74. id : this.id
  75. }, res => {
  76. uni.stopPullDownRefresh()
  77. if (res.code == 200) {
  78. this.item = res.result.details
  79. this.isThumbs_up = res.result.isThumbs_up//是否点赞
  80. this.isThumbs_down = res.result.isThumbs_down//是否踩
  81. }
  82. })
  83. },
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. .postDetail {
  89. .box {
  90. padding: 20rpx;
  91. width: 100vw;
  92. .title {
  93. font-size: 34rpx;
  94. font-weight: 600;
  95. color: #000;
  96. }
  97. .createBy {
  98. display: flex;
  99. margin-top: auto;
  100. margin-bottom: 10rpx;
  101. font-size: 24rpx;
  102. margin-top: 20rpx;
  103. color: #555;
  104. &>view {
  105. display: flex;
  106. align-items: center;
  107. justify-content: center;
  108. padding-right: 20rpx;
  109. }
  110. }
  111. .controls {
  112. margin-top: 30rpx;
  113. }
  114. .content {
  115. margin-top: 30rpx;
  116. font-size: 28rpx;
  117. }
  118. }
  119. }
  120. </style>