zoukankan      html  css  js  c++  java
  • mui 的多图片上传

        pickHead(){
          var _this = this;
          plus.gallery.pick(function(path){
            _this.headImage=path;
            var files = [{name:"imgUpload",path:path}]
            var wt=plus.nativeUI.showWaiting();
            var task=plus.uploader.createUpload(url,{method:"POST"},
              function(t,status){
                console.log(t.responseText)
                wt.close();
                if(status==200){
                  var r = JSON.parse( t.responseText );
                  if(r.code==200){
                    _this.userInfor.headImage = r.data;
                  }else{
                    return
                  }
                }else{
                  mui.toast('网络请求失败!')
                }
              }
            );
            task.addData("client","plus");
            task.addData("uid",Math.floor( Math.random()*100000000+10000000).toString());
            for(var i=0;i<files.length;i++){
              var f=files[i];
              task.addFile(f.path,{key:f.name});
            }
            task.start();
     
          }, function(e){
            mui.toast('取消选择图片');
          }, {filter:'image'});
        }
  • 相关阅读:
    第十次作业
    java第九次作业
    优秀的计算机编程类博客 和 文章
    SQLAlchemy使用总结
    Go Web
    beego
    项目注意事项
    爬虫
    Linux笔记
    计算机英语
  • 原文地址:https://www.cnblogs.com/yuanxinru321/p/9396947.html
Copyright © 2011-2022 走看看