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

164 lines
3.4 KiB

  1. <template>
  2. <view class="summary__view flex flex-column">
  3. <progressCircle ref="progressCircle" :progress="score"></progressCircle>
  4. <view v-if="change" class="score-change flex">
  5. <uv-icon v-if="change > 0" name="arrow-upward" color="#0DB556" size="24rpx"></uv-icon>
  6. <uv-icon v-else name="arrow-downward" color="#dd524d" size="24rpx"></uv-icon>
  7. <text class="score-change-value">{{ change }}</text>
  8. <text class="score-change-unit"></text>
  9. </view>
  10. <button class="btn btn-test" @click="jumpToTest">重新测评</button>
  11. <view class="user flex">
  12. <view class="avatar">
  13. <image class="avatar-img" :src="avatarUrl" mode="scaleToFill"></image>
  14. </view>
  15. <view class="info">
  16. <view class="info-title"><text class="highlight">战斗世界</text><text>的专属配方</text></view>
  17. <view class="info-desc">世界这么美身体要健康</view>
  18. </view>
  19. <button class="btn btn-formula" @click="showFormula">查看配方</button>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import progressCircle from './progressCircle.vue'
  25. export default {
  26. components: {
  27. progressCircle,
  28. },
  29. data() {
  30. return {
  31. score: 0,
  32. change: 0,
  33. avatarUrl: '',
  34. }
  35. },
  36. mounted() {
  37. this.score = 77
  38. this.change = 12
  39. this.avatarUrl = '/pages_order/static/report/avatar.png'
  40. },
  41. methods: {
  42. jumpToTest() {
  43. this.$utils.navigateTo('/pages_order/report/test/intro')
  44. },
  45. showFormula() {
  46. // todo: check
  47. }
  48. },
  49. }
  50. </script>
  51. <style scoped lang="scss">
  52. .summary__view {
  53. position: relative;
  54. padding-top: 48rpx;
  55. }
  56. .score {
  57. &-change {
  58. position: absolute;
  59. right: 0;
  60. top: 346rpx;
  61. padding: 12rpx 24rpx;
  62. background: #F6F6F9CC;
  63. border-radius: 34rpx;
  64. box-shadow: 0 0 13rpx 1rpx #D3D2E599;
  65. &-value {
  66. margin: 0 4rpx;
  67. font-family: PingFang SC;
  68. font-weight: 600;
  69. font-size: 32rpx;
  70. line-height: 1.4;
  71. color: #252545;
  72. }
  73. &-unit {
  74. font-family: PingFang SC;
  75. font-weight: 400;
  76. font-size: 26rpx;
  77. line-height: 1.4;
  78. color: #989898;
  79. }
  80. }
  81. }
  82. .btn {
  83. &-test {
  84. margin-top: 48rpx;
  85. padding: 12rpx 40rpx;
  86. border-radius: 32rpx;
  87. background: #E5E4EB;
  88. color: #252545;
  89. font-size: 28rpx;
  90. line-height: 1.5;
  91. font-weight: 400;
  92. font-family: PingFang SC;
  93. }
  94. &-formula {
  95. padding: 8rpx 24rpx;
  96. font-size: 28rpx;
  97. line-height: 1.5;
  98. font-weight: 600;
  99. font-family: PingFang SC;
  100. color: #FFFFFF;
  101. border-radius: 32rpx;
  102. background-image: linear-gradient(to right, #4B348F, #845CFA);
  103. }
  104. }
  105. .user {
  106. margin-top: 48rpx;
  107. width: 100%;
  108. .avatar {
  109. width: 96rpx;
  110. height: 96rpx;
  111. border-radius: 52rpx;
  112. overflow: hidden;
  113. border: 4rpx solid #FFFFFF;
  114. &-img {
  115. width: 100%;
  116. height: 100%;
  117. border-radius: 50%;
  118. }
  119. }
  120. .info {
  121. margin: 0 24rpx;
  122. flex: 1;
  123. &-title {
  124. font-family: PingFang SC;
  125. font-weight: 400;
  126. font-size: 36rpx;
  127. line-height: 1.2;
  128. color: #252545CC;
  129. .highlight {
  130. font-weight: 600;
  131. color: #252545;
  132. margin-right: 8rpx;
  133. }
  134. }
  135. &-desc {
  136. margin-top: 8rpx;
  137. font-family: PingFang SC;
  138. font-weight: 400;
  139. font-size: 24rpx;
  140. line-height: 1.5;
  141. color: #989898;
  142. }
  143. }
  144. }
  145. </style>