log-item.vue 2.1 KB

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