diff --git a/application/views/responsive_fly/profile.php b/application/views/responsive_fly/profile.php index 98a7555df2772c5e74bf09717d5e7cbdb5c8f3e6..911b498aec2c6f3b533704e3e6ab83164bfeb389 100644 --- a/application/views/responsive_fly/profile.php +++ b/application/views/responsive_fly/profile.php @@ -287,7 +287,7 @@
-
+

请提交对应的身份证或者营业执照证件扫描(必须上传)

@@ -300,7 +300,7 @@
- +

其它证明材料,格式jpg,png,jpeg。(非必需)

@@ -463,7 +463,140 @@ var _posturl="{url user/ajaxvertify}"; ajaxpost(_posturl,data,success); } - + //图片大小验证 + window.verificationPicFile=function (file){ + + var fileSize = 0; + var fileMaxSize = 1024*3;//3M + var filePath = file.value; + if(filePath){ + fileSize =file.files[0].size; + var size = fileSize / 1024; + if (size > fileMaxSize) { + alert("文件大小不能大于3M!"); + file.value = ""; + return false; + }else if (size <= 0) { + alert("文件大小不能为0M!"); + file.value = ""; + return false; + } + }else{ + return false; + } + } + window.uploadvertify=function (file){ + + + if (file.files && file.files[0]) + { + verificationPicFile(file); + $(".upimgtip").html("图片上传中...."); + $("#upimgfile").attr("disabled","disabled"); + var type = "wangEditorMobileFile"; + var ischeck=0; + + var formData = new FormData(); + formData.append(type, $("#upimgfile")[0].files[0]); + formData.append("addimg",0); + + + $.ajax({ + type: "POST", + url: '{url attach/upimg}', + data: formData, + processData: false, + contentType: false, + //返回数据的格式 + datatype: "text",//"xml", "html", "script", "json", "jsonp", "text". + beforeSend: function () { + + + }, + success: function (data) { + $("#upimgfile").removeAttr("disabled"); + if(data.indexOf('error')==0){ + + alert(data.replace('error|','')); + return false; + }else{ + $("#vertify_img1").attr("src",data).removeClass("hide"); + } + + + + }, + complete: function () { + $(".upimgtip").html(""); + $("#upimgfile").removeAttr("disabled"); + + }, + //调用出错执行的函数 + error: function(){ + + $("#upimgfile").removeAttr("disabled"); + //请求出错处理 + alert("上传出错"); + } + }); + } + } + window.uploadvertify2=function (file){ + + + if (file.files && file.files[0]) + { + verificationPicFile(file); + $(".upimgtip2").html("图片上传中...."); + $("#upimgfile2").attr("disabled","disabled"); + var type = "wangEditorMobileFile"; + var ischeck=0; + + var formData = new FormData(); + formData.append(type, $("#upimgfile2")[0].files[0]); + formData.append("addimg",0); + + + $.ajax({ + type: "POST", + url: '{url attach/upimg}', + data: formData, + processData: false, + contentType: false, + //返回数据的格式 + datatype: "text",//"xml", "html", "script", "json", "jsonp", "text". + beforeSend: function () { + + + }, + success: function (data) { + $("#upimgfile2").removeAttr("disabled"); + if(data.indexOf('error')==0){ + + alert(data.replace('error|','')); + return false; + }else{ + $("#vertify_img2").attr("src",data).removeClass("hide"); + } + + + + }, + complete: function () { + $(".upimgtip2").html(""); + $("#upimgfile2").removeAttr("disabled"); + + }, + //调用出错执行的函数 + error: function(){ + + $("#upimgfile2").removeAttr("disabled"); + //请求出错处理 + alert("上传出错"); + } + }); + } + } //图片上传预览 IE是用了滤镜。 window.previewImage=function (file) {