BaseCard.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="base-card-box">
  3. <view class="card-header">
  4. <view class="card-header-title">
  5. {{ props.cardInfo.title }}
  6. </view>
  7. <view class="card-header-time">
  8. {{ props.cardInfo.time }}
  9. </view>
  10. </view>
  11. <view class="card-body">
  12. <view class="card-body-list" v-if="props.cardInfo?.list">
  13. <view class="card-body-list-item" v-for="(item, index) in props.cardInfo.list" :key="index">
  14. <view class="label">
  15. {{item.label}}:
  16. </view>
  17. <view class="value">
  18. {{item.value}}
  19. </view>
  20. </view>
  21. </view>
  22. <view class="card-body-right">
  23. <image style="width: 100%; height: 100%;" src="/static/images/index/deploy/right-arrow.svg"
  24. mode="scaleToFill"></image>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup>
  30. import {
  31. defineProps
  32. } from 'vue';
  33. const props = defineProps({
  34. cardInfo: {
  35. type: Object,
  36. default: () => {
  37. return {
  38. title: '标题',
  39. time: '2024-04-08 12:00:00',
  40. list: [{
  41. label: 'label',
  42. value: '100m³'
  43. },
  44. {
  45. label: 'label',
  46. value: '100m³'
  47. }
  48. ]
  49. }
  50. }
  51. }
  52. })
  53. </script>
  54. <style lang="scss" scoped>
  55. .base-card-box {
  56. padding: 0 32rpx;
  57. background: #FFFFFF;
  58. border-radius: 12rpx;
  59. .card-header {
  60. padding: 16rpx 0;
  61. display: flex;
  62. justify-content: space-between;
  63. align-items: center;
  64. box-sizing: border-box;
  65. border-bottom: 2rpx solid $uni-text-color-grey;
  66. &-title {
  67. font-family: Source Han Sans;
  68. font-size: 40rpx;
  69. font-weight: 500;
  70. font-feature-settings: "kern" on;
  71. color: $uni-text-color;
  72. }
  73. &-time {
  74. font-family: Source Han Sans;
  75. font-size: 32rpx;
  76. font-feature-settings: "kern" on;
  77. color: $uni-text-color-grey;
  78. }
  79. }
  80. .card-body {
  81. padding: 20rpx 0;
  82. display: flex;
  83. justify-content: space-between;
  84. align-items: center;
  85. &-list {
  86. &-item {
  87. display: flex;
  88. .label {
  89. font-family: Source Han Sans;
  90. font-size: 32rpx;
  91. font-feature-settings: "kern" on;
  92. color: $uni-text-color-grey;
  93. }
  94. .value {
  95. font-family: Source Han Sans;
  96. font-size: 32rpx;
  97. font-feature-settings: "kern" on;
  98. color: $uni-text-color;
  99. }
  100. }
  101. }
  102. &-right {
  103. width: 20rpx;
  104. height: 36rpx;
  105. }
  106. }
  107. }
  108. </style>