123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- $(function(){
- loginStatus();
- valUser();
- istyle();
- var temp=[];
-
- $('.subUp').on("click", function() {
- var imglen = $(".uploader-list .thumbnail").length;
- if(imglen == 0) {
- $.MsgBox.Alert("消息提醒","请上传您身份证的正反面。");
- }else if(imglen > 3){
- $.MsgBox.Alert("消息提醒","最多上传3张照片。");
- }else{
- typeimg(temp);
- }
- })
-
-
- var uploader = WebUploader.create({
- auto: true,
- swf: 'webuploader/Uploader.swf',
- server: '../ajax/cachedFileUpload',
-
-
- pick: '#filePicker',
- duplicate :true ,
-
- accept: {
- title: 'Images',
- extensions: 'gif,jpg,jpeg,bmp,png',
- mimeTypes: 'image/*'
- }
- });
-
- uploader.on( 'fileQueued', function( file ) {
- var $li = $(
- '<div id="' + file.id + '" class="file-item thumbnail">' +
- '<img>' +
-
- '</div>'
- ),
- $btns = $('<div class="file-panel">' +
- '<span class="cancel">删除</span>' +
- '</div>').appendTo( $li ),
- $img = $li.find('img');
- var $list = $("#fileList");
- $list.prepend( $li );
-
-
-
- uploader.makeThumb( file, function( error, src ) {
- if ( error ) {
- $img.replaceWith('<span>不能预览</span>');
- return;
- }
- $img.attr( 'src', src );
- }, 1000, 1000 );
-
- $li.on( 'mouseenter', function() {
- $btns.stop().animate({height: 30});
- });
-
- $li.on( 'mouseleave', function() {
- $btns.stop().animate({height: 0});
- });
-
- });
-
- uploader.on( 'uploadSuccess', function(file,data) {
- var cacheImageKey =data.data[0].cacheKey;
- temp.push(cacheImageKey);
- })
-
-
- $("#fileList").on("click",".cancel",function(){
- $(this).parent().parent().remove();
- })
- })
- function istyle() {
- $.ajax("/ajax/professor/auth", {
- data: {
- "id": $.cookie("userid")
- },
- dataType: 'json',
- type: 'GET',
- timeout: 10000,
- async: false,
- success: function(data) {
-
- var $info = data.data || {};
- if(data.success && data.data) {
- authStatus = $info.authStatus;
-
- if(authStatus == -1) {
- $("#identBtn").show();
- $("#identProcess").text("很遗憾,您提交的材料没有通过认证,请更换符合要求的认证材料再试试。");
- $("#identProcess").css({"width":"350px"});
- $("#identBtn").text("重新认证");
- } else if(authStatus == 0) {
- $("#identBtn").show();
- $("#identProcess").text("您还未进行实名认证");
- $("#identBtn").text("开始认证");
- } else if(authStatus == 1) {
- $("#identProcess").text("认证信息提交成功!");
- $("#identts").text("我们将尽快对您的信息进行认证。");
- } else if(authStatus == 2) {
- $("#identProcess").text("我们正在对您的材料进行认证,请稍等片刻。");
- $("#identProcess").css({"width":"280px"});
- } else if(authStatus == 3) {
- $("#identProcess").text("恭喜您实名认证成功!");
- }
-
- if(authStatus == -1 || authStatus == 0){
- $("#identBtn").on("click",function(){
- $(".IdentityUp").show();
- $(".IdentityState").hide();
- })
- }
-
- }
- },
- error: function() {
- $.MsgBox.Alert('消息','服务器链接超时');
- }
- });
- }
- function typeimg(temp) {
- $.ajax("/ajax/authApply/realName", {
- data: {
- "professorId": $.cookie("userid"),
- "fns": temp
- },
- dataType: 'json',
- type: 'post',
-
- timeout: 10000,
- traditional:true,
- success: function(data) {
-
- if(data.success) {
- $(".IdentityUp").hide();
- $(".IdentityState").show();
- location.reload(true);
- }
- },
- error: function() {
- $.MsgBox.Alert('消息','服务器链接超时');
- }
- });
- }
|