|
- api.getPicture({
- sourceType: 'album',
- encodingType: 'jpg',
- mediaValue: 'pic',
- targetWidth: 160,
- targetHeight: 160
- }, function(ret, err){
- if (ret) {
- api.showProgress({modal: true});
- $api.post(uploadFace,{values:{uid:$api.getStorage('uid')},files:{face:ret.data}},function(ret){
- api.hideProgress();
- if (ret.status == 'error'){
- api.toast({msg: ret.tip});
- } else {
- var url = webUrl+ret.picurl;
- api.download({
- url: url,
- savePath: 'fs://face.jpg',
- report: true,
- cache: true,
- allowResume:true
- },function(ret,err){
- if (ret) {
- api.hideProgress();
- } else {
- api.toast({msg: err.msg});
- };
- });
-
- api.toast({msg: ret.tip});
- }
- },'json');
- }
- });
复制代码
配合api.getPicture使用试试,我的项目是2个搭配使用出现的bug |
|