chooseImage 回调success,fail,complete怎么不执行呢?
发布于 5 年前 作者 shenyong 1344 次浏览 来自 问答
  chooseImage: function (e{
    var that = this;
    wx.chooseImage({
        sizeType: ['original''compressed'], // 可以指定是原图还是压缩图,默认二者都有
        sourceType: ['album''camera'], // 可以指定来源是相册还是相机,默认二者都有
        successfunction (res{
            // 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
            console.log('选择的图片是:'+that.data.files);
            that.setData({
                files: that.data.files.concat(res.tempFilePaths)
            });
            console.log('选择的图片是:'+that.data.files);
        },
        fail:function(){
            console.log('错误!');
        },
        complete:function(){
            console.log('对错都执行!');
        }
    })
}

 苹果机
2 回复

你好,麻烦具体描述问题流程,提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

回到顶部