鬼天气
鬼天气
  • 发布:2020-07-03 13:48
  • 更新:2020-07-03 13:48
  • 阅读:2594

【报Bug】uni.chooseImage({count:a-b, 动态设置count在苹果真机失效

分类:uni-app

没有积分,先这样发吧,

uni.chooseImage({
count: (this.imgCountTotal - this.imgCount), //动态值,默认6,总限制6
苹果真机(版本13.5.1;型号iPhone XR;号码MT192CH/A)中,第2次选图开始,count:设置无效,可以选择9张图片,导致出现7/6的情况出现,苹果系统版本如附件图,(安卓真机和模拟器均正常)

第1次选择时,count:设置的6是生效的,选图界面提示不能超过6,第1+n次选择时,选图界面就变成了默认的9张了,

上传面板用的colorui的表单例子中的上传面板,个人认为实际应该和colorui无关,和uni.chooseImage兼容性、跨平台有关,

imgCountTotal: 6,  //总限制6张图片  
imgCount: 0,         //当前已传张数  

ChooseImage() {  
                console.log("this.imgCountTotal - this.imgCount = " + (this.imgCountTotal - this.imgCount));  
                uni.chooseImage({  
                    count: (this.imgCountTotal - this.imgCount), //总限制6  
                    sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有  
                    sourceType: ['album'], //从相册选择  
                    success: (res) => {  
                        let tempArr = res.tempFilePaths;  
                        let filePaths = tempArr; //简单迭代  
                        for (let i = 0; i < filePaths.length; i++) {  
                            let filePath = filePaths[i];  
                            this.imgCount += 1;   
                            // http上传  
                        }  
                    }  
                });  
            },  

DelImg(e) {  
                this.imgList.splice(e.currentTarget.dataset.index, 1);  
                this.imgServerArr.splice(e.currentTarget.dataset.index, 1);  
                this.imgCount -= 1;  
            },
0 关注 分享

要回复文章请先登录注册