56 lines
1.3 KiB
Plaintext
56 lines
1.3 KiB
Plaintext
<template>
|
|
<view>
|
|
<view class="" v-if="props.show">
|
|
<!-- <qfImageCropperVue :src="props.url" :width="props.width" :height="props.height" :radius="20"
|
|
@crop="handleCrop"></qfImageCropperVue> -->
|
|
<Tcropper :imageUrl="props.url" :width="props.width" @cancel="cancel" :height="props.height" :radius="0"
|
|
@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 qfImageCropperVue from '@/uni_modules/qf-image-cropper/components/qf-image-cropper/qf-image-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 })
|
|
})
|
|
}
|
|
const cancel = () => {
|
|
console.log(11111);
|
|
uni.$emit('cancle')
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style> |