TopCard.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="top-card" v-if="info">
  3. <view class="card-top">
  4. <image mode="heightFix" src="/static/image/head.png" />
  5. <view class="card-top-right">
  6. <view class="card-top-right-name">{{info.name}}<text class="iconfont" @click="onClick">{{ showIcon ? '&#xe8bf;' : '&#xe901;' }}</text></view>
  7. <view>{{info.addr}}<text class="iconfont">&#xe602;</text></view>
  8. <view class="card-top-right-sex">{{info.sex}} | {{info.text}}</view>
  9. </view>
  10. </view>
  11. <view class="card-bottom">
  12. <view>
  13. <view class="label">证件号码</view>
  14. <view>{{info.idCard}}</view>
  15. </view>
  16. <view class="second">
  17. <view class="label">最近就诊</view>
  18. <view>{{info.date}}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script lang="ts" setup>
  24. import { PropType, ref } from 'vue'
  25. const emit = defineEmits(['update'])
  26. defineProps({
  27. info: {
  28. type: Object as PropType<any>,
  29. default: () => ({}),
  30. },
  31. })
  32. const showIcon = ref(false)
  33. const onClick = ()=> {
  34. showIcon.value = !showIcon.value
  35. emit('update',showIcon.value)
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .top-card {
  40. border-radius: 0px 0px $uni-spacing-row-s2 $uni-spacing-row-s2;
  41. background: $uni-color-primary;
  42. padding: $uni-spacing-col-s2 $page-row-spacing $uni-spacing-col-s4;
  43. border: 1px solid $uni-border-color;
  44. .card-top {
  45. @include flex;
  46. margin-bottom: $uni-spacing-col-s4;
  47. color: #fff;
  48. image {
  49. width: 140rpx;
  50. height: 140rpx;
  51. display: block;
  52. margin-right: $uni-spacing-row-s4;
  53. }
  54. .card-top-right {
  55. flex: 1;
  56. line-height: $uni-line-height-base;
  57. .iconfont {
  58. margin-left: 8rpx;
  59. }
  60. .card-top-right-name {
  61. font-size: $uni-font-size-xxxl;
  62. line-height: $uni-line-height-xxxl;
  63. display: flex;
  64. align-items: center;
  65. .iconfont {
  66. line-height: $uni-line-height-xxxl;
  67. font-size: 32rpx;
  68. }
  69. }
  70. .card-top-right-sex {
  71. font-size: $uni-font-size-sm;
  72. line-height: $uni-line-height-sm;
  73. }
  74. }
  75. }
  76. .card-bottom {
  77. background-color: #fff;
  78. color: $uni-text-color;
  79. border-radius: $uni-spacing-row-s2;
  80. padding: $uni-spacing-row-s4;
  81. line-height: $uni-line-height-base;
  82. @include flex;
  83. >view {
  84. flex: 1;
  85. @include flex;
  86. flex-direction: column;
  87. }
  88. .label {
  89. color: $uni-text-color-grey;
  90. margin-bottom: 24rpx;
  91. }
  92. .second {
  93. position: relative;
  94. &::before {
  95. content: '';
  96. position: absolute;
  97. left: 0;
  98. background: $uni-border-color;
  99. width: 1px;
  100. height: 80rpx;
  101. -webkit-transform: scaleX(0.5);
  102. transform: scaleX(0.5);
  103. -webkit-transform-origin: 0 0;
  104. transform-origin: 0 0;
  105. }
  106. }
  107. }
  108. }
  109. </style>