InfoRow.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view :class="['info-row', { 'info-row-last': isLast }]">
  3. <view class="info-icon">
  4. <cwg-icon :name="icon" :size="20" color="#9ca3af" />
  5. </view>
  6. <view class="info-content">
  7. <text class="info-label">{{ label }}</text>
  8. <text class="info-value">{{ value || '-' }}</text>
  9. </view>
  10. </view>
  11. </template>
  12. <script setup lang="ts">
  13. interface Props {
  14. icon: string;
  15. label: string;
  16. value: string;
  17. isLast?: boolean;
  18. }
  19. defineProps<Props>();
  20. </script>
  21. <style scoped lang="scss">
  22. @import "@/uni.scss";
  23. .info-row {
  24. display: flex;
  25. align-items: center;
  26. gap: px2rpx(12);
  27. padding: px2rpx(12) 0;
  28. border-bottom: 1px solid #f9fafb;
  29. }
  30. .info-row-last {
  31. border-bottom: none;
  32. }
  33. .info-icon {
  34. flex-shrink: 0;
  35. width: px2rpx(24);
  36. height: px2rpx(24);
  37. }
  38. .info-content {
  39. flex: 1;
  40. min-width: 0;
  41. display: flex;
  42. flex-direction: column;
  43. }
  44. .info-label {
  45. font-size: px2rpx(12);
  46. color: #6b7280;
  47. margin-bottom: px2rpx(4);
  48. }
  49. .info-value {
  50. font-size: px2rpx(14);
  51. color: #111827;
  52. }
  53. </style>