index.vue
935 Bytes
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
<template>
<view class="container phoneCon">
<uni-popup ref="popup" type="bottom" class="popupBox">
<view class="popup-content">
<view>{{ phoneData }}</view>
<view @click="call">呼叫</view>
</view>
<view @click="closePopup" class="closePopup">取消</view>
</uni-popup>
</view>
</template>
<script setup>
import {ref} from "vue";
import {call} from "@/utils/index.js";
// 获取父组件数据
const props = defineProps({
// 是否触发管理按钮
phoneData: {
type: String,
default: "",
},
});
const popup = ref();
// //TODO 电话号码拨打
// const call = () =>{
// // 暂时关闭打电话
// // call(this.phoneData)
// }
// // 打开弹层
const dialogOpen = () => {
popup.value.open();
};
// 关闭弹层
const closePopup = () => {
popup.value.close();
};
// //把数据、方法暴漏给父组件
defineExpose({ dialogOpen });
</script>