`
wx.chooseMedia({
count: 9,
mediaType: ['image','video'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
}).then(res=>{
let filePath=res.tempFiles[0].tempFilePath;
wx.cloud.uploadFile({
// 指定上传到的云路径
cloudPath: 'my-photo.png',
// 指定要上传的文件的小程序临时文件路径
filePath: filePath,
// 成功回调
}).then(res=>{
console.log('上传成功', res)
})
}).catch(err=>{
console.log(res,"失败")
})