index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="page-view f-30 p-40 flex-dir-column flex-x-center">
  3. <view class="title">{{detailVO.title}}</view>
  4. <view class="time">发布时间:{{detailVO.createTime?detailVO.createTime.substring(0,10) : ''}}</view>
  5. <view class="col-info-d t-c m-b-30">
  6. <u-parse :content="detailVO.content"></u-parse>
  7. </view>
  8. <view class="dis-flex flex-x-between bottom-btns">
  9. <view class="dis-flex flex-y-center">
  10. <u-icon name="eye" color="#7f7f7f" size="18"></u-icon>
  11. <view class="btn-title">{{detailVO.views || 0}}人阅读</view>
  12. </view>
  13. <view class="dis-flex flex-y-center">
  14. <u-icon name="thumb-up" color="#7f7f7f" size="18"></u-icon>
  15. <view class="btn-title">{{detailVO.likeNum || 0}}点赞</view>
  16. </view>
  17. <view class="dis-flex flex-y-center" @click="addCollection">
  18. <u-icon name="star" color="#7f7f7f" size="18"></u-icon>
  19. <view class="btn-title">{{detailVO.collectNum || 0}}收藏数</view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
  26. export default {
  27. mixins: [themeMixins],
  28. data() {
  29. return {
  30. detailVO: {},
  31. }
  32. },
  33. methods: {
  34. getInformationDetail(id) {
  35. this.$u.api.getInformationDetail(id).then(res => {
  36. if (res.data.content) {
  37. res.data.content = decodeURIComponent(res.data.content);
  38. }
  39. this.detailVO = res.data || {}
  40. })
  41. },
  42. addCollection() {
  43. this.detailVO.id
  44. },
  45. addLike() {
  46. this.detailVO.id
  47. }
  48. },
  49. onLoad(options) {
  50. this.getInformationDetail(options.id);
  51. },
  52. }
  53. </script>
  54. <style scoped lang="scss">
  55. .title {
  56. width: 100%;
  57. text-align: center;
  58. font-size: 25px;
  59. color: #65371b;
  60. margin-bottom: 20px;
  61. }
  62. .time {
  63. font-size: 14px;
  64. color: #787878;
  65. font-weight: 300;
  66. padding-bottom: 10px;
  67. }
  68. .bottom-btns {
  69. width: 100%;
  70. .btn-title {
  71. margin-left: 10rpx;
  72. color: #7f7f7f;
  73. }
  74. }
  75. </style>