baseInfo.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view>
  3. <view class="d-flex">
  4. <view class="user-avatar">
  5. <image class="user-avatar-img" :src="getUserAvatar(data?.avatar, data?.sex)" alt="" mode="scaleToFill" />
  6. <image class="user-avatar-sex" :src="data?.sex ? data?.sex === '1' ? '/static/img/man.png' : '/static/img/female.png' : ''" alt="" mode="scaleToFill" />
  7. </view>
  8. <view class="user-left">
  9. <view class="user-name">{{ data?.name }}</view>
  10. <view class="ss-m-t-10">
  11. <span
  12. class="color-666"
  13. v-for="(key, index) in desc"
  14. :key="index"
  15. >
  16. {{ data[key] }}
  17. <span v-if="index !== desc.length - 1 && data[key]" class="ss-m-x-10">|</span>
  18. </span>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="ss-m-t-10">
  23. <uni-tag
  24. v-for="(tag,i) in data?.tagList || []"
  25. :key="i"
  26. class="tag-gap ss-m-r-10"
  27. :text="tag"
  28. inverted="false"
  29. size="medium"
  30. custom-style="background-color: #ececec; color: #666; border-color: #ececec; display: inline-block;margin-bottom: 10px;"
  31. />
  32. </view>
  33. </view>
  34. </template>
  35. <script setup>
  36. defineProps({ data: Object })
  37. import { getUserAvatar } from '@/utils/avatar'
  38. const desc = ['jobStatusName', 'eduName', 'expName']
  39. </script>
  40. <style scoped lang="scss">
  41. .user-avatar {
  42. position: relative;
  43. &-img {
  44. width: 65px;
  45. height: 65px;
  46. border-radius: 50%;
  47. }
  48. &-sex {
  49. position: absolute;
  50. right: 0;
  51. bottom: 0;
  52. width: 20px;
  53. height: 20px;
  54. background-color: #fff;
  55. border-radius: 50%;
  56. }
  57. }
  58. .user-left {
  59. flex: 1;
  60. margin-left: 10px;
  61. .user-name {
  62. font-size: 25px;
  63. font-weight: 600;
  64. color: #0E100F;
  65. }
  66. }
  67. </style>