log-item.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <view class="log-item ss-flex">
  3. <view class="log-icon ss-flex-col ss-col-center ss-m-r-20">
  4. <text class="cicon-title" :class="index === 0 ? 'activity-color' : ''"></text>
  5. <view v-if="data.length - 1 != index" class="line"></view>
  6. </view>
  7. <view>
  8. <view class="text">{{ item.log_type_text }}</view>
  9. <su-parse class="richtext" :content="item.content"></su-parse>
  10. <view class="" v-if="item.images?.length">
  11. <scroll-view class="scroll-box" scroll-x scroll-anchoring>
  12. <view class="ss-flex">
  13. <view v-for="i in item.images" :key="i" class="ss-m-r-20">
  14. <su-image
  15. class="content-img"
  16. isPreview
  17. :previewList="state.commentImages"
  18. :current="index"
  19. :src="i"
  20. :height="120"
  21. :width="120"
  22. mode="aspectFit"
  23. ></su-image>
  24. </view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. <view class="date">{{ item.create_time }}</view>
  29. </view>
  30. </view>
  31. </template>
  32. <script setup>
  33. import sheep from '@/sheep';
  34. import { reactive } from 'vue';
  35. const props = defineProps({
  36. item: {
  37. type: Object,
  38. default() {},
  39. },
  40. index: {
  41. type: Number,
  42. default: 0,
  43. },
  44. data: {
  45. type: Object,
  46. default() {},
  47. },
  48. });
  49. const state = reactive({
  50. commentImages: [],
  51. });
  52. props.item.images?.forEach((i) => {
  53. state.commentImages.push(sheep.$url.cdn(i));
  54. });
  55. </script>
  56. <style lang="scss" scoped>
  57. .log-item {
  58. align-items: stretch;
  59. }
  60. .log-icon {
  61. height: inherit;
  62. .cicon-title {
  63. font-size: 30rpx;
  64. color: #dfdfdf;
  65. }
  66. .activity-color {
  67. color: #60bd45;
  68. }
  69. .line {
  70. width: 1px;
  71. height: 100%;
  72. background: #dfdfdf;
  73. }
  74. }
  75. .text {
  76. font-size: 28rpx;
  77. font-weight: 500;
  78. color: #333333;
  79. }
  80. .richtext {
  81. font-size: 24rpx;
  82. font-weight: 500;
  83. color: #999999;
  84. margin: 20rpx 0 0 0;
  85. }
  86. .content-img {
  87. margin-top: 20rpx;
  88. width: 200rpx;
  89. height: 200rpx;
  90. }
  91. .date {
  92. margin-top: 20rpx;
  93. font-size: 24rpx;
  94. font-family: OPPOSANS;
  95. font-weight: 400;
  96. color: #999999;
  97. margin-bottom: 40rpx;
  98. }
  99. </style>