1***@qq.com
1***@qq.com
  • 发布:2021-10-25 14:03
  • 更新:2021-10-25 17:14
  • 阅读:393

【报Bug】ios-safari浏览器、uc浏览器等无法使用uni.chooseImage选择照片

分类:uni-app

产品分类: uniapp/H5

PC开发环境操作系统: Mac

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

HBuilderX类型: 正式

HBuilderX版本号: 3.2.9

浏览器平台: 手机系统浏览器

浏览器版本: 未知

项目创建方式: HBuilderX

操作步骤:

直接使用uni.chooseImage

预期结果:

可以像安卓系统一样正常使用

实际结果:

无法使用

bug描述:

无法使用图片选择,也没有任何反应

2021-10-25 14:03 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

未复现此问题。请提供您设备的详细信息
用示例代码hello uni-app能出现你的问题吗?

  • 1***@qq.com (作者)

    所有的ios都有问题

    // 选择图片

    async chooseImg() {

    await this.getQNImgUrl()

    let { image_url, token, upload_url } = this.QNInfo

    let { fromUser } = this

    uni.chooseImage({

    count: 1,

    sizeType: ['compressed'],

    sourceType: ['album', 'camera'],

    success: async (res)=> {

    const { tempFiles } = res

    uni.showLoading({

    title: '发送中...'

    })

    for(let file of tempFiles) {

    const suffix = file.name.substr(file.name.lastIndexOf(".") + 1)

    uni.uploadFile({

    url: upload_url,

    filePath: file.path,

    name: 'file',

    formData: {

    'key': shop/${(new Date).getTime()}.${suffix},

    'token': token

    },

    success: (uploadFileRes) => {

    let path = image_url + JSON.parse(uploadFileRes.data).key

    console.log(path)

    // 发送图片

    this.fitOnMsg('image', path, fromUser)

    },

    complete: ()=> {

    uni.hideLoading()

    }

    })

    }

    setTimeout(()=> {

    uni.showLoading({

    complete: () => {

    uni.hideLoading()

    }

    })

    }, 1500)

    },

    fail: (res)=> {

    console.log('调用相机失败')

    }

    })

    },

    2021-10-26 09:16

该问题目前已经被锁定, 无法添加新回复