evaluate-card.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="slot" :style="showBorderBottom ? '' : 'border-bottom:none;margin-bottom:0'">
  3. <view class="user">
  4. <view class="info">
  5. <u-avatar size="80" src="../../../static/user/1.png"></u-avatar>
  6. <view class="basic">
  7. <view class="name">{{ data.userName }}</view>
  8. <view class="evaluate"><u-rate :count="5" v-model="data.star" disabled :inactive-color="rateInActiveColor" :active-color="rateActiveColor"></u-rate></view>
  9. </view>
  10. </view>
  11. <view class="date">{{ data.date }}</view>
  12. </view>
  13. <view class="content">{{ data.content }}</view>
  14. <!-- <view class="pictures"><u-image width="164rpx" height="164rpx" src="../../../static/goods/4.png" v-for="(pic, cur) in data.pics" :key="cur"></u-image></view> -->
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. name: 'evaluate-card',
  20. props: {
  21. // 数据源
  22. data: {
  23. type: Object,
  24. default: () => {
  25. return {};
  26. }
  27. },
  28. // 是否显示底部边框
  29. showBorderBottom: {
  30. type: Boolean,
  31. default: false
  32. }
  33. },
  34. data() {
  35. return {
  36. rateActiveColor: this.$appTheme.appThemeColor,
  37. rateInActiveColor: this.$appTheme.appThemeCardGrayColor
  38. };
  39. }
  40. };
  41. </script>
  42. <style lang="scss" scoped>
  43. .slot {
  44. border-bottom: 1rpx solid $app-theme-border-color;
  45. padding-bottom: 24rpx;
  46. margin-bottom: 24rpx;
  47. }
  48. .user {
  49. display: flex;
  50. justify-content: space-between;
  51. align-items: flex-end;
  52. .info {
  53. display: flex;
  54. justify-content: flex-start;
  55. .basic {
  56. margin-left: 16rpx;
  57. display: flex;
  58. justify-content: flex-start;
  59. flex-wrap: wrap;
  60. align-content: space-between;
  61. .name {
  62. width: 100%;
  63. font-size: 28rpx;
  64. color: $app-theme-text-black-color;
  65. // 为了与 u-rate 组件左侧视觉对齐
  66. padding-left: 10rpx;
  67. }
  68. .evaluate {
  69. }
  70. }
  71. }
  72. .date {
  73. font-size: 26rpx;
  74. color: $app-theme-text-gray-color;
  75. }
  76. }
  77. .content {
  78. padding-top: 26rpx;
  79. padding-bottom: 24rpx;
  80. font-size: 28rpx;
  81. color: $app-theme-text-black-color;
  82. }
  83. .pictures {
  84. }
  85. </style>