<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="icon" />
|
</div>
|
<div class="card-content">
|
<div class="card-content-top">
|
<div class="card-name">
|
<span class="name">{{ title }}</span>
|
<icon-woman v-if="sex && sex === 'woman'" />
|
<icon-man v-if="!sex && sex === 'woman'" />
|
</div>
|
<div class="card-detail" @click="handleChange">详情 ></div>
|
</div>
|
<div v-for="(content, key) in contents" :key="key">
|
<span>{{ content.key }}</span
|
>:
|
<span>{{ content.value }}</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;
|
contents?: Array<any>;
|
}>(),
|
{
|
icon: "",
|
title: "",
|
contents: () => []
|
}
|
);
|
|
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>
|