zhangxiao
2024-08-23 3a28df1eccec424a37649cca968bce59739e0b35
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<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>