schangxiang@126.com
2024-09-02 3b3e3bcf1345197670c82988ceb3e8d34be3b5f1
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<template>
  <div class="home-index-module-a-compontent">
    <div v-for="(data, index) in datas" :key="index" class="cart">
      <div class="card-item">
        <div class="card-left">
          <p>{{ data.title }}</p>
          <h1>{{ data.value }}</h1>
          <div>
            <span
              class="num"
              :style="`background-color:${data.changeVal > 0 ? '#009966' : (data.changeVal == 0 ? 'orange' : 'red')}`">
              <span v-if="data.changeVal >= 0">+</span>
              {{ data.changeVal }}%
            </span>
            <span class="text" v-if="data.changeVal > 0">同比昨日增加</span>
            <span class="text" v-else-if="data.changeVal == 0">于昨日持平</span>
            <span class="text" v-else>同比昨日下降</span>
          </div>
        </div>
        <div class="card-right">
          <div
            class="circle"
            :style="`background-image:linear-gradient(to bottom ,${data.color.top} ,${data.color.bottom})`">
            <img src="@/assets/welcome/inner.png" alt="">
          </div>
        </div>
      </div>
      <div class="divider" v-if="index !== datas.length - 1"></div>
    </div>
  </div>
</template>
 
<script>
import { GeInOutTotalNumber } from '@/api/modular/system/homeManage'
export default {
  name: 'HomeIndexModuleACompontent',
  data() {
    return {
      datas: [
        {
          title: '数据一',
          value: '60%',
          changeVal: '10',
          color: {
            top: 'rgba(4,154,255,.5)',
            bottom: ' rgba(4,154,255,1)'
          }
        },
        {
          title: '数据二',
          value: '70%',
          changeVal: '0',
          color: {
            top: 'rgba(255,53,53,.5)',
            bottom: 'rgba(255,53,53,1)'
          }
        },
        {
          title: '数据三',
          value: '90%',
          changeVal: '-10',
          color: {
            top: 'rgba(255,102,51,.5)',
            bottom: ' rgba(255,102,51,1)'
          }
        },
        {
          title: '数据四',
          value: '600件',
          changeVal: '10',
          color: {
            top: 'rgba(0,153,102,.5)',
            bottom: ' rgba(0,153,102,1)'
          }
        },
        {
          title: '数据五',
          value: '50/小时',
          changeVal: '10',
          color: {
            top: 'rgba(133,5,134,.5)',
            bottom: ' rgba(133,5,134,1)'
          }
        }
      ]
    }
  },
  methods: {
  },
  mounted() {
  }
}
</script>
 
<style lang="less" scoped>
.home-index-module-a-compontent {
  display: flex;
 
  .cart {
    display: flex;
    flex: 1;
 
    .divider {
      width: 8px;
    }
 
    .card-item {
      flex: 1;
      height: 120px;
      border-radius: 6px;
      background-color: #fff;
      padding: 0 10px;
      display: flex;
      justify-content: space-between;
 
      .card-left {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
 
        p {
          color: #787878;
          font-size: 16px;
          margin: 0;
        }
 
        h1 {
          font-size: 25px;
          font-weight: 700;
          margin: 0;
        }
 
        .num {
          display: inline-block;
          width: 50px;
          height: 23px;
          border-radius: 2px;
          text-align: center;
          color: #fff;
          margin-right: 6px;
          background-color: #009966;
 
        }
 
        .text {
          font-size: 14px;
          color: #9494a2;
        }
      }
 
      .card-right {
        display: flex;
        align-self: center;
 
        .circle {
          width: 56px;
          height: 56px;
          border-radius: 28px;
          display: flex;
          align-items: center;
          justify-content: center;
 
          img {
            width: 30px;
            height: 30px;
 
          }
        }
      }
    }
  }
 
}
</style>