function upload(field){
	  iframeFileUpload({
	  url: url, // 后端 url
	  elementId: [field], // input表单的id数组集合
	   data: { // 发送到后端的data
		name: 'zym',
		blog: 'zymseo.com'
	 },
	success: function (data) {
		  	 				  
					 var src=data.path;									   
					if(data.status == 200){  											
						$("input[name='"+field+"']").val(data.id);						
						     var html = "<div class='upload-pre-item'><img src='" +data.path +"'> <span class='close' onclick='del(this,"+field+");'></span></div>";
						$("#"+field).parents(".form-item").find('.upload_preview').html(html);
					 
					  }
	},
	error: function (data) {
		
	}
});
	  
  }
 function del(obj,field){ //删除
            $(obj).parents(".upload-pre-item").remove();
		   $("input[name='"+field+"']").val('');	
} 
  
function uploads(field){
	  iframeFileUpload({
	  url: url, // 后端 url
	  elementId: [field], // input表单的id数组集合
	   data: { // 发送到后端的data
		name: 'zym',
		blog: 'zymseo.com'
	 },
	success: function (data) {
		  	 				  
					 var src=data.path;									   
					if(data.status == 200){  											
						$("input[name='"+field+"']").val(data.id);						
						  var html = "<div class='upload-pre-item'><img src='" +src +"' data-id="+data.id+"> <span class='close' onclick='delimage(this,"+field+");'></span></div>";
						  $("#"+field).parents(".form-item").find(".upload_preview").append(html);
						   setinput(field); 
					 
					  }
	},
	error: function (data) {
		
	}
      });
	  
  }
  
 function delimage(obj,field){ //删除
            $(obj).parents(".upload-pre-item").remove();
		    setinput(field);
}
 function setinput(field){ //取值
		    var option =$("#"+field).parents(".form-item").find(".upload_preview img");
		    var result=new Array();
		    option.each(function(i){
		 	     result.push($(this).attr('data-id'));
		    });
           var ids= result.join(',');
            $("input[name='"+field+"']").val(ids);
} 
  
 function uploadvideo(field){
	  iframeFileUpload({
	  url: url, // 后端 url
	  elementId: [field], // input表单的id数组集合
	   data: { // 发送到后端的data
		name: 'zym',
		blog: 'zymseo.com'
	 },
	success: function (data) {
		  	 				  
					 var src=data.path;									   
					if(data.status == 200){  											
						$("input[name='"+field+"']").val(data.id);	
					
						$("#"+field).parents(".form-item").find('video').attr("src",src);					
						
					 
					  }
	},
	error: function (data) {
		
	}
});
	  
  } 