three-cover.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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"
  6. direction="column"
  7. >
  8. <template v-slot:body>
  9. <view class="main">
  10. <text class="title">{{ data.title }}</text>
  11. <view class="thumbnails">
  12. <image
  13. v-for="image in data.thumbnail"
  14. :src="image"
  15. mode="aspectFill"
  16. class="img"
  17. ></image>
  18. </view>
  19. <view class="info">
  20. <text class="author">{{ data.user_id[0] ? data.user_id[0].nickname : '' }}</text>
  21. <text class="publish_date">{{ publishTime(data.publish_date) }}</text>
  22. </view>
  23. </view>
  24. </template>
  25. </uni-list-item>
  26. </template>
  27. <script>
  28. import translatePublishTime from "@/uni_modules/uni-cms-article/common/publish-time";
  29. export default {
  30. name: "three-cover",
  31. props: {
  32. data: {
  33. type: Object,
  34. default: () => {
  35. return {}
  36. }
  37. }
  38. },
  39. methods: {
  40. // 格式化时间戳
  41. publishTime(timestamp) {
  42. return translatePublishTime(timestamp)
  43. },
  44. }
  45. }
  46. </script>
  47. <style scoped lang="scss">
  48. @import "./style.scss";
  49. </style>