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

169 lines
3.5 KiB

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