123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <view>
- <view v-for="(val, index) in items" :key="index" class="list-item" @tap.stop="handleDetail(val)" >
- <!-- 基本信息 -->
- <view class="d-flex align-center">
- <view class="user-avatar">
- <image class="user-avatar-img" :src="getUserAvatar(val.avatar, val.sex)" mode="scaleToFill"></image>
- <image class="user-avatar-sex" :src="val?.sex ? val?.sex === '1' ? '/static/img/man.png' : '/static/img/female.png' : ''" alt="" mode="scaleToFill" />
- </view>
- <view style="flex: 1; margin-left: 10px;">
- <view class="font-size-18" style="color: #0E100F">{{ val.name }}</view>
- <view class="ss-m-t-10">
- <span
- class="color-666 font-size-14"
- v-for="(key, index) in desc"
- :key="index"
- >
- {{ val[key] }}
- <span v-if="index !== desc.length - 1 && val[key]" class="ss-m-x-10">|</span>
- </span>
- </view>
- </view>
- </view>
-
- <!-- 感兴趣职位 -->
- <view v-if="val.position?.positionNames && showLastWorkExp" class="ss-m-t-15 color-666 font-size-14">
- 感兴趣职位:{{ val.position?.positionNames || '暂无' }}
- </view>
- <!-- 最近一份工作经验 -->
- <view v-if="val?.lastWorkExp && showLastWorkExp" class="ss-m-t-15 color-666 font-size-14">
- <view>
- <uni-icons type="smallcircle" class="ss-m-r-10" color="#666"></uni-icons>
- {{ formatName(val.lastWorkExp.enterpriseName) || '未填写企业名称' }}
- </view>
- <view class="ss-m-l-45">
- <span>{{ formatName(val.lastWorkExp.positionName) || '未填写职位名称' }}</span>
- <span v-if="val.lastWorkExp.startTime" class="ss-m-l-20">
- {{ val.lastWorkExp.startTime ? timesTampChange(val.lastWorkExp.startTime, 'Y-M') : '暂无' }}
- -
- {{ val.lastWorkExp.endTime ? timesTampChange(val.lastWorkExp.endTime, 'Y-M') : val.lastWorkExp.startTime ? '至今' : '' }}
- </span>
- </view>
- </view>
- <!-- 工作经历 -->
- <view v-if="val?.workList && val.workList.length > 0 && !showLastWorkExp" class="ss-m-t-15 color-666 font-size-14">
- <view v-for="k in val.workList" :key="k.id" class="ss-m-b-30">
- <view>
- <uni-icons type="smallcircle" class="ss-m-r-10" color="#666"></uni-icons>
- {{ formatName(k.enterpriseName) || '未填写企业名称' }}
- </view>
- <view class="ss-m-l-45">
- <span>{{ formatName(k.positionName) || '未填写职位名称' }}</span>
- <span class="ss-m-l-20">
- <span>{{ k.startTimeStr }}</span>
- <span v-if="k.endTimeStr"> - {{ k.endTimeStr }}</span>
- </span>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script setup>
- import { getUserAvatar } from '@/utils/avatar.js'
- import { timesTampChange } from '@/utils/date'
- import { formatName } from '@/utils/getText'
- defineProps({
- items: Array,
- showLastWorkExp: {
- type: Boolean,
- default: true
- }
- })
- const desc = ['jobStatusName', 'eduName', 'expName']
- const handleDetail = ({ userId }) => {
- if (!userId) {
- uni.showToast({
- title: '资源获取失败,请稍后重试',
- icon: 'none',
- duration: 2000
- })
- return
- }
- uni.navigateTo({
- url: `/pagesB/personnelDetails/index?id=${userId}&type=1`
- })
- }
- </script>
- <style scoped lang="scss">
- .list-item {
- margin: 30rpx;
- border-radius: 20rpx;
- padding: 30rpx;
- background-color: #fbfbfb;
- box-shadow: 1px 2px 12px rgba(0, 0, 0, 0.17);
- border: 1rpx solid #E1E4E9;
- }
- .user-avatar {
- position: relative;
- &-img {
- width: 60px;
- height: 60px;
- border-radius: 50%;
- }
- &-sex {
- position: absolute;
- right: 0;
- bottom: 2px;
- width: 20px;
- height: 20px;
- background-color: #fff;
- border-radius: 50%;
- }
- }
- </style>
|