AppointTable.vue
3.96 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
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
175
176
<!-- 邀约详情 -->
<template>
<div class="appoint-table">
<table
cellpadding='0'
cellspacing='0'
>
<tr>
<td>邀约时间</td>
<td>邀约详情</td>
<td>服务状态</td>
</tr>
<tr
v-for="(item, index) in detailData"
:key="index"
>
<td>{{item.time}}</td>
<td class="flex">
<img
class="detail-header"
:src="item.info.sex === 1 ? './header-man.jpg' : './header-woman.jpg'"
/>
<block class="detail-info">
<p>{{item.info.name}}</p>
<p>{{item.info.project}}</p>
</block>
<block class="detail-phone">
<p
class="secret-phone"
v-show="!item.info.phone"
>
<span class="one-tip">手机号码已加密</span>
<span
class="two-tip"
@click="handleGetPhone(item, index)"
>获取虚拟手机号</span>
</p>
<p v-show="item.info.phone">{{item.info.phone}}</p>
</block>
</td>
<td>
{{item.status === 1 ? '完成服务' : '未到店'}}
</td>
</tr>
</table>
</div>
</template>
<script>
export default {
name: 'AppointTable',
data() {
return {
hoursList: [
{ 'hour': '9:00' }, { 'hour': '10:00' },
{ 'hour': '11:00' }, { 'hour': '12:00' },
{ 'hour': '13:00' }, { 'hour': '14:00' },
{ 'hour': '15:00' }, { 'hour': '16:00' },
{ 'hour': '17:00' }, { 'hour': '18:00' }],
detailData: [{
time: '9:00',
info: {
header: '',
name: '张三',
// 1 - 男; 2 - 女
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}, {
time: '9:00',
info: {
header: '',
name: '张兰',
sex: 2,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 1
}, {
time: '10:00',
info: {
header: '',
name: '张一二',
sex: 1,
project: '预约项目',
phone: ''
},
// 0 - 未到店; 1 - 完成服务
status: 0
}]
}
},
mounted() { },
methods: {
handleGetPhone(targetItem, targetIndex) {
this.$confirm('客户手机号码已加密,是否获取虚拟号码?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.detailData[targetIndex].info.phone = '13088889999'
}).catch(err => {
console.log(err)
})
}
}
}
</script>
<style lang="scss" scoped>
.appoint-table {
width: 50%;
min-width: 536px;
.flex {
display: flex;
}
table {
width: 98%;
color: #333;
border: 1px solid #cfd3d5;
border-width: 1px 0 0 1px;
td {
padding: 0px 10px;
border: 1px solid #cfd3d5;
border-width: 0px 1px 1px 0px;
border-spacing: 0;
text-align: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.detail-header {
height: 70px;
width: 70px;
border-radius: 50%;
margin: 6px 10px;
}
.detail-info {
width: calc(100% - 250px);
}
.detail-phone {
position: relative;
width: 180px;
height: 70px;
line-height: 70px;
overflow: hidden;
p {
margin: 0 0;
}
}
.secret-phone {
position: absolute;
left: 0;
transition: left 1s;
cursor: pointer;
span {
display: inline-block;
width: 180px;
height: 100%;
}
.two-tip {
background-color: #cccccc;
}
}
.secret-phone:hover {
left: -180px;
}
}
}
}
</style>