pretty-card.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <view class="pretty-card">
  3. <view class="px-35 py-45">
  4. <uv-text :text="title" color="white" margin="-2px 0 20px 20px"/>
  5. <slot>
  6. <view class="fx-row fx-bet-cen text-primary text-xs font-[PingFang] font-thin">
  7. <view style="max-width: 33vw" class="truncate">姓名:{{ userSnapshot.nickName }}</view>
  8. <view>省份:{{ userSnapshot.provinceName }}</view>
  9. <view>类别:{{ userSnapshot.examType }}</view>
  10. </view>
  11. </slot>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import {useInjectUserSnapshot} from "@/pages/ie/hooks/useUserSnapshotInjection";
  17. export default {
  18. name: "pretty-card",
  19. props: {
  20. title: {
  21. type: String,
  22. default: '我的信息'
  23. }
  24. },
  25. setup() {
  26. const {userSnapshot} = useInjectUserSnapshot()
  27. return {
  28. userSnapshot
  29. }
  30. }
  31. }
  32. </script>
  33. <style scoped>
  34. .pretty-card {
  35. width: 100vw;
  36. height: 112px;
  37. background-image: url('@/static/ie/index/bg-card.png');
  38. background-repeat: no-repeat;
  39. background-position: center;
  40. background-size: cover;
  41. }
  42. </style>