<template>
	<uni-popup ref="commonPopup" :type="type" :animation="false" :is-mask-click="false" mask-background-color="rgba(0, 0, 0, 0.4)" background-color="#fff">
		<slot></slot>
	</uni-popup>
</template>

<script setup>
	import {
		reactive,
		ref
	} from 'vue';
	import {
		getJiazhengZhiye
	} from "@/api/jiazheng.js"


	const props = defineProps({
		type: {
			type: String,
			default: 'bottom'
		},
		title: {
			type: String,
			default: ''
		},
		content: {
			type: String,
			require: true,
			default: ''
		},
		dialogContentClass: {
			type: String,
			require: true,
			default: 'content-center-class'
		},
		okBtn: {
			type: String,
			require: true,
			default: '保存'
		},
		showBtn: {
			type: Boolean,
			default: true
		}
	});
	const commonPopup = ref(null); // 索引
	const $emit = defineEmits(['confirm-btn'])


	// 打开弹窗
	function handleShow() {
		commonPopup.value.open();
	}
	// 取消
	function handleClose() {
		commonPopup.value.close();
	}
	// 确认
	function confirmBtn() {
		$emit('confirm-btn');
		commonPopup.value.close();
	}

	defineExpose({
		handleShow,
		handleClose
	})
</script>

<style>
</style>