<template>
    <div>
        <view @click="jumpResumeDetail">
            <view class="info felx-between">
                <view class="text-wrap">
                    <view class="name">
                        {{ data.name || "名字" }}
                        <text>{{ data.positionName ? `岗位：${data.positionName}` : "" }}</text>
                    </view>
                    <view class="other">
                        {{ data.workAge }}年 ｜ {{ educationLevelText }} ｜ {{ data.minSalary + "~" + data.maxSalary }}
                    </view>
                </view>
                <image v-if="data.avatar" :src="evn.APP_IMAGE_BASE_API + data.avatar" mode="" />
                <image v-else src="@/static/image/user/default-avatar.png" mode="" />
            </view>
            <view class="education"> {{ data.schoolName || "无" }}·{{ data.major || "无" }} </view>
            <view class="introduce">
                {{ data.personalAdvantages }}
            </view>
        </view>
    </div>
</template>

<script setup>
import { defineProps, computed } from "vue";
import evn from "@/utils/config";
import { getEnumText } from "@/utils/utils";
import { useAsync } from "@/hooks/useAsync";
let { data, type } = defineProps({
    data: {
        type: Object,
        default: () => ({})
    },

    type: {
        type: String,
        default: () => "recommend"
    }
});
console.log(data);
const { data: educationLevelText } = useAsync(getEnumText("EnumEducation", data.education));
const jumpResumeDetail = () => {
    console.log("data.positionId", data.positionId);
    uni.navigateTo({
        url: `/pages/user/resume/index?jobId=${data.positionId}&userId=${data.userId}&applicationId=${data.id}&type=${type}`
    });
};
</script>

<style lang="scss" scoped>
.felx-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.info {
    .name {
        font-size: 32rpx;
        font-weight: 600;
        line-height: 48rpx;
        color: #1b2026;
        text {
            font-size: 24rpx;
            font-weight: normal;
            line-height: 36rpx;
            color: #77818f;
        }
    }
    .other {
        font-size: 24rpx;
        font-weight: normal;
        line-height: 36rpx;
        color: #77818f;
    }
    image {
        width: 84rpx;
        height: 84rpx;
        border-radius: 50%;
    }
}
.education {
    display: inline-block;
    padding: 20rpx 12rpx;
    margin: 16rpx 0;
    font-size: 24rpx;
    font-weight: normal;
    line-height: 36rpx;
    color: #1b2026;
    background: rgb(99 107 117 / 10%);
    border-radius: 8rpx;
}
.introduce {
    display: -webkit-box; // 将对象作为弹性伸缩盒子模型显示。
    overflow: hidden; // 超出的文本隐藏
    font-size: 24rpx;
    font-weight: normal;
    line-height: 36rpx;
    color: #77818f;
    text-overflow: ellipsis; // 溢出用省略号显示
    line-clamp: 2; // 这个属性不是css的规范属性，需要组合上面两个属性，表示显示的行数。
    /* stylelint-disable-next-line order/properties-order */
    -webkit-line-clamp: 2; // 这个属性不是css的规范属性，需要组合上面两个属性，表示显示的行数。
    -webkit-box-orient: vertical; // 从上到下垂直排列子元素（设置伸缩盒子的子元素排列方式）
}
</style>
