ViewTitle.vue
3.3 KB
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
<template>
<div class="content flex">
<div class="logo user-select">
<img style="height: 4vh" src="@/assets/images/logo.svg" alt="logo" />
</div>
<div class="view-title flex user-select">4S场景 XXX集团客户池数据大屏</div>
<div class="time">
<div class="top flex">
<img src="@/assets/images/time.svg" class="icon" />
<div class="now">{{ now }}</div>
<div class="yesterday">数据截止至 {{ yesterday }}</div>
</div>
<div class="bottom flex">
<div class="merchant">已同步门店数:{{ merchantNum.totalNum }}</div>
<div class="merchant">上月新接入店数:{{ merchantNum.increLastMonthNum }}</div>
<div class="merchant">本月新接入店数:{{ merchantNum.increThisMonthNum }}</div>
</div>
</div>
<div class="center-control">
<view-control />
</div>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: 'ViewTitle',
data() {
return {
yesterday: '',
now: new Date().format('yyyy-MM-dd hh:mm:ss'),
merchantNum: {
totalNum: '--',
increLastMonthNum: '--',
increThisMonthNum: '--'
}
}
},
mounted() {
this.yesterday = new Date(new Date().setDate(new Date().getDate() - 1)).format('yyyy-MM-dd')
this.timer()
this.getMerchantNum()
},
methods: {
timer() {
setInterval(() => {
this.now = new Date().format('yyyy-MM-dd hh:mm:ss')
}, 1e3)
},
getMerchantNum() {
this.api.overview.getMerchantNum({}).then(res => {
if (res.code === '0') {
this.merchantNum = res.data.dataList[0]
}
})
}
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: 0 24px;
position: relative;
background: #1d1c1c;
z-index: 9999999999;
.view-title {
color: transparent;
background: linear-gradient(left, #e60115 10%, #eb6001 25%, #f5aa01 50%, #fdf006 100%);
-webkit-background-clip: text;
font-size: 18px;
font-weight: 600;
&::before {
content: '';
display: block;
background: #373739;
width: 1px;
height: 20px;
margin: 0 8px;
}
}
.time {
margin-left: auto;
text-align: right;
font-size: 14px;
color: #ffffff;
.top {
justify-content: flex-end;
.now {
min-width: 9.3vw;
}
.yesterday {
font-size: 10px;
color: #606266;
margin-left: 5px;
}
}
.icon {
width: 16px;
height: 16px;
margin-right: 8px;
}
.bottom {
font-size: 10px;
line-height: 16px;
color: #fff;
.merchant {
color: #eb6001;
margin-right: 10px;
padding-right: 10px;
line-height: 2vh;
position: relative;
&::after {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 1px;
height: 1.5vh;
content: '';
background-color: #eb6001;
}
&:last-child {
margin-right: 0;
&::after {
width: 0;
}
}
}
}
}
.center-control {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 2;
}
}
</style>