talentItem.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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, index) in val.workList" :key="k.id" class="ss-m-b-30">
  46. <template v-if="val.showAll || index < 2">
  47. <view>
  48. <uni-icons type="smallcircle" class="ss-m-r-10" color="#666"></uni-icons>
  49. {{ formatName(k.enterpriseName) || '未填写企业名称' }}
  50. </view>
  51. <view class="ss-m-l-45">
  52. <span>{{ formatName(k.positionName) || '未填写职位名称' }}</span>
  53. <span class="ss-m-l-20">
  54. <span>{{ k.startTimeStr }}</span>
  55. <span v-if="k.endTimeStr"> - {{ k.endTimeStr }}</span>
  56. </span>
  57. </view>
  58. </template>
  59. </view>
  60. <view v-if="val.workList.length > 2" class="showBtn color-primary" @tap.stop="val.showAll = Boolean(!val.showAll)">
  61. {{ val.showAll ? '收起' : '展开全部' }}
  62. <view class="icons">
  63. <uni-icons class="icon" :type="val.showAll ? 'up' : 'down'" color="#008BB7" size="12" />
  64. <uni-icons class="icon" :type="val.showAll ? 'up' : 'down'" color="#008BB7" size="12" />
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </template>
  71. <script setup>
  72. import { getUserAvatar } from '@/utils/avatar.js'
  73. import { timesTampChange } from '@/utils/date'
  74. import { formatName } from '@/utils/getText'
  75. defineProps({
  76. items: Array,
  77. showLastWorkExp: {
  78. type: Boolean,
  79. default: true
  80. }
  81. })
  82. const desc = ['jobStatusName', 'eduName', 'expName']
  83. const handleDetail = ({ userId }) => {
  84. if (!userId) {
  85. uni.showToast({
  86. title: '资源获取失败,请稍后重试',
  87. icon: 'none',
  88. duration: 2000
  89. })
  90. return
  91. }
  92. uni.navigateTo({
  93. url: `/pagesB/personnelDetails/index?id=${userId}&type=1`
  94. })
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .list-item {
  99. margin: 30rpx;
  100. border-radius: 20rpx;
  101. padding: 30rpx;
  102. background-color: #fbfbfb;
  103. box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
  104. border: 1rpx solid #E1E4E9;
  105. }
  106. .user-avatar {
  107. position: relative;
  108. &-img {
  109. width: 60px;
  110. height: 60px;
  111. border-radius: 50%;
  112. }
  113. &-sex {
  114. position: absolute;
  115. right: 0;
  116. bottom: 2px;
  117. width: 20px;
  118. height: 20px;
  119. background-color: #fff;
  120. border-radius: 50%;
  121. }
  122. }
  123. .showBtn {
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. .icons {
  128. display: flex;
  129. flex-direction: column;
  130. margin-left: 5px;
  131. .icon {
  132. line-height: 4px;
  133. }
  134. }
  135. }
  136. </style>