not-cover.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <uni-list-item
  3. :to="'/uni_modules/uni-cms-article/pages/detail/detail?id=' + data._id"
  4. :key="data._id"
  5. class="list-item not-cover"
  6. direction="column"
  7. >
  8. <template v-slot:body>
  9. <view class="main">
  10. <view>
  11. <text class="title">{{ data.title }}</text>
  12. </view>
  13. <view class="info">
  14. <text class="author">{{ data.user_id[0] ? data.user_id[0].nickname : '' }}</text>
  15. <text class="publish_date">{{ publishTime(data.publish_date) }}</text>
  16. </view>
  17. </view>
  18. </template>
  19. </uni-list-item>
  20. </template>
  21. <script>
  22. import translatePublishTime from "@/uni_modules/uni-cms-article/common/publish-time";
  23. export default {
  24. name: "not-cover",
  25. props: {
  26. data: {
  27. type: Object,
  28. default: () => {
  29. return {}
  30. }
  31. }
  32. },
  33. methods: {
  34. // 格式化时间戳
  35. publishTime(timestamp) {
  36. return translatePublishTime(timestamp)
  37. },
  38. }
  39. }
  40. </script>
  41. <style scoped lang="scss">
  42. @import "./style.scss";
  43. </style>