talentItem.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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" 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. {{ val.lastWorkExp.enterpriseName }}
  30. </view>
  31. <view class="ss-m-l-45">
  32. <span>{{ 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. </uni-card>
  41. </view>
  42. </template>
  43. <script setup>
  44. import { getUserAvatar } from '@/utils/avatar.js'
  45. import { timesTampChange } from '@/utils/date'
  46. defineProps({
  47. items: Array,
  48. showLastWorkExp: {
  49. type: Boolean,
  50. default: true
  51. }
  52. })
  53. const desc = ['jobStatusName', 'eduName', 'expName']
  54. const handleDetail = ({ userId }) => {
  55. if (!userId) {
  56. uni.showToast({
  57. title: '资源获取失败,请稍后重试',
  58. icon: 'none',
  59. duration: 2000
  60. })
  61. return
  62. }
  63. uni.navigateTo({
  64. url: `/pagesB/personnelDetails/index?id=${userId}`
  65. })
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .avatar {
  70. width: 60px;
  71. height: 60px;
  72. border-radius: 50%;
  73. margin: auto;
  74. }
  75. </style>