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

171 lines
3.6 KiB

  1. <template>
  2. <view class="view">
  3. <view class="flex top">
  4. <view class="left">
  5. <view class="title">
  6. <!-- todo -->
  7. <text class="highlight">战斗世界</text>
  8. <text>的健康测评</text>
  9. </view>
  10. <view class="grade">
  11. <!-- todo: check key -->
  12. <view class="grade-text">良好</view>
  13. <view class="grade-border"></view>
  14. </view>
  15. <view class="desc">
  16. * 报告结果基于FFQ营养测评和4大维度专业健康评估
  17. </view>
  18. </view>
  19. <view class="right">
  20. <progressCircle ref="progressCircle" :progress="data.score"></progressCircle>
  21. </view>
  22. </view>
  23. <view class="flex">
  24. <radarChart :score="data.scoreDetail"></radarChart>
  25. </view>
  26. <view class="section" v-for="item in data.detail" :key="item.id">
  27. <div class="title">
  28. <div class="title-zh">{{ item.name }}</div>
  29. <div class="title-en">{{ item.enTitle }}</div>
  30. </div>
  31. <div class="content">
  32. <div :class="['tag', item.type == '1' ? 'highlight' : '']" v-for="(item, tIdx) in item.schemes" :key="tIdx">{{ item.title }}</div>
  33. </div>
  34. </view>
  35. <!-- <view class="flex section">
  36. <div class="title">
  37. <div class="title-zh">首要目标</div>
  38. <div class="title-en">Top priority</div>
  39. </div>
  40. <div class="content">
  41. <div class="tag highlight">{{ data.topPriority }}</div>
  42. </div>
  43. </view> -->
  44. </view>
  45. </template>
  46. <script>
  47. import progressCircle from './progressCircle.vue'
  48. import radarChart from './radarChart.vue';
  49. export default {
  50. components: {
  51. progressCircle,
  52. radarChart,
  53. },
  54. props: {
  55. data: {
  56. type: Object,
  57. default() {
  58. return {}
  59. }
  60. }
  61. },
  62. }
  63. </script>
  64. <style scoped lang="scss">
  65. .view {
  66. padding: 56rpx 24rpx 0 24rpx;
  67. }
  68. .top {
  69. align-items: flex-start;
  70. .left {
  71. padding-right: 16rpx;
  72. .title {
  73. font-family: PingFang SC;
  74. font-weight: 400;
  75. font-size: 36rpx;
  76. line-height: 1.2;
  77. color: #252545CC;
  78. .highlight {
  79. margin-right: 8rpx;
  80. font-weight: 600;
  81. color: #252545;
  82. }
  83. }
  84. .grade {
  85. margin-top: 30rpx;
  86. display: inline-block;
  87. padding-left: 7rpx;
  88. &-text {
  89. font-size: 64rpx;
  90. font-weight: 600;
  91. line-height: 1;
  92. font-family: PingFang SC;
  93. color: transparent;
  94. background-image: linear-gradient(to right, #4B348F, #845CFA);
  95. background-clip: text;
  96. display: inline-block;
  97. }
  98. &-border {
  99. width: 100%;
  100. height: 12rpx;
  101. background-image: linear-gradient(to right, #7451DE, #B1A4FF);
  102. box-shadow: 4rpx 4rpx 12rpx 0 #4000FF40;
  103. }
  104. }
  105. .desc {
  106. margin-top: 16rpx;
  107. font-family: PingFang SC;
  108. font-weight: 400;
  109. font-size: 24rpx;
  110. line-height: 1.5;
  111. color: #989898;
  112. }
  113. }
  114. }
  115. .section {
  116. margin-bottom: 64rpx;
  117. .title {
  118. font-family: PingFang SC;
  119. line-height: 1.4;
  120. &-zh {
  121. font-weight: 600;
  122. font-size: 40rpx;
  123. }
  124. &-en {
  125. font-weight: 400;
  126. font-size: 26rpx;
  127. }
  128. }
  129. .content {
  130. flex: 1;
  131. display: flex;
  132. flex-wrap: wrap;
  133. gap: 16rpx;
  134. margin-top: 24rpx;
  135. }
  136. .tag {
  137. padding: 8rpx 40rpx;
  138. font-family: PingFang SC;
  139. font-weight: 400;
  140. font-size: 28rpx;
  141. line-height: 1.5;
  142. color: #252545;
  143. background: #E5E4EB;
  144. border-radius: 30rpx;
  145. &.highlight {
  146. margin-left: 40rpx;
  147. font-weight: 600;
  148. color: #FFFFFF;
  149. background: #252545;
  150. }
  151. }
  152. }
  153. </style>