base.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view class="base-container" v-if="dataList.length">
  3. <view class="base-list">
  4. <view class="base-item" v-for="(item, index) in dataList" :key="index">
  5. <view class="base-item-value">{{ item.value }}</view>
  6. <view class="base-item-label">{{
  7. item.sfDisplayname || item.sfName
  8. }}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. props: {
  16. dataList: {
  17. type: Array,
  18. default: () => [],
  19. },
  20. },
  21. data() {
  22. return {};
  23. },
  24. };
  25. </script>
  26. <style scoped lang="scss">
  27. .base-container {
  28. display: flex;
  29. flex-direction: column;
  30. align-items: center;
  31. width: calc(100% - 64rpx);
  32. padding: 16rpx 0;
  33. margin: 0 32rpx;
  34. justify-content: space-between;
  35. border-radius: 16rpx;
  36. background: linear-gradient(180deg, #edfbfb 0%, #d2f2ed 100%);
  37. margin-bottom: 30rpx;
  38. .base-list {
  39. width: calc(100% - 32rpx);
  40. padding: 0 16px;
  41. display: grid;
  42. grid-template-columns: repeat(4, 1fr);
  43. .base-item {
  44. text-align: center;
  45. .base-item-value {
  46. width: 150rpx;
  47. color: #042118;
  48. font-family: 'Source Han Sans CN VF';
  49. font-size: 32rpx;
  50. font-weight: 500;
  51. text-align: center;
  52. // 超出隐藏
  53. overflow: hidden;
  54. text-overflow: ellipsis;
  55. white-space: nowrap;
  56. }
  57. .base-item-label {
  58. width: 150rpx;
  59. color: #687a74;
  60. font-family: 'Source Han Sans CN VF';
  61. text-align: center;
  62. font-size: 28rpx;
  63. font-weight: 400;
  64. // 超出隐藏
  65. overflow: hidden;
  66. text-overflow: ellipsis;
  67. white-space: nowrap;
  68. }
  69. }
  70. }
  71. }
  72. </style>