Files
vpUni/.svn/pristine/6e/6e5afada3d17dc9c35e370c6d39d8176b7258728.svn-base
2026-03-09 16:39:03 +08:00

49 lines
1.1 KiB
Plaintext

<template>
<view>
<view class="" v-if="props.show">
<!-- <qf-image-cropper :src="props.url" :width="props.width" :height="props.height" :radius="20"
@crop="handleCrop"></qf-image-cropper> -->
<Tcropper :imageUrl="props.url" :width="props.width" :height="props.height" :radius="20" @confirm='handleCrop' ></Tcropper>
</view>
</view>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue';
import { onBeforeUnmount, onMounted, reactive } from 'vue';
import Tcropper from "../uni_modules/t-cropper/components/t-cropper/t-cropper.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(() => {
});
const handleCrop = (e) => {
let arr = e.tempFilePath.split('.')
let name = arr[arr.length - 1]
Service.uploadH5(e.tempFilePath, name ,(data:any)=>{
props.retFun( {name:props.imgName,url:data})
})
}
</script>
<style>
</style>