普兆健康管家前端代码仓库
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.

152 lines
3.7 KiB

  1. <template>
  2. <view class="card card-detect">
  3. <view class="flex card-header">
  4. <view class="title">检测数据</view>
  5. </view>
  6. <view class="section">
  7. <view class="section-header">
  8. <view class="title">慢性食物过敏检测</view>
  9. <view class="desc">Chronic food allergy testing</view>
  10. </view>
  11. <view class="section-content index">
  12. <view
  13. class="index-item"
  14. v-for="item in data.chronicFoodAllergyList"
  15. :key="item.id"
  16. >
  17. <view class="flex top">
  18. <view class="label">{{ item.label }}</view>
  19. <view class="tag is-error" v-if="item.status === 0">{{ item.label }}</view>
  20. </view>
  21. <view class="flex main">
  22. <text>当前</text><text class="value">{{ item.value }}</text>
  23. </view>
  24. <view class="bottom desc">{{ `* 标准值:${item.standrad}` }}</view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="section">
  29. <view class="section-header">
  30. <view class="title">肠道菌群检测</view>
  31. <view class="desc">Gut microbiome testing</view>
  32. </view>
  33. <view class="section-content index">
  34. <view
  35. class="index-item"
  36. v-for="item in data.gutMicrobiomeList"
  37. :key="item.id"
  38. >
  39. <view class="flex top">
  40. <view class="label">{{ item.label }}</view>
  41. <view class="tag is-error" v-if="item.status === 0">{{ item.label }}</view>
  42. </view>
  43. <view class="flex main">
  44. <text>当前</text><text class="value">{{ item.value }}</text>
  45. </view>
  46. <view class="bottom desc">{{ `* 标准值:${item.standrad}` }}</view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="section">
  51. <view class="section-header">
  52. <view class="title">肠道菌群检测</view>
  53. <view class="desc">Gut microbiome testing</view>
  54. </view>
  55. <view class="section-content score">
  56. <view
  57. class="score-item"
  58. v-for="(item, index) in data.scoreList"
  59. :key="item.id"
  60. >
  61. <view>
  62. <progressLine :progress="item.value" :activeColor="getColor(index)"></progressLine>
  63. </view>
  64. <view class="flex info">
  65. <view class="label">{{ `${item.label}` }}</view>
  66. <view class="value">{{ item.value }}</view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <script>
  74. import progressLine from './progressLine.vue';
  75. const COLORS = [
  76. '#43B741',
  77. '#43B741',
  78. '#ECB501',
  79. '#ECB501',
  80. '#EB7F09',
  81. '#EB7F09',
  82. '#009CEF',
  83. '#009CEF',
  84. '#7451DE',
  85. '#7451DE',
  86. ]
  87. export default {
  88. components: {
  89. progressLine,
  90. },
  91. props: {
  92. data: {
  93. type: Object,
  94. default() {
  95. return {
  96. chronicFoodAllergyList: [],
  97. gutMicrobiomeList: [],
  98. scoreList: [],
  99. }
  100. }
  101. },
  102. },
  103. data() {
  104. return {
  105. }
  106. },
  107. onLoad() {
  108. console.log('onLoad', this.data)
  109. },
  110. methods: {
  111. getColor(index) {
  112. return COLORS[index % 10]
  113. },
  114. },
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. @import './style.scss';
  119. .score {
  120. display: grid;
  121. grid-template-columns: repeat(2, 1fr);
  122. column-gap: 32rpx;
  123. row-gap: 36rpx;
  124. &-item {
  125. .info {
  126. margin-top: 18rpx;
  127. justify-content: flex-start;
  128. column-gap: 12rpx;
  129. font-family: PingFang SC;
  130. line-height: 1.4;
  131. .label {
  132. font-weight: 400;
  133. font-size: 24rpx;
  134. }
  135. .value {
  136. font-weight: 500;
  137. font-size: 28rpx;
  138. }
  139. }
  140. }
  141. }
  142. </style>