zhangxiao
2024-08-26 57b66478e7e335379435b31c20da4619bd1411f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<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>