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

176 lines
3.7 KiB

  1. <template>
  2. <view class="view">
  3. <view class="flex top">
  4. <view class="left">
  5. <view class="title">
  6. <!-- todo: check -->
  7. <text class="highlight">{{ userInfo.name || '' }}</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 { mapState } from 'vuex'
  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. computed: {
  64. ...mapState(['userInfo']),
  65. },
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .view {
  70. padding: 56rpx 24rpx 0 24rpx;
  71. }
  72. .top {
  73. align-items: flex-start;
  74. .left {
  75. padding-right: 16rpx;
  76. .title {
  77. font-family: PingFang SC;
  78. font-weight: 400;
  79. font-size: 36rpx;
  80. line-height: 1.2;
  81. color: #252545CC;
  82. .highlight {
  83. margin-right: 8rpx;
  84. font-weight: 600;
  85. color: #252545;
  86. }
  87. }
  88. .grade {
  89. margin-top: 30rpx;
  90. display: inline-block;
  91. padding-left: 7rpx;
  92. &-text {
  93. font-size: 64rpx;
  94. font-weight: 600;
  95. line-height: 1;
  96. font-family: PingFang SC;
  97. color: transparent;
  98. background-image: linear-gradient(to right, #4B348F, #845CFA);
  99. background-clip: text;
  100. display: inline-block;
  101. }
  102. &-border {
  103. width: 100%;
  104. height: 12rpx;
  105. background-image: linear-gradient(to right, #7451DE, #B1A4FF);
  106. box-shadow: 4rpx 4rpx 12rpx 0 #4000FF40;
  107. }
  108. }
  109. .desc {
  110. margin-top: 16rpx;
  111. font-family: PingFang SC;
  112. font-weight: 400;
  113. font-size: 24rpx;
  114. line-height: 1.5;
  115. color: #989898;
  116. }
  117. }
  118. }
  119. .section {
  120. margin-bottom: 64rpx;
  121. .title {
  122. font-family: PingFang SC;
  123. line-height: 1.4;
  124. &-zh {
  125. font-weight: 600;
  126. font-size: 40rpx;
  127. }
  128. &-en {
  129. font-weight: 400;
  130. font-size: 26rpx;
  131. }
  132. }
  133. .content {
  134. flex: 1;
  135. display: flex;
  136. flex-wrap: wrap;
  137. gap: 16rpx;
  138. margin-top: 24rpx;
  139. }
  140. .tag {
  141. padding: 8rpx 40rpx;
  142. font-family: PingFang SC;
  143. font-weight: 400;
  144. font-size: 28rpx;
  145. line-height: 1.5;
  146. color: #252545;
  147. background: #E5E4EB;
  148. border-radius: 30rpx;
  149. &.highlight {
  150. margin-left: 40rpx;
  151. font-weight: 600;
  152. color: #FFFFFF;
  153. background: #252545;
  154. }
  155. }
  156. }
  157. </style>