newCommentList.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="contentViewClass">
  3. <view class="commentItem" v-for="(item, index) in commentList" :key="index">
  4. <image class="comment-avatar" :src="$isEmpty(item.avatar)?defHeadImg:item.avatar" mode="aspectFill"></image>
  5. <view class="comment-box">
  6. <view class="comment-people">
  7. <view class="comment-people-name textOne">{{item.nickName}}</view>
  8. <view class="comment-time">{{ $isEmpty(item.createTime)?"":$formatDate(item.createTime) }}</view>
  9. </view>
  10. <view class="comment-text">{{item.content}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: "newCommentList",
  18. props: {
  19. commentList: {
  20. type: Array,
  21. default: () => []
  22. }
  23. },
  24. data() {
  25. return {
  26. defHeadImg: "/static/image/hall/my_heads_icon.png",
  27. };
  28. },
  29. }
  30. </script>
  31. <style scoped lang="scss">
  32. .contentViewClass {
  33. width: 100%;
  34. padding-bottom: 180rpx;
  35. }
  36. .commentItem {
  37. width: 100%;
  38. display: flex;
  39. align-items: flex-start;
  40. margin-bottom: 24rpx;
  41. }
  42. .comment-avatar {
  43. width: 90rpx;
  44. height: 90rpx;
  45. margin-right: 12rpx;
  46. }
  47. .comment-box {
  48. width: calc(100vw - 150rpx);
  49. }
  50. .comment-people {
  51. width: 100%;
  52. margin-bottom: 12rpx;
  53. }
  54. .comment-people-name {
  55. width: 100%;
  56. font-weight: 600;
  57. font-size: 32rpx;
  58. color: #222222;
  59. margin-bottom: 12rpx;
  60. }
  61. .comment-time {
  62. font-weight: 400;
  63. font-size: 28rpx;
  64. color: rgba(0, 0, 0, 0.45);
  65. }
  66. .comment-text {
  67. font-weight: 400;
  68. font-size: 32rpx;
  69. color: #222222;
  70. line-height: 44rpx;
  71. }
  72. </style>