<template>
|
<!-- 带头像首页 -->
|
<div class="the-img-card" :class="currentThemeMode === 'dark' ? 'card-img-dark' : ''">
|
<div class="img-box-card">
|
<div class="card-icon" :style="dynamicStyle">
|
<a-image
|
width="140"
|
height="140"
|
border-radius="14px"
|
:preview="false"
|
src="https://p1-arco.byteimg.com/tos-cn-i-uwbnlip3yd/a8c8cdb109cb051163646151a4a5083b.png~tplv-uwbnlip3yd-webp.webp"
|
/>
|
</div>
|
<div class="card-content">
|
<div class="card-content-top">
|
<div class="card-name">
|
<span class="name">张三</span>
|
<icon-woman v-if="sex && sex === 'woman'" />
|
<icon-man v-if="!sex && sex === 'woman'" />
|
</div>
|
<div @click="handleChange" class="card-detail">详情 ></div>
|
</div>
|
<div>
|
<span>人员编号</span>:
|
<span>H324343</span>
|
</div>
|
<div>
|
<span>出现天数</span>:
|
<span>2天</span>
|
</div>
|
<div>
|
<span>居住地址</span>:
|
<span>经济快速等级考试</span>
|
</div>
|
<div>
|
<span>身份证号</span>:
|
<span>3673672627722</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
<script lang="ts" setup name="TheIconCard">
|
import { useTheme } from "@/hooks/useTheme";
|
import { Svg } from "@easyfe/admin-component";
|
|
const { themeModeOptions, currentThemeMode, handleThemeChange } = useTheme();
|
const props = withDefaults(
|
defineProps<{
|
icon?: string;
|
title?: string;
|
unit?: string;
|
metering?: number;
|
colorBg?: string;
|
sex?: boolean;
|
isIcon?: boolean;
|
}>(),
|
{
|
icon: "",
|
title: "",
|
unit: "",
|
metering: 0,
|
colorBg: "#fff",
|
sex: true,
|
isIcon: true
|
}
|
);
|
|
const colorBg = computed(() => {
|
return props.colorBg;
|
});
|
const dynamicStyle = {
|
backgroundColor: colorBg.value // 动态背景色
|
};
|
|
const emits = defineEmits<{
|
(e: "handleChange", data: object): void;
|
}>();
|
const handleChange = (item: any) => {
|
emits("handleChange", item);
|
console.log("handleChange", item);
|
};
|
</script>
|
<style lang="scss" scoped>
|
.card-img-dark {
|
.card-box {
|
display: flex;
|
align-items: center;
|
// justify-content: center;
|
}
|
}
|
.the-img-card {
|
width: 100%;
|
border-radius: 4px;
|
box-sizing: border-box;
|
.img-box-card {
|
display: flex;
|
align-items: center;
|
width: 100%;
|
// justify-content: center;
|
.card-icon {
|
width: 140px;
|
height: 140px;
|
border-radius: 20px;
|
}
|
}
|
|
.card-content {
|
margin-left: 10px;
|
line-height: 24px;
|
color: var(--color-text-1);
|
font-size: 12px;
|
width: 100%;
|
.card-content-top {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
.card-name {
|
font-size: 16px;
|
.name {
|
margin-right: 4px;
|
}
|
}
|
// .metering {
|
// font-size: 14px;
|
// margin-right: 4px;
|
// }
|
}
|
}
|
</style>
|