Commit 9ecb1ed1 authored by zhangkaixuan11's avatar zhangkaixuan11

图片上传修改下

parent ef987fbb
......@@ -9,6 +9,7 @@ import Sound from 'react-native-sound';
import RNFS from 'react-native-fs';
import Api from '../../../Api';
import ImagePicker from 'react-native-image-crop-picker';
import DocumentPicker from 'react-native-document-picker';
import Icon from 'react-native-vector-icons/AntDesign';
import SoundScreen from './vudioCom'
......@@ -504,9 +505,22 @@ export default class Index extends Component {
try {
let res;
if (type == 'image') {
res = await DocumentPicker.pick({
type: [DocumentPicker.types.images,],
});
// res = await DocumentPicker.pick({
// type: [DocumentPicker.types.images,],
// });
res = await ImagePicker.openPicker({
cropping: false,
multiple: true,
maxFiles: 1,
loadingLabelText: "正在获取图片",
compressImageQuality: 0.6,
forceJpg: true,
mediaType: 'photo',
cropperToolbarTitle: "裁剪",
// cropperChooseText: "hello"
})
console.log(res,'2323232')
return;
} else {
res = await DocumentPicker.pick({
type: [DocumentPicker.types.doc, DocumentPicker.types.docx, DocumentPicker.types.pdf, DocumentPicker.types.ppt,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment