qingyiay
2023-03-31 04f3f15c930c2b02187d0ce11d68978b65361d54
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
<template>
    <view
        class="card"
        :style="{
            background:
                backgroundType == 0
                    ? 'url(https://hesuancj.cn:9095/appimg/image/background/customer-blue.png) no-repeat'
                    : backgroundType == 1
                    ? 'url(https://hesuancj.cn:9095/appimg/image/background/huoDai.png) no-repeat'
                    : 'url(https://hesuancj.cn:9095/appimg/image/background/driver.png) no-repeat',
            backgroundSize: '100% 100%'
        }"
    >
        <!-- <view class="icon" @click="iconClick(name)" v-if="icon"><u-icon name="arrow-rightward"></u-icon></view> -->
        <view class="card-body" @click="bodyClick">
            <view class="card-left"><slot name="left"></slot></view>
            <view class="card-right">
                <view class="card-right-top"><slot name="right-top"></slot></view>
                <view class="card-right-bottom"><slot name="right-bottom"></slot></view>
            </view>
        </view>
    </view>
</template>
<script>
export default {
    name: 'card',
    props: {
        // icon: {
        //     type: Boolean,
        //     default: false
        // },
        backgroundType: {
            type: Number,
            default: 0
        },
        name: {
            type: String,
            default: ''
        }
    },
    data() {
        return {};
    },
    methods: {
        bodyClick() {
            this.$emit('click', this.name);
        }
        // iconClick() {
        //     this.$emit('iconClick', this.name);
        // }
    }
};
</script>
 
<style lang="scss" scoped>
.card {
    // padding: vww(7) vww(10) vww(10) vww(10);
    width: 100%;
    height: vww(138);
    // box-shadow: 0px 0px 8px 0px rgba(216, 218, 238, 0.8);
    // padding: vww(15);
    box-sizing: border-box;
    // overflow: hidden;
    // margin-top: vww(12);
    // border-radius: vww(8);
    .icon {
        width: vww(20);
        height: vww(20);
        float: right;
    }
    .card-body {
        font-size: vww(14);
        font-weight: 300;
        width: 100%;
        height: 100%;
        display: flex;
        .card-left {
            width: 40%;
            height: 100%;
        }
        .card-right {
            width: 60%;
            height: 100%;
            &-top {
                width: 100%;
                height: 65%;
            }
            &-bottom {
                width: 100%;
                height: 35%;
            }
        }
    }
}
</style>