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

121 lines
2.5 KiB

2 months ago
  1. <template>
  2. <view class="card report-card__view">
  3. <view class="card-header">
  4. <image class="card-header-bg" src="@/pages_order/static/report/report-card-header-bg.png" mode="scaleToFill"></image>
  5. <view class="flex card-header-content">
  6. <view class="avatar">
  7. <image class="avatar-img" :src="userInfo.avatar" mode="scaleToFill"></image>
  8. </view>
  9. <view class="info">
  10. <view class="nickname">{{ data.realName || '' }}</view>
  11. <view class="desc">
  12. <text class="age">{{ data.age || '' }}</text>
  13. <text class="gender">{{ data.sex || '' }}</text>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="card-content">
  19. <slot></slot>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import { mapState } from 'vuex'
  25. export default {
  26. props: {
  27. data: {
  28. type: Object,
  29. default() {
  30. return {}
  31. }
  32. }
  33. },
  34. computed: {
  35. ...mapState(['userInfo']),
  36. },
  37. }
  38. </script>
  39. <style scoped lang="scss">
  40. .card {
  41. width: 100%;
  42. background-image: linear-gradient(#F2EDFF, #FCFEFE);
  43. border: 8rpx solid #F9F7FF;
  44. border-bottom-left-radius: 64rpx;
  45. border-bottom-right-radius: 64rpx;
  46. box-sizing: border-box;
  47. position: relative;
  48. &-header {
  49. background-color: $uni-bg-color;
  50. width: calc(100% + 8rpx * 2);
  51. height: 240rpx;
  52. position: absolute;
  53. top: -8rpx;
  54. left: -8rpx;
  55. &-bg {
  56. width: 100%;
  57. height: 100%;
  58. }
  59. &-content {
  60. position: absolute;
  61. top: 0;
  62. left: 0;
  63. width: 100%;
  64. height: 100%;
  65. padding: 0 32rpx;
  66. box-sizing: border-box;
  67. justify-content: flex-start;
  68. .avatar {
  69. width: 104rpx;
  70. height: 104rpx;
  71. border: 4rpx solid #FFFFFF;
  72. border-radius: 50%;
  73. overflow: hidden;
  74. &-img {
  75. width: 100%;
  76. height: 100%;
  77. }
  78. }
  79. .info {
  80. margin-left: 24rpx;
  81. .nickname {
  82. font-family: PingFang SC;
  83. font-weight: 600;
  84. font-size: 40rpx;
  85. line-height: 1.1;
  86. color: #252545;
  87. }
  88. .desc {
  89. margin-top: 8rpx;
  90. font-family: PingFang SC;
  91. font-weight: 400;
  92. font-size: 36rpx;
  93. line-height: 1.2;
  94. color: #252545CC;
  95. .gender {
  96. margin-left: 16rpx;
  97. }
  98. }
  99. }
  100. }
  101. }
  102. &-content {
  103. width: 100%;
  104. padding: 32rpx 24rpx 48rpx 24rpx;
  105. padding-top: 264rpx;
  106. box-sizing: border-box;
  107. }
  108. }
  109. </style>