talentItem.vue 3.1 KB

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