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

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