|
@ -218,6 +218,16 @@ export default { |
|
|
maxDuration: 60, |
|
|
maxDuration: 60, |
|
|
camera: "back", |
|
|
camera: "back", |
|
|
success: async (res) => { |
|
|
success: async (res) => { |
|
|
|
|
|
// 添加文件大小检查 |
|
|
|
|
|
const files = res.tempFiles; |
|
|
|
|
|
// 检查每个文件的大小 |
|
|
|
|
|
const oversizeFiles = files.filter( |
|
|
|
|
|
(file) => file.size > 10 * 1024 * 1024 |
|
|
|
|
|
); |
|
|
|
|
|
if (oversizeFiles.length > 0) { |
|
|
|
|
|
this.$u.toast("请选择10MB以内大小的图片/视频!"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
uni.showLoading({ title: "上传中...", mask: true }); |
|
|
uni.showLoading({ title: "上传中...", mask: true }); |
|
|
try { |
|
|
try { |
|
|
const files = res.tempFiles; |
|
|
const files = res.tempFiles; |
|
|