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

179 lines
4.3 KiB

  1. <template>
  2. <view class="card">
  3. <view class="flex header">
  4. <view class="title">体检报告</view>
  5. <button class="btn">体检入口</button>
  6. </view>
  7. <view class="flex cols">
  8. <view class="flex flex-column col score">
  9. <view class="flex">
  10. <view class="score-value">{{ data.BMI || '--' }}</view>
  11. <view v-if="data.BMIchange < 0" class="flex change">
  12. <text>{{ data.BMIchange }}</text>
  13. <image class="change-icon" src="@/pages_order/static/report/arrow-down.png" mode="widthFix"></image>
  14. </view>
  15. <view v-else-if="data.BMIchange > 0" class="flex change rise">
  16. <text>{{ data.BMIchange }}</text>
  17. <image class="change-icon" src="@/pages_order/static/report/arrow-down.png" mode="widthFix"></image>
  18. </view>
  19. </view>
  20. <view class="flex">
  21. <view class="label">BMI</view>
  22. <view class="tag">
  23. {{ data.BMItag || '-' }}
  24. </view>
  25. </view>
  26. </view>
  27. <view class="divider"></view>
  28. <view class="flex flex-column col score">
  29. <view class="flex">
  30. <view class="score-value">{{ data.fat || '--' }}</view>
  31. <view v-if="data.fatChange < 0" class="flex change">
  32. <text>{{ data.fatChange }}</text>
  33. <image class="change-icon" src="@/pages_order/static/report/arrow-down.png" mode="widthFix"></image>
  34. </view>
  35. <view v-else-if="data.fatChange > 0" class="flex change rise">
  36. <text>{{ data.fatChange }}</text>
  37. <image class="change-icon" src="@/pages_order/static/report/arrow-down.png" mode="widthFix"></image>
  38. </view>
  39. </view>
  40. <view class="flex">
  41. <view class="label">脂肪</view>
  42. <view class="tag">
  43. {{ data.fatTag || '-' }}
  44. </view>
  45. </view>
  46. </view>
  47. <view class="divider"></view>
  48. <view class="flex flex-column col">
  49. <view class="label">解锁更多</view>
  50. <view class="label">身体数据</view>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. data() {
  58. return {
  59. data: {
  60. BMI: 20.3,
  61. BMIchange: -0.2,
  62. BMItag: '正常',
  63. fat: null,
  64. fatChange: null,
  65. fatTag: null,
  66. },
  67. }
  68. },
  69. }
  70. </script>
  71. <style scoped lang="scss">
  72. @import './styles/card.scss';
  73. .card {
  74. padding: 32rpx;
  75. background-image: linear-gradient(#FAFAFF, #F3F3F3);
  76. }
  77. .header {
  78. justify-content: space-between;
  79. margin-bottom: 24rpx;
  80. .title {
  81. font-family: PingFang SC;
  82. font-weight: 600;
  83. font-size: 36rpx;
  84. line-height: 1.2;
  85. color: #252545;
  86. }
  87. .btn {
  88. font-family: PingFang SC;
  89. font-weight: 600;
  90. font-size: 28rpx;
  91. line-height: 1.5;
  92. color: #FFFFFF;
  93. padding: 8rpx 24rpx;
  94. background-image: linear-gradient(to right, #4B348F, #845CFA);
  95. border: 1rpx solid #FFFFFF;
  96. border-radius: 32rpx;
  97. box-shadow: -5rpx -5rpx 10rpx 0 #FFFFFF,
  98. 10rpx 10rpx 20rpx 0 #AAAACC80,
  99. 4rpx 4rpx 10rpx 0 #AAAACC40,
  100. -2rpx -2rpx 5rpx 0 #FFFFFF;
  101. }
  102. }
  103. .col {
  104. &.score {
  105. .score {
  106. &-value {
  107. font-family: PingFang SC;
  108. line-height: 1.4;
  109. font-weight: 600;
  110. font-size: 40rpx;
  111. color: $uni-color;
  112. }
  113. }
  114. .change {
  115. margin-left: 8rpx;
  116. font-family: PingFang SC;
  117. font-weight: 400;
  118. font-size: 24rpx;
  119. line-height: 1.4;
  120. color: #F79205;
  121. &-icon {
  122. width: 24rpx;
  123. height: auto;
  124. }
  125. &.rise {
  126. .change-icon {
  127. transform: rotate(180deg);
  128. }
  129. }
  130. }
  131. .tag {
  132. margin-left: 16rpx;
  133. padding: 6rpx 16rpx;
  134. font-family: PingFang SC;
  135. font-weight: 400;
  136. font-size: 20rpx;
  137. line-height: 1.4;
  138. color: #FFFFFF;
  139. background-image: linear-gradient(90deg, #4B348F, #845CFA);
  140. border-top-left-radius: 24rpx;
  141. border-bottom-right-radius: 24rpx;
  142. }
  143. }
  144. .label {
  145. font-size: 26rpx;
  146. font-weight: 400;
  147. line-height: 1.4;
  148. font-family: PingFang SC;
  149. color: transparent;
  150. background-image: linear-gradient(to right, #4B348F, #845CFA);
  151. background-clip: text;
  152. display: inline-block;
  153. }
  154. }
  155. .divider {
  156. flex: none;
  157. // todo
  158. width: 4rpx;
  159. height: 32rpx;
  160. background: #B5B8CE;
  161. }
  162. </style>