var server="http://demo.dcloud.net.cn/helloh5/uploader/upload.php"; var files=[]; // 上传文件 function upload(){ if(files.length<=0){ plus.nativeUI.alert("没有添加上传文件!"); return; } outSet("开始上传:") var wt=plus.nativeUI.showWaiting(); var task=plus.uploader.createUpload(server, {method:"POST"}, function(t,status){ //上传完成 if(status==200){ outLine("上传成功:"+t.responseText); plus.storage.setItem("uploader",t.responseText); var w=plus.webview.create("uploader_ret.html","uploader_ret.html",{scrollIndicator:'none',scalable:false}); w.addEventListener("loaded",function(){ wt.close(); w.show("slide-in-right",300); },false); }else{ outLine("上传失败:"+status); wt.close(); } } ); task.addData("client","HelloH5+"); task.addData("uid",getUid()); for(var i=0;i