newCommentList.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view v-if="commentList.length > 0" 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. <view class="emptyCourse" v-else>暂无评论~</view>
  15. </template>
  16. <script>
  17. export default {
  18. name: "newCommentList",
  19. props: {
  20. commentList: {
  21. type: Array,
  22. default: () => []
  23. }
  24. },
  25. data() {
  26. return {
  27. defHeadImg: "/static/image/hall/my_heads_icon.png",
  28. };
  29. },
  30. }
  31. </script>
  32. <style scoped lang="scss">
  33. .contentViewClass {
  34. width: 100%;
  35. padding-bottom: 180rpx;
  36. }
  37. .commentItem {
  38. width: 100%;
  39. display: flex;
  40. align-items: flex-start;
  41. margin-bottom: 24rpx;
  42. }
  43. .comment-avatar {
  44. width: 90rpx;
  45. height: 90rpx;
  46. margin-right: 12rpx;
  47. border-radius: 100%;
  48. }
  49. .comment-box {
  50. width: calc(100vw - 150rpx);
  51. }
  52. .comment-people {
  53. width: 100%;
  54. margin-bottom: 12rpx;
  55. }
  56. .comment-people-name {
  57. width: 100%;
  58. font-weight: 600;
  59. font-size: 32rpx;
  60. color: #222222;
  61. margin-bottom: 12rpx;
  62. }
  63. .comment-time {
  64. font-weight: 400;
  65. font-size: 28rpx;
  66. color: rgba(0, 0, 0, 0.45);
  67. }
  68. .comment-text {
  69. font-weight: 400;
  70. font-size: 32rpx;
  71. color: #222222;
  72. line-height: 44rpx;
  73. }
  74. .emptyCourse {
  75. display: flex;
  76. align-items: center;
  77. justify-content: center;
  78. height: 200rpx;
  79. padding: 24rpx 50rpx;
  80. color: #999999;
  81. }
  82. </style>