base.vue 1.6 KB

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