wujingjing
2024-07-16 4b917d77e07e3b2dd3f572c479995dd013ce5467
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
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>总览概述</title>
        <script src="/customer_list/ch/static/js/tailwind.js"></script>
        <script src="/customer_list/ch/static/js/vue.global.js"></script>    
        <script src="/customer_list/ch/static/js/iframe-resizer/child-5.1.5.js"    async></script>
 
        <link href="/customer_list/ch/static/fonts/iconfont/iconfont.css" rel="stylesheet" type="text/css"></link>
    </head>
    <body>
        <div class="w-full h-full bg-[#fff] px-10 py-0" id="overview">
            <div class="w-full h-[40px] flex items-center">年度缴费情况</div>
            <div class="h-full">
                <div class="w-[310px] flex flex-wrap justify-between h-[220px]">
                    <div v-for="item in state.annualPayment" :key="item" class="w-[50%] h-[33%] flex items-center">
                        <div :class="['iconfont icon-' + item.Icon]" :style="`color:${item.BgColor};font-size:${36}px`"></div>
                        <div class="ml-[10px]">
                            <span>{{ item.Value }} <span>{{ item.Unit }}</span></span>
                            <p>{{ item.Name }}</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    <script>
        const { createApp, onMounted, ref, reactive } = Vue;
        createApp({
            setup() {
                let state = reactive({
                    annualPayment: [
                        {
                            ID: 1,
                            Name: '本年缴费',
                            Value: 8009987,
                            Unit: '笔',
                        },
                        {
                            ID: 2,
                            Name: '缴费金额',
                            Value: 7298.3,
                            Unit: '万元',
                        },
                        {
                            ID: 3,
                            Name: '本月缴费',
                            Value: 198,
                            Unit: '笔',
                        },
                        {
                            ID: 4,
                            Name: '缴费金额',
                            Value: 3,
                            Unit: '万元',
                        },
                        {
                            ID: 5,
                            Name: '本月缴费',
                            Value: 22,
                            Unit: '笔',
                        },
                        {
                            ID: 6,
                            Name: '缴费金额',
                            Value: 0.3,
                            Unit: '万元',
                        },
                        {
                            ID: 7,
                            Name: '今日实时',
                            Value: 198,
                            Unit: '笔',
                        },
                        {
                            ID: 8,
                            Name: '缴费金额',
                            Value: 198,
                            Unit: '万元',
                        },
                    ],
                });
                const getOverViewList = () => {
                    const iconList = [
                        'biaodan',
                        'putong',
                        'zhongduancanshuchaxun',
                        'shidu',
                        'fuwenbenkuang',
                        'fuwenben',
                        'jiliandongxuanzeqi',
                        'jinridaiban',
                        'gongju',
                    ];
                    state.annualPayment.forEach((annual, index) => {
                        annual.Icon = iconList[index];
                        annual.BgColor = randomHexColor();
                    });
                };
                //随机生成颜色
                const randomHexColor = () => {
                    return `#${Math.floor(Math.random() * 16777215)
                        .toString(16)
                        .padEnd(6, '0')}`;
                };
                onMounted(() => {
                    getOverViewList();
                });
 
                return { state };
            },
        }).mount('#overview');
    </script>
</html>