普兆健康管家前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.7 KiB

  1. <template>
  2. <view class="view">
  3. <view class="card" v-for="item in list" :key="item.id">
  4. <view class="flex top">
  5. <view class="label">{{ item.label }}</view>
  6. <view :class="['tag', item.status === 0 ? 'is-error' : '' ]">{{ item.status == 0 ? '异常' : '正常' }}</view>
  7. </view>
  8. <view class="flex main">
  9. <view class="value">{{ item.value }}</view>
  10. <view class="unit">{{ item.unit }}</view>
  11. </view>
  12. <view class="desc">{{ `* 标准值:${item.standrad}` }}</view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. props: {
  19. list: {
  20. type: Array,
  21. default() {
  22. return []
  23. }
  24. }
  25. }
  26. }
  27. </script>
  28. <style lang="scss" scoped>
  29. @import './style.scss';
  30. .view {
  31. display: grid;
  32. grid-template-columns: repeat(2, 1fr);
  33. gap: 16rpx;
  34. }
  35. .card {
  36. flex: 1;
  37. padding: 24rpx;
  38. box-sizing: border-box;
  39. font-family: PingFang SC;
  40. font-weight: 400;
  41. line-height: 1.4;
  42. background-image: linear-gradient(#FAFAFF, #F3F3F3);
  43. border: 2rpx solid #FFFFFF;
  44. border-radius: 32rpx;
  45. .top {
  46. justify-content: space-between;
  47. }
  48. .main {
  49. margin: 4rpx 0;
  50. justify-content: flex-start;
  51. column-gap: 8rpx;
  52. }
  53. }
  54. .label {
  55. font-size: 30rpx;
  56. color: #000000;
  57. }
  58. .value {
  59. font-weight: 600;
  60. font-size: 56rpx;
  61. color: transparent;
  62. background-image: linear-gradient(to right, #4B348F, #845CFA);
  63. background-clip: text;
  64. display: inline-block;
  65. }
  66. .unit {
  67. font-size: 24rpx;
  68. color: #252545CC;
  69. }
  70. .desc {
  71. font-size: 22rpx;
  72. line-height: 1.6;
  73. color: #989898;
  74. }
  75. </style>