9***@qq.com
9***@qq.com
  • 发布:2025-05-21 13:53
  • 更新:2025-05-21 13:53
  • 阅读:19

【报Bug】调用uni.chooseImage方法时无法弹窗相册窗口,但是调用uni.chooseVideo没问题

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 19043.928

HBuilderX类型: 正式

HBuilderX版本号: 4.66

浏览器平台: 微信内置浏览器

项目创建方式: HBuilderX

示例代码:

uni.chooseImage({
count: this.imageCount, //默认9
//sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album', 'camera'], //从相册选择
success: (res) => {
var data = res.tempFiles[0];
let index = data.name.lastIndexOf(".");
//获取后缀
let jpgUrl = data.name.substr(index + 1);
if (jpgUrl != "png" && jpgUrl != "jpg" && jpgUrl != "jpeg") {
uni.showToast({
icon: "none",
title: "上传图片格式不符合规范,应为png、jpg或jpeg格式!",
duration: 2500
}); return;
}
const MAX_SIZE = 9 - this.imgList.length;
this.imgList = this.imgList.concat(res.tempFilePaths.slice(0, MAX_SIZE).map((
it, i) => ({
path: res.tempFilePaths[i],
file: res.tempFiles[i],
fileId: fileId++,
})))
console.log(" this.imgList:", this.imgList)
this.uploadImages()
},
fail: (err) => {

                    }});  

操作步骤:

点击选择文件,无法弹出相册窗口

预期结果:

应该能弹出

实际结果:

没有弹出来

bug描述:

调用uni.chooseImage方法时无法弹窗相册窗口,但是调用uni.chooseVideo没问题,华为鸿蒙系统,5.0.1

2025-05-21 13:53 负责人:无 分享
已邀请:

要回复问题请先登录注册