KfModal.vue
3.27 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
<template>
<van-overlay :show="show">
<div class="wrapper" @click.self="cancel">
<div :class="['kf-box flex', { short: !detail.customerServiceQrImg }]">
<div class="sprite-icon icon-kf-box"></div>
<div class="sprite-icon icon-kf-logo x-center"></div>
<div class="info">
<div class="name">{{ detail.customerServiceName }}</div>
<template v-if="detail.customerServicePhone">
<div class="phone flex" @click="makePhoneCall(detail.customerServicePhone)">
<div class="sprite-icon icon-phone"></div>
{{ detail.customerServicePhone }}
</div>
</template>
</div>
<template v-if="detail.customerServiceQrImg">
<div class="qr-box">
<div class="sprite-icon icon-qr"></div>
<img :src="detail.customerServiceQrImg" class="qr xy-center" />
</div>
<div class="bottom flex">
<div class="item flex">
<div class="sprite-icon icon-download"></div>
<div>
保存图片
<br />
到相册
</div>
</div>
<div class="item flex">
<div class="sprite-icon icon-scan"></div>
<div>
打开微信扫一扫
<br />
添加客服企微
</div>
</div>
</div>
</template>
</div>
</div>
</van-overlay>
</template>
<script type="text/ecmascript-6">
export default {
name: 'KfModal',
props: ['value', 'detail'],
data () {
return {
show: false,
img: null
}
},
mounted () { },
watch: {
value (n) {
this.show = n
}
},
methods: {
cancel () {
this.show = false
this.$parent.showKf = false
},
save () {
this.showToast('请长按二维码保存')
}
}
}
</script>
<style scoped lang="scss">
.van-overlay {
z-index: 3;
}
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
flex-direction: column;
.kf-box {
width: 300px;
height: 350px;
position: relative;
flex-direction: column;
font-size: 18px;
font-weight: 500;
color: #282829;
.icon-kf-box {
position: absolute;
}
.icon-kf-logo {
top: -15px;
}
.info {
position: relative;
z-index: 2;
text-align: center;
padding-top: 64px;
.phone {
letter-spacing: 2px;
margin-top: 1px;
}
}
.qr-box {
position: relative;
width: 143px;
height: 142px;
margin: 10px 0 16px;
.qr {
width: calc(100% - 32px);
height: calc(100% - 32px);
}
}
.bottom {
position: absolute;
left: 0;
bottom: 0;
z-index: 2;
width: 100%;
height: 70px;
background: #f7f8fa;
border-radius: 0px 0px 10px 10px;
box-sizing: border-box;
padding: 0 20px;
justify-content: space-between;
.item {
padding-left: 7px;
font-size: 12px;
color: #b1b1b3;
.sprite-icon {
margin-right: 6px;
}
}
}
}
.short {
height: 140px;
.icon-kf-box {
height: 100%;
border-radius: 12px;
}
}
}
</style>