第一次上传
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
<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" @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 { 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>
|
||||
Reference in New Issue
Block a user