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

238 lines
5.2 KiB

  1. <template>
  2. <view class="card">
  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. .card {
  120. padding: 32rpx 24rpx;
  121. background-image: linear-gradient(#F2EDFF, #FCFEFE);
  122. border: 8rpx solid #F9F7FF;
  123. border-radius: 64rpx;
  124. &-header {
  125. .title {
  126. padding: 6rpx 14rpx;
  127. display: inline-flex;
  128. font-family: PingFang SC;
  129. font-weight: 400;
  130. font-size: 28rpx;
  131. line-height: 1.5;
  132. color: #252545;
  133. border: 2rpx solid #252545;
  134. border-radius: 30rpx;
  135. }
  136. }
  137. .section {
  138. margin-top: 40rpx;
  139. &-header {
  140. font-family: PingFang SC;
  141. line-height: 1.4;
  142. color: #252545;
  143. .title {
  144. font-weight: 600;
  145. font-size: 32rpx;
  146. }
  147. .desc {
  148. font-weight: 400;
  149. font-size: 24rpx;
  150. }
  151. }
  152. &-content {
  153. margin-top: 32rpx;
  154. }
  155. }
  156. }
  157. .index {
  158. display: grid;
  159. grid-template-columns: repeat(2, 1fr);
  160. gap: 32rpx;
  161. &-item {
  162. font-family: PingFang SC;
  163. font-weight: 400;
  164. line-height: 1.4;
  165. .top {
  166. justify-content: space-between;
  167. }
  168. .main {
  169. justify-content: flex-start;
  170. column-gap: 12rpx;
  171. font-size: 24rpx;
  172. color: #8B8B8B;
  173. }
  174. .label {
  175. font-size: 30rpx;
  176. color: #000000;
  177. }
  178. .value {
  179. font-weight: 400;
  180. font-size: 28rpx;
  181. color: #000000;
  182. }
  183. .desc {
  184. font-size: 22rpx;
  185. line-height: 1.6;
  186. color: #989898;
  187. }
  188. }
  189. }
  190. .score {
  191. display: grid;
  192. grid-template-columns: repeat(2, 1fr);
  193. column-gap: 32rpx;
  194. row-gap: 36rpx;
  195. &-item {
  196. .info {
  197. margin-top: 18rpx;
  198. justify-content: flex-start;
  199. column-gap: 12rpx;
  200. font-family: PingFang SC;
  201. line-height: 1.4;
  202. .label {
  203. font-weight: 400;
  204. font-size: 24rpx;
  205. }
  206. .value {
  207. font-weight: 500;
  208. font-size: 28rpx;
  209. }
  210. }
  211. }
  212. }
  213. </style>