comment-item.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!-- 商品评论项 -->
  2. <template>
  3. <view>
  4. <!-- 用户评论 -->
  5. <view class="user ss-flex ss-m-b-14">
  6. <view class="ss-m-r-20 ss-flex">
  7. <image class="avatar" :src="item.userAvatar"></image>
  8. </view>
  9. <view class="nickname ss-m-r-20">{{ item.userNickname }}</view>
  10. <view class="">
  11. <uni-rate :readonly="true" v-model="item.scores" size="18" />
  12. </view>
  13. </view>
  14. <view class="content"> {{ item.content }} </view>
  15. <view class="ss-m-t-24" v-if="item.picUrls?.length">
  16. <scroll-view class="scroll-box" scroll-x scroll-anchoring>
  17. <view class="ss-flex">
  18. <view v-for="(picUrl, index) in item.picUrls" :key="picUrl" class="ss-m-r-10">
  19. <su-image
  20. class="content-img"
  21. isPreview
  22. :previewList="item.picUrls"
  23. :current="index"
  24. :src="picUrl"
  25. :height="120"
  26. :width="120"
  27. mode="aspectFill"
  28. />
  29. </view>
  30. </view>
  31. </scroll-view>
  32. </view>
  33. <!-- 商家回复 -->
  34. <view class="ss-m-t-20 reply-box" v-if="item.replyTime">
  35. <view class="reply-title">商家回复:</view>
  36. <view class="reply-content">{{ item.replyContent }}</view>
  37. </view>
  38. </view>
  39. </template>
  40. <script setup>
  41. const props = defineProps({
  42. item: {
  43. type: Object,
  44. default() {},
  45. },
  46. });
  47. </script>
  48. <style lang="scss" scoped>
  49. .avatar {
  50. width: 52rpx;
  51. height: 52rpx;
  52. border-radius: 50%;
  53. }
  54. .nickname {
  55. font-size: 26rpx;
  56. font-weight: 500;
  57. color: #999999;
  58. }
  59. .content {
  60. width: 636rpx;
  61. font-size: 26rpx;
  62. font-weight: 400;
  63. color: #333333;
  64. }
  65. .reply-box {
  66. position: relative;
  67. background: #f8f8f8;
  68. border-radius: 8rpx;
  69. padding: 16rpx;
  70. }
  71. .reply-title {
  72. position: absolute;
  73. left: 16rpx;
  74. top: 16rpx;
  75. font-weight: 400;
  76. font-size: 26rpx;
  77. line-height: 40rpx;
  78. color: #333333;
  79. }
  80. .reply-content {
  81. text-indent: 128rpx;
  82. font-weight: 400;
  83. font-size: 26rpx;
  84. line-height: 40rpx;
  85. color: #333333;
  86. }
  87. </style>