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

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