ReviewList.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!-- List.vue -->
  2. <template>
  3. <view class="div ui-review-list">
  4. <view class="div list" v-for="(item, index) in list" v-bind:key="index">
  5. <view class="div">
  6. <text class="span">
  7. {{ utils.replaceStr(item.author.username) }}
  8. </text>
  9. <text class="span">{{ getTime(item.point_addtime) }}</text>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {}
  18. },
  19. props: ['list'],
  20. created() {},
  21. methods: {
  22. /*
  23. getTime: 获取评论的时间
  24. @params: timestamps 时间戳
  25. */
  26. getTime(timestamps) {
  27. let date = new Date(timestamps * 1000)
  28. let year = date.getFullYear(),
  29. month = date.getMonth() + 1,
  30. day = date.getDate()
  31. return year + '-' + month + '-' + day
  32. }
  33. }
  34. }
  35. </script>
  36. <style lang="scss">
  37. .ui-review-list {
  38. background: rgba(255, 255, 255, 1);
  39. .list {
  40. padding: 0.75rem;
  41. border-bottom: 0.5px solid #e8eaed;
  42. color: #333;
  43. font-size:$h3;
  44. .div {
  45. overflow: hidden;
  46. padding-bottom: 0.75rem;
  47. display: flex;
  48. justify-content: space-between;
  49. align-content: center;
  50. align-items: center;
  51. .span {
  52. &:first-child {
  53. display: flex;
  54. justify-content: space-around;
  55. align-content: center;
  56. align-items: center;
  57. .span {
  58. margin-left: 0.75rem;
  59. color: #ffffff;
  60. font-size:$fontSize;
  61. }
  62. }
  63. &:last-child {
  64. color: #999999;
  65. font-size:$fontSize;
  66. }
  67. &.good-review {
  68. background: #fc2e39;
  69. width: 1.8rem;
  70. height: 0.8rem;
  71. text-align: center;
  72. background-size: cover;
  73. line-height: 0.8rem;
  74. border-radius: 0.4rem;
  75. }
  76. &.medium-review {
  77. background: $primaryColor;
  78. width: 1.8rem;
  79. height: 0.8rem;
  80. text-align: center;
  81. background-size: cover;
  82. line-height: 0.8rem;
  83. border-radius: 0.4rem;
  84. }
  85. &.bad-review {
  86. background: #c3c3c3;
  87. width: 1.8rem;
  88. height: 0.8rem;
  89. text-align: center;
  90. background-size: cover;
  91. line-height: 0.8rem;
  92. border-radius: 0.4rem;
  93. }
  94. }
  95. }
  96. .p {
  97. padding: 0;
  98. margin: 0;
  99. flex-basis: 100%;
  100. display: -webkit-box;
  101. -webkit-box-orient: vertical;
  102. -webkit-line-clamp: 2;
  103. overflow: hidden;
  104. }
  105. }
  106. }
  107. </style>