<template>
	<view class="task_complete_tips_overlay" v-if="visible" @click.stop>
		<!-- 遮罩层 -->
		<view class="mask_overlay"></view>
		
		<!-- 弹窗内容 -->
		<view class="task_complete_tips_container">
			<!-- 第一行：标题文字 -->
			<text class="tips_title">完成{{ taskTitle }}任务</text>
			
			<!-- 第二行：积分文字 -->
			<text class="points_text">获得{{ points }}积分</text>
			
			<!-- 第三行：图片 -->
			<image class="task_complete_icon" :src="$baseUrl + `integral/1023/jifenIcon1.png`" mode="aspectFit" />
			
			<!-- 第四行：开心收下按钮 -->
			<view class="accept_button" @click="handleAccept">
				<text class="accept_button_text">开心收下</text>
			</view>
			
			<!-- 第五行：关闭按钮 -->
			<view class="close_button" @click="handleClose">
				<text class="close_icon">×</text>
			</view>
		</view>
	</view>
</template>

<script setup>
import { defineProps, defineEmits } from 'vue';

// Props 定义
const props = defineProps({
	visible: {
		type: Boolean,
		default: false
	},
	points: {
		type: Number,
		default: 100
	},
	taskTitle: {
		type: String,
		default: 'xxx'
	}
});

// Emits 定义
const emit = defineEmits(['close', 'accept']);

// 关闭弹窗
const handleClose = () => {
	emit('close');
};

// 开心收下按钮点击
const handleAccept = () => {
	emit('accept');
	emit('close');
};
</script>

<style lang="less" scoped>
@import '@/components/renwu/TaskCompleteTips.less';
</style>
