发表于: 2017-01-16 01:53:13

1 1295


今天完成的事情:    

       1.完成了资料审核的图片上传功能;

       2.修改了后台审核资料了页面的显示布局;

  

明天计划的事情:

       1.完善前台页面之间跳转的逻辑;

       2.确定前台页面一些细节问题;


遇到的问题:  

       1.页面内有多个图片进行上传,上传后需要分别显示预览效果,需要动态的将返回的地址付给img


收获:

  •         1.使用了uploader上传后的状态也有很多;

  • FileItem.prototype._onSuccess = function(response, status, headers) {
                    this.isReady = false;//上传后就是false
                    this.isUploading = false;
                    this.isUploaded = true;
                    this.isSuccess = true;
                    this.isCancel = false;
                    this.isError = false;
                    this.progress = 100;
                    this.index = null;
                    this.onSuccess(response, status, headers); //没用,空函数
                };
  •         2.实例uploader对象(应该是用这个词》。。)

  • var uploader = $scope.uploader = new FileUploader({        url: 'http://localhost:8080/服务器',    });


     3.上传队列数量的限制

uploader.filters.push({ 

name: 'customFilter',        

fn: function(item, options) { 

return this.queue.length < 10;        

}    

});


       4.$http的简写写法中config的,虽然文档是这样写的,但是实际写的时候却没有效果,导致每次都是用的非简写写法。。。。。。

configobject

Object describing the request to be made and how it should be processed. The object has following properties:

  • method – {string} – HTTP method (e.g. 'GET', 'POST', etc)
  • url – {string|TrustedObject} – Absolute or relative URL of the resource that is being requested; or an object created by a call to $sce.trustAsResourceUrl(url).
  • params – {Object.<string|Object>} – Map of strings or objects which will be serialized with the paramSerializer and appended as GET parameters.
  • data – {string|Object} – Data to be sent as the request message data.
  • headers – {Object} – Map of strings or functions which return strings representing HTTP headers to send to the server. If the return value of a function is null, the header will not be sent. Functions accept a config object as an argument.
  • cache – {boolean|Object} – A boolean value or object created with $cacheFactory to enable or disable caching of the HTTP response. See $http Caching for more information.
  • timeout – {number|Promise} – timeout in milliseconds, or promise that should abort the request when resolved.


服务器地址



返回列表 返回列表
评论

    分享到