j***@linkingcloud.cn
j***@linkingcloud.cn
  • 发布:2023-05-15 11:49
  • 更新:2023-05-15 13:19
  • 阅读:680

【报Bug】企业微信嵌套的h5,使用的uni.chooseImage方法,在IOS14 pro上访问无法唤起手机相册或者照相机,手机单独访问h5能正常唤起

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Windows

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

HBuilderX类型: 正式

HBuilderX版本号: 3.7.11

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

浏览器版本:

项目创建方式: HBuilderX

示例代码:

this.chooseImage('camera');

chooseImage(type) {
if(this.isDisabledAll){
uni.showToast({
title: '会话已超时,无法发送图片',
icon: 'none'
});
return false;
}
uni.chooseImage({
count: 10, //默认9
sizeType: ['compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: [type],
success: res => {
let fileMaxNum = 9 // 图片最大上传数量
let filterFileName = ['image/png', 'image/PNG', 'image/jpg', 'image/JPG', 'image/gif', 'image/GIF', 'image/jpeg', 'image/JPEG'] // 需要的文件格式
let whetherHasErrorPic = res.tempFiles.some(i => filterFileName.indexOf(i.type) == -1) // 是否存在不需要的文件格式
if (res.tempFiles.length > fileMaxNum) {
uni.showToast({
icon: 'none',
title: 图片数量不能超过${fileMaxNum}张!,
duration: 2500
});
return;
}
if (whetherHasErrorPic) {
uni.showToast({
icon: 'none',
title: '选择的文件格式不正确,请重新选择!',
duration: 2500
});
return;
}
}
});
},

操作步骤:

企业微信嵌套的h5,使用的uni.chooseImage方法。
在IOS14 pro上访问无法唤起手机相册或者照相机。

预期结果:

企业微信嵌套的h5,使用的uni.chooseImage方法。
在IOS14 pro上访问正常唤起手机相册或者照相机。

实际结果:

企业微信嵌套的h5,使用的uni.chooseImage方法。
在IOS14 pro上访问无法唤起手机相册或者照相机。

bug描述:

企业微信嵌套的h5,使用的uni.chooseImage方法。
在IOS14 pro上访问无法唤起手机相册或者照相机。
部分手机IOS型号在企业微信里面也能正常唤起。
手机单独访问h5能正常唤起,其他环境均能正常唤起,微信环境等均能唤起。
bug如下视频附件

2023-05-15 11:49 负责人:无 分享
已邀请:
Diligent_UI

Diligent_UI - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

uni.chooseImage可能有兼容问题,试试这个插件:https://ext.dcloud.net.cn/plugin?id=12401

要回复问题请先登录注册