talentItem.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view>
  3. <uni-card v-for="(val, index) in items" :key="index" :is-shadow="true" @tap.stop="handleDetail(val)" :border='false' shadow="0px 0px 3px 1px rgba(0,0,0,0.1)">
  4. <!-- 基本信息 -->
  5. <view class="d-flex align-center">
  6. <view class="user-avatar">
  7. <image class="user-avatar-img" :src="getUserAvatar(val.avatar, val.sex)" mode="scaleToFill"></image>
  8. <image class="user-avatar-sex" :src="val?.sex ? val?.sex === '1' ? '/static/img/man.png' : '/static/img/female.png' : ''" alt="" mode="scaleToFill" />
  9. </view>
  10. <view style="flex: 1; margin-left: 10px;">
  11. <view class="font-size-18">{{ val.name }}</view>
  12. <view class="ss-m-t-10">
  13. <span
  14. class="color-666"
  15. v-for="(key, index) in desc"
  16. :key="index"
  17. >
  18. {{ val[key] }}
  19. <span v-if="index !== desc.length - 1 && val[key]" class="ss-m-x-10">|</span>
  20. </span>
  21. </view>
  22. </view>
  23. </view>
  24. <!-- 感兴趣职位 -->
  25. <view v-if="val.position?.positionNames && showLastWorkExp" class="ss-m-t-15 color-666">
  26. 感兴趣职位:{{ val.position?.positionNames || '暂无' }}
  27. </view>
  28. <!-- 最近一份工作经验 -->
  29. <view v-if="val?.lastWorkExp && showLastWorkExp" class="ss-m-t-15 color-666">
  30. <view>
  31. <uni-icons type="smallcircle" class="ss-m-r-10" color="#666"></uni-icons>
  32. {{ formatName(val.lastWorkExp.enterpriseName) || '未填写企业名称' }}
  33. </view>
  34. <view class="ss-m-l-45">
  35. <span>{{ formatName(val.lastWorkExp.positionName) || '未填写职位名称' }}</span>
  36. <span v-if="val.lastWorkExp.startTime" class="ss-m-l-20">
  37. {{ val.lastWorkExp.startTime ? timesTampChange(val.lastWorkExp.startTime, 'Y-M') : '暂无' }}
  38. -
  39. {{ val.lastWorkExp.endTime ? timesTampChange(val.lastWorkExp.endTime, 'Y-M') : val.lastWorkExp.startTime ? '至今' : '' }}
  40. </span>
  41. </view>
  42. </view>
  43. <!-- 工作经历 -->
  44. <view v-if="val?.workList && val.workList.length > 0 && !showLastWorkExp" class="ss-m-t-15 color-666">
  45. <view v-for="k in val.workList" :key="k.id" class="ss-m-b-30">
  46. <view>
  47. <uni-icons type="smallcircle" class="ss-m-r-10" color="#666"></uni-icons>
  48. {{ formatName(k.enterpriseName) || '未填写企业名称' }}
  49. </view>
  50. <view class="ss-m-l-45">
  51. <span>{{ formatName(k.positionName) || '未填写职位名称' }}</span>
  52. <span class="ss-m-l-20">
  53. <span>{{ k.startTimeStr }}</span>
  54. <span v-if="k.endTimeStr"> - {{ k.endTimeStr }}</span>
  55. <!-- <span v-if="k.year"> ({{ k.year }})</span> -->
  56. </span>
  57. </view>
  58. </view>
  59. </view>
  60. </uni-card>
  61. </view>
  62. </template>
  63. <script setup>
  64. import { getUserAvatar } from '@/utils/avatar.js'
  65. import { timesTampChange } from '@/utils/date'
  66. import { formatName } from '@/utils/getText'
  67. defineProps({
  68. items: Array,
  69. showLastWorkExp: {
  70. type: Boolean,
  71. default: true
  72. }
  73. })
  74. const desc = ['jobStatusName', 'eduName', 'expName']
  75. const handleDetail = ({ userId }) => {
  76. if (!userId) {
  77. uni.showToast({
  78. title: '资源获取失败,请稍后重试',
  79. icon: 'none',
  80. duration: 2000
  81. })
  82. return
  83. }
  84. uni.navigateTo({
  85. url: `/pagesB/personnelDetails/index?id=${userId}&type=1`
  86. })
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .user-avatar {
  91. position: relative;
  92. &-img {
  93. width: 60px;
  94. height: 60px;
  95. border-radius: 50%;
  96. }
  97. &-sex {
  98. position: absolute;
  99. right: 0;
  100. bottom: 2px;
  101. width: 20px;
  102. height: 20px;
  103. background-color: #fff;
  104. border-radius: 50%;
  105. }
  106. }
  107. </style>