index.vue
2.1 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
<!--
* @Date: 2022-11-23 14:41:53
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2024-03-14 13:58:09
* @FilePath: /data-table/src/components/ContactField/index.vue
* @Description: 联系我们控件
-->
<template>
<div v-if="HideShow" class="contact-field-page">
<van-popover v-model:show="showPopover" placement="left">
<div class="contact-content">
<div v-if="item.component_props.tel">
<div class="text-tel">电话联系</div>
<div>
<a
:style="{ color: styleColor.baseColor }"
:href="`tel:${item.component_props.tel}`"
>
{{ item.component_props.tel }}
</a>
</div>
</div>
<div v-if="item.component_props.image_url">
<div class="text-qr_code">微信联系</div>
<van-image width="100" height="100" :src="item.component_props.image_url" />
</div>
</div>
<template #reference>
<div class="wrapper">
<van-icon name="phone-o" size="2rem" :color="styleColor.baseColor" />
</div>
</template>
</van-popover>
</div>
</template>
<script setup>
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import { styleColor } from "@/constant.js";
const props = defineProps({
item: Object,
});
// 隐藏显示
const HideShow = computed(() => {
return !props.item.component_props.disabled
})
const showPopover = ref(false);
</script>
<style lang="less" scoped>
.contact-field-page {
position: fixed;
bottom: 10rem;
right: 0.5rem;
// height: 100%;
z-index: 9;
.wrapper {
background: white;
width: 3rem;
height: 3rem;
border-radius: 50%;
text-align: center;
box-shadow: 0rem -0.17rem 0.67rem 0.08rem rgba(0, 0, 0, 0.05);
:deep(.van-icon) {
line-height: 1.5;
}
}
}
.contact-content {
padding: 1rem 0.85rem;
text-align: center;
.text-tel {
color: gray;
font-size: 0.9rem;
margin-bottom: 0.5rem;
}
.text-qr_code {
color: gray;
font-size: 0.9rem;
margin-bottom: 0.5rem;
margin-top: 0.5rem;
}
}
</style>