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

137 lines
3.0 KiB

  1. <template>
  2. <view class="flex view report-score__view">
  3. <view class="flex flex-column left" :class="[scoreAlign == 'left' ? 'align-left' : '']">
  4. <template v-if="data.score">
  5. <view class="flex">
  6. <text class="score-value">{{ data.score }}</text><text class="score-full">/100</text>
  7. </view>
  8. <view class="flex">
  9. <view class="flex change">
  10. <text>{{ data.change }}</text>
  11. <image class="change-icon" src="@/pages_order/static/report/arrow-down.png" mode="widthFix"></image>
  12. </view>
  13. <view class="tag">
  14. {{ data.tag }}
  15. </view>
  16. </view>
  17. </template>
  18. <template v-else>
  19. <view class="flex">
  20. <text class="score-value is-empty">--</text><text class="score-full">/100</text>
  21. </view>
  22. </template>
  23. </view>
  24. <view class="divider"></view>
  25. <view class="flex flex-column right">
  26. <view><view class="highlight">战斗世界</view></view>
  27. <view>专属检测方案</view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. props: {
  34. data: {
  35. type: Object,
  36. default() {
  37. return {}
  38. }
  39. },
  40. scoreAlign: {
  41. type: String,
  42. default: 'center'
  43. }
  44. },
  45. }
  46. </script>
  47. <style scoped lang="scss">
  48. .view {
  49. .left {
  50. flex: 1;
  51. &.align-left {
  52. align-items: flex-start;
  53. }
  54. .score {
  55. &-value {
  56. font-family: PingFang SC;
  57. line-height: 1.4;
  58. font-weight: 600;
  59. font-size: 40rpx;
  60. color: $uni-color;
  61. &.is-empty {
  62. color: #989898;
  63. }
  64. }
  65. &-full {
  66. margin-left: 8rpx;
  67. font-size: 26rpx;
  68. font-weight: 400;
  69. line-height: 1.4;
  70. font-family: PingFang SC;
  71. color: transparent;
  72. background-image: linear-gradient(to right, #4B348F, #845CFA);
  73. background-clip: text;
  74. display: inline-block;
  75. }
  76. }
  77. .change {
  78. font-family: PingFang SC;
  79. font-weight: 400;
  80. font-size: 24rpx;
  81. line-height: 1.4;
  82. color: #F79205;
  83. &-icon {
  84. width: 24rpx;
  85. height: auto;
  86. }
  87. }
  88. .tag {
  89. margin-left: 16rpx;
  90. padding: 6rpx 16rpx;
  91. font-family: PingFang SC;
  92. font-weight: 400;
  93. font-size: 20rpx;
  94. line-height: 1.4;
  95. color: #FFFFFF;
  96. background-image: linear-gradient(135deg, #4B348F, #845CFA);
  97. border-top-left-radius: 24rpx;
  98. border-bottom-right-radius: 24rpx;
  99. }
  100. }
  101. .right {
  102. flex: 1;
  103. text-align: center;
  104. font-size: 26rpx;
  105. font-weight: 400;
  106. line-height: 1.4;
  107. font-family: PingFang SC;
  108. color: transparent;
  109. background-image: linear-gradient(to right, #4B348F, #845CFA);
  110. background-clip: text;
  111. display: inline-block;
  112. .highlight {
  113. display: inline-block;
  114. margin-right: 10rpx;
  115. border-bottom: 2rpx solid #4B348F;
  116. }
  117. }
  118. .divider {
  119. width: 2rpx;
  120. height: 32rpx;
  121. background: #B5B8CE;
  122. }
  123. }
  124. </style>