帧视界壹通告,付费看视频的微信小程序
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.

144 lines
2.7 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year 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. //2.分享到朋友圈
  72. onShareTimeline(res) {
  73. return {
  74. title: this.item.title,
  75. desc: this.item.content && this.item.content.slice(0, 30),
  76. path: '/pages/publish/postDetail?id=' + this.id
  77. }
  78. },
  79. methods: {
  80. getData() {
  81. this.$api('indexGetTrendsDetail', {
  82. id : this.id
  83. }, res => {
  84. uni.stopPullDownRefresh()
  85. if (res.code == 200) {
  86. this.item = res.result.details
  87. this.isThumbs_up = res.result.isThumbs_up//是否点赞
  88. this.isThumbs_down = res.result.isThumbs_down//是否踩
  89. }
  90. })
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .postDetail {
  97. .box {
  98. padding: 20rpx;
  99. width: 100vw;
  100. .title {
  101. font-size: 34rpx;
  102. font-weight: 600;
  103. color: #000;
  104. }
  105. .createBy {
  106. display: flex;
  107. margin-top: auto;
  108. margin-bottom: 10rpx;
  109. font-size: 24rpx;
  110. margin-top: 20rpx;
  111. color: #555;
  112. &>view {
  113. display: flex;
  114. align-items: center;
  115. justify-content: center;
  116. padding-right: 20rpx;
  117. }
  118. }
  119. .controls {
  120. margin-top: 30rpx;
  121. }
  122. .content {
  123. margin-top: 30rpx;
  124. font-size: 28rpx;
  125. }
  126. }
  127. }
  128. </style>