<!-- 小弹窗 一行文字 -->
<template>
	<uni-popup ref="tipSmallPopup" :animation="false" :is-mask-click="false"
	 mask-background-color="rgba(255, 255, 255, 0.6);">
	 <view class="ezy-tip-dialog tip-small-dialog duihuan-dialog">
		<view class="tip-content-box">
			<view class="tip-title">{{title}}</view>
				<input class="duihuan-input" type="text" focus v-model="duihuamaValue" placeholder="请输入兑换码" />
				<view class="tip-btn-box">
					<view class="not-confirm-btn" @click="handleClose"></view>
					<view class="confirm-btn" @click="confirmBtn"></view>
				</view>
		</view>
	 </view>
	</uni-popup>
</template>

<script setup>
	import { ref } from 'vue';
	const props = defineProps({
	  title: {
	    type: String,
	    default: '提示'
	  },
	  content: {
	    type: String,
		require: true,
	    default: ''
	  },
	});
	const tipSmallPopup = ref(null); // 索引
	const duihuamaValue = ref(''); // 索引
	const $emit = defineEmits(['confirm-btn'])
	// 打开弹窗
	function handleShow() {
		tipSmallPopup.value.open();
	}
	// 取消
	function handleClose() {
		duihuamaValue.value = ''
		tipSmallPopup.value.close();
	}
	// 确认
	function confirmBtn(){
		$emit('confirm-btn',duihuamaValue.value);
		tipSmallPopup.value.close();
		duihuamaValue.value = ''
	}
	defineExpose({
			handleShow
		})
</script>

<style>
</style>