talentItem.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view>
  3. <view v-for="(val, index) in items" :key="index" class="list-item" @tap.stop="handleDetail(val)" >
  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" style="color: #0E100F">{{ val.name }}</view>
  12. <view class="ss-m-t-10">
  13. <span
  14. class="color-666 font-size-14"
  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 font-size-14">
  26. 感兴趣职位:{{ val.position?.positionNames || '暂无' }}
  27. </view>
  28. <!-- 最近一份工作经验 -->
  29. <view v-if="val?.lastWorkExp && showLastWorkExp" class="ss-m-t-15 color-666 font-size-14">
  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 font-size-14">
  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>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script setup>
  63. import { getUserAvatar } from '@/utils/avatar.js'
  64. import { timesTampChange } from '@/utils/date'
  65. import { formatName } from '@/utils/getText'
  66. defineProps({
  67. items: Array,
  68. showLastWorkExp: {
  69. type: Boolean,
  70. default: true
  71. }
  72. })
  73. const desc = ['jobStatusName', 'eduName', 'expName']
  74. const handleDetail = ({ userId }) => {
  75. if (!userId) {
  76. uni.showToast({
  77. title: '资源获取失败,请稍后重试',
  78. icon: 'none',
  79. duration: 2000
  80. })
  81. return
  82. }
  83. uni.navigateTo({
  84. url: `/pagesB/personnelDetails/index?id=${userId}&type=1`
  85. })
  86. }
  87. </script>
  88. <style scoped lang="scss">
  89. .list-item {
  90. margin: 30rpx;
  91. border-radius: 20rpx;
  92. padding: 30rpx;
  93. background-color: #fff;
  94. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  95. }
  96. .user-avatar {
  97. position: relative;
  98. &-img {
  99. width: 60px;
  100. height: 60px;
  101. border-radius: 50%;
  102. }
  103. &-sex {
  104. position: absolute;
  105. right: 0;
  106. bottom: 2px;
  107. width: 20px;
  108. height: 20px;
  109. background-color: #fff;
  110. border-radius: 50%;
  111. }
  112. }
  113. </style>