帖子
帖子
用户
博客
课程
显示全部楼层
6
帖子
0
勋章
20
Y币

[插件开发] getPicture回调不执行

[复制链接]
发表于 2019-10-7 14:26:00
// 点击选择图片
                $('#addimg').on('click', function() {
                                api.actionSheet({
                                        cancelTitle: '取消',
                                        buttons: ['相机', '相册']
                                }, function(ret, err) {
                                        if (ret.buttonIndex != 3) {
                                                var _sourceType = ""
                                                if (ret.buttonIndex == 1) {
                                                        _sourceType = 'camera';
                                                } else {
                                                        _sourceType = 'library';
                                                }
                                                api.getPicture({
                                                    sourceType: _sourceType,
                                                    encodingType: 'jpg',
                                                    mediaValue: 'pic',
                                                    destinationType: 'url',
                                                    allowEdit: true,
                                                    quality: 50,
                                                    targetWidth: 750,
                                                    targetHeight: 750,
                                                    saveToPhotoAlbum: false
                                                }, function(ret, err){
                                                    console.log('测试');
                                                    if(ret){
                                                         console.log(JSON.stringify(ret));
                                                    }else{
                                                         console.log(JSON.stringify(err));
                                                    }
                                                });
                                        }
                                });
                })



点击能打开相册,相机,但是回调没有执行,测试也打印不出来,大老帮忙看看什么错误

6
帖子
0
勋章
20
Y币
求大神讲解
20
帖子
0
勋章
6613
Y币
您需要登录后才可以回帖 登录

本版积分规则