| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- <template>
- <div>
- <div class="leftInfo">
- <div class="leftInfo_title">{{ title }}</div>
- <div class="leftInfo_value">
- <!-- {{value}} -->
- <NumberScroll :value="value" :duration="2000" />
- </div>
- <div class="leftInfo_growth" :style="{ color: growthColors[upStatus + 1] }">
- <el-icon
- ><Top v-if="upStatus == 1" /><SemiSelect v-if="upStatus == 0" /><Bottom
- v-if="upStatus == -1"
- /></el-icon>
- {{ growth }}
- </div>
- </div>
- <div class="icon" :style="{ background: iconColor + '32' }">
- <el-icon>
- <component :is="iconName" :color="iconColor" />
- </el-icon>
- </div>
- </div>
- </template>
- <script>
- import NumberScroll from '@/components/AppVue/numberScroll.vue'
- export default {
- name: "card",
- components: {
- NumberScroll
- },
- props: {
- title: {
- type: String,
- default: "",
- },
- value: {
- type: String,
- default: "0",
- },
- growth: {
- type: String,
- default: "",
- },
- iconColor: {
- type: String,
- default: "#CCCCCC",
- },
- iconName: {
- type: String,
- default: "WalletFilled",
- },
- upStatus: {
- type: Number,
- // -1 下降
- // 0 持平
- // 1 上升
- default: -1,
- },
- },
- data() {
- return {
- // 0 下降
- // 1 持平
- // 2 上升
- growthColors: ["#F56C6C", "#909399", "#67C23A"],
- };
- },
- };
- </script>
- <style lang="less" scoped>
- .leftInfo {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: flex-start;
- }
- .leftInfo_title {
- font-size: 12px;
- color: #909399;
- line-height: 20px;
- }
- .leftInfo_value {
- margin-top: 4px;
- font-size: 24px;
- font-weight: bold;
- line-height: 33px;
- }
- .leftInfo_growth {
- margin-top: 12px;
- font-size: 12px;
- line-height: 20px;
- font-weight: bold;
- }
- .icon {
- width: 40px;
- height: 40px;
- border-radius: 5px;
- background: #ccc;
- box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
- font-size: 20px;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- </style>
|