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

191 lines
4.7 KiB

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