<template>
	<view>
		<view class="" v-if="props.show">
			<qf-image-cropper :src="props.url" :width="props.width" :height="props.height" :radius="0"
				@crop="handleCrop"></qf-image-cropper>
		</view>

	</view>
</template>

<script setup lang="ts">
	import { ref, watch } from 'vue';
	import { onBeforeUnmount, onMounted, reactive } from 'vue';
	import { Service } from '@/Service/Service';
	// const props = defineProps({
	// 	show : string,
	// 	// url : string,
	// 	// width : number,
	// 	// height:number,
	// 	// upType:string,
	// 	// retFun:Function
	// });


	let props = defineProps(["show", "url", 'width', 'height', 'upType', "retFun", "imgName"]);

	onMounted(() => {
		console.log(props);
	})


	const handleCrop = (e) => {
		Service.uploadH5(e.tempFilePath, 'Avatar', rest => {
			props.retFun({  url: JSON.parse(rest).data.path })
		})
	}
</script>

<style>

</style>