comment-item.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view>
  3. <view class="user ss-flex ss-m-b-14">
  4. <view class="ss-m-r-20 ss-flex">
  5. <image class="avatar" :src="sheep.$url.cdn(item.user_avatar)"></image>
  6. </view>
  7. <view class="nickname ss-m-r-20">
  8. {{ item.user_nickname }}
  9. </view>
  10. <view class="">
  11. <uni-rate :readonly="true" v-model="item.level" size="18" />
  12. </view>
  13. </view>
  14. <view class="content">
  15. {{ item.content }}
  16. </view>
  17. <view class="ss-m-t-24" v-if="item.images?.length">
  18. <scroll-view class="scroll-box" scroll-x scroll-anchoring>
  19. <view class="ss-flex">
  20. <view v-for="(item, index) in item.images" :key="item" class="ss-m-r-10">
  21. <su-image
  22. class="content-img"
  23. isPreview
  24. :previewList="state.commentImages"
  25. :current="index"
  26. :src="item"
  27. :height="120"
  28. :width="120"
  29. mode="aspectFill"
  30. ></su-image>
  31. </view>
  32. </view>
  33. </scroll-view>
  34. </view>
  35. </view>
  36. </template>
  37. <script setup>
  38. import sheep from '@/sheep';
  39. import { reactive } from 'vue';
  40. const props = defineProps({
  41. item: {
  42. type: Object,
  43. default() {},
  44. },
  45. });
  46. const state = reactive({
  47. commentImages: [],
  48. });
  49. props.item.images?.forEach((i) => {
  50. state.commentImages.push(sheep.$url.cdn(i));
  51. });
  52. </script>
  53. <style lang="scss" scoped>
  54. .avatar {
  55. width: 52rpx;
  56. height: 52rpx;
  57. border-radius: 50%;
  58. }
  59. .nickname {
  60. font-size: 26rpx;
  61. font-weight: 500;
  62. color: #999999;
  63. }
  64. .content {
  65. width: 636rpx;
  66. font-size: 26rpx;
  67. font-weight: 400;
  68. color: #333333;
  69. }
  70. </style>