function selectPic(){ plus.gallery.pick( function(path){ plus.nativeUI.showWaiting(); plus.nativeUI.toast('开始上传'); var uper = plus.uploader.createUpload( "上传地址", {method:'POST'}, function(t,status){ console.log('1111') var ter= JSON.parse(t.responseText); console.log(ter) console.log(JSON.stringify(ter)) /* console.log(JSON.stringify(t)) console.log(JSON.stringify(t)) */ if(t.error="success"){ var str='<div style="float:left;margin-right:10px"><img class="grzx_dq_rzsc" src="'+ter.url+'" />'; str+='<input type="hidden" value="'+ter.id+'" name="imgs[]"/></div>'; $('#appendbefor').before(str); }else{ cf_msg('上传失败');return false; } console.log(t.responseText); console.log(status); plus.nativeUI.closeWaiting(); } ); uper.addFile(path, {key:"test"}); uper.start(); }, function (e){ cf_msg('取消选择图片'); console.log( "取消选择图片" ); }, {filter:"image"} ); }