|
// 点击选择图片
$('#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));
}
});
}
});
})
点击能打开相册,相机,但是回调没有执行,测试也打印不出来,大老帮忙看看什么错误
|
|