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

240 lines
5.6 KiB

  1. <template>
  2. <view class="card">
  3. <view class="card-header">
  4. <image class="card-header-bg" src="@/pages_order/static/report/report-card-header-bg.png" mode="scaleToFill"></image>
  5. <view class="flex card-header-content">
  6. <view class="avatar">
  7. <!-- todo -->
  8. <image class="avatar-img" src="@/pages_order/static/report/avatar.png" mode="scaleToFill"></image>
  9. </view>
  10. <view class="info">
  11. <!-- todo -->
  12. <view class="nickname">李星星</view>
  13. <view class="desc">
  14. <text class="age">25</text>
  15. <text class="gender"></text>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="card-content">
  21. <view class="score-comprehensive">
  22. <progressCircleLine :progress="data.score"></progressCircleLine>
  23. </view>
  24. <view class="flex cols">
  25. <view class="flex flex-column col">
  26. <view class="flex">
  27. <view class="value">{{ data.BMI || '--' }}</view>
  28. <view v-if="data.BMIchange < 0" class="flex change">
  29. <text>{{ data.BMIchange }}</text>
  30. <image class="change-icon" src="@/pages_order/static/report/arrow-down.png" mode="widthFix"></image>
  31. </view>
  32. <view v-else-if="data.BMIchange > 0" class="flex change rise">
  33. <text>{{ data.BMIchange }}</text>
  34. <image class="change-icon" src="@/pages_order/static/report/arrow-down.png" mode="widthFix"></image>
  35. </view>
  36. </view>
  37. <view class="flex">
  38. <view class="label">BMI</view>
  39. <view class="tag">
  40. {{ data.BMItag || '-' }}
  41. </view>
  42. </view>
  43. </view>
  44. <view class="divider"></view>
  45. <view class="flex flex-column col">
  46. <view class="flex">
  47. <view class="value">{{ data.height || '--' }}</view>
  48. <view class="unit">cm</view>
  49. </view>
  50. <view class="label">身高</view>
  51. </view>
  52. <view class="divider"></view>
  53. <view class="flex flex-column col">
  54. <view class="flex">
  55. <view class="value">{{ data.weight || '--' }}</view>
  56. <view class="unit">kg</view>
  57. </view>
  58. <view class="label">体重</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import progressCircleLine from './progressCircleLine.vue'
  66. export default {
  67. components: {
  68. progressCircleLine,
  69. },
  70. props: {
  71. data: {
  72. type: Object,
  73. default() {
  74. return {}
  75. }
  76. }
  77. },
  78. }
  79. </script>
  80. <style scoped lang="scss">
  81. @import './style.scss';
  82. $header-height: 240rpx;
  83. $score-bar-height: 402rpx;
  84. .card {
  85. width: 100%;
  86. background-image: linear-gradient(#FAFAFF, #F3F3F3);
  87. border: 2rpx solid #FFFFFF;
  88. border-bottom-left-radius: 64rpx;
  89. border-bottom-right-radius: 64rpx;
  90. box-sizing: border-box;
  91. position: relative;
  92. &-header {
  93. background-color: $uni-bg-color;
  94. width: calc(100% + 2rpx * 2);
  95. height: $header-height;
  96. position: absolute;
  97. top: -2rpx;
  98. left: -2rpx;
  99. &-bg {
  100. width: 100%;
  101. height: 100%;
  102. }
  103. &-content {
  104. position: absolute;
  105. top: 0;
  106. left: 0;
  107. width: 100%;
  108. height: 100%;
  109. padding: 0 32rpx;
  110. box-sizing: border-box;
  111. justify-content: flex-start;
  112. .avatar {
  113. width: 104rpx;
  114. height: 104rpx;
  115. border: 4rpx solid #FFFFFF;
  116. border-radius: 50%;
  117. overflow: hidden;
  118. &-img {
  119. width: 100%;
  120. height: 100%;
  121. }
  122. }
  123. .info {
  124. margin-left: 24rpx;
  125. .nickname {
  126. font-family: PingFang SC;
  127. font-weight: 600;
  128. font-size: 40rpx;
  129. line-height: 1.1;
  130. color: #252545;
  131. }
  132. .desc {
  133. margin-top: 8rpx;
  134. font-family: PingFang SC;
  135. font-weight: 400;
  136. font-size: 36rpx;
  137. line-height: 1.2;
  138. color: #252545CC;
  139. .gender {
  140. margin-left: 16rpx;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. &-content {
  147. position: relative;
  148. width: 100%;
  149. padding: calc(#{$header-height} + 32rpx + #{$score-bar-height} + 24rpx) 0 32rpx 0;
  150. box-sizing: border-box;
  151. }
  152. }
  153. .score-comprehensive {
  154. position: absolute;
  155. top: calc(#{$header-height} + 32rpx);
  156. left: 50%;
  157. transform: translateX(-50%);
  158. }
  159. .cols {
  160. padding: 0 32rpx 6rpx 32rpx;
  161. align-items: flex-start;
  162. .col {
  163. flex: 1;
  164. }
  165. .divider {
  166. width: 2rpx;
  167. height: 32rpx;
  168. background: #B5B8CE;
  169. margin: 0 15rpx;
  170. }
  171. .label {
  172. font-family: PingFang SC;
  173. font-weight: 400;
  174. font-size: 26rpx;
  175. line-height: 1.4;
  176. color: #6D6D6D;
  177. }
  178. .unit {
  179. margin-left: 8rpx;
  180. font-family: PingFang SC;
  181. font-weight: 400;
  182. font-size: 24rpx;
  183. line-height: 1.4;
  184. color: #252545;
  185. }
  186. .value {
  187. font-family: PingFang SC;
  188. line-height: 1.4;
  189. font-weight: 600;
  190. font-size: 40rpx;
  191. color: $uni-color;
  192. }
  193. .change {
  194. margin-left: 8rpx;
  195. font-family: PingFang SC;
  196. font-weight: 400;
  197. font-size: 24rpx;
  198. line-height: 1.4;
  199. color: #F79205;
  200. &-icon {
  201. width: 24rpx;
  202. height: auto;
  203. }
  204. &.rise {
  205. .change-icon {
  206. transform: rotate(180deg);
  207. }
  208. }
  209. }
  210. .tag {
  211. margin-left: 16rpx;
  212. }
  213. }
  214. </style>