123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306 |
- $(function() {
- loginStatus();
- valUser();
- isexpert();
- var temp = [];
- var temp2 = [];
-
- $('.webupArea').on("click", ".expertSubmit", function() {
- var imglen = $("#fileList2 .thumbnail").length;
- if(imglen == 0) {
- $.MsgBox.Alert("消息提醒", "请上传能够证明您身份的相关证件,如工作证、在职证明、学生证、在读证明等");
- } else if(imglen > 5) {
- $.MsgBox.Alert("消息提醒", "最多上传5张照片。");
- } else {
- $.MsgBox.Confirm("消息提醒", "确认提交实名信息?一旦审核通过后,将不可更改。", function() {
- expertimg(temp2);
- });
- }
- })
-
- $('.webupArea').on("click", ".realnameSubmit", function() {
- var imglen = $("#fileList2 .thumbnail").length;
- var imglen2 = $("#fileList .thumbnail").length;
- if(imglen2 == 0) {
- $.MsgBox.Alert("消息提醒", "请上传您身份证的正反面。");
- } else if(imglen2 > 3) {
- $.MsgBox.Alert("消息提醒", "最多上传3张照片。");
- } else if(imglen == 0) {
- $.MsgBox.Alert("消息提醒", "请上传能够证明您身份的相关证件,如工作证、在职证明、学生证、在读证明等");
- } else if(imglen > 5) {
- $.MsgBox.Alert("消息提醒", "最多上传5张照片。");
- } else {
- $.MsgBox.Confirm("消息提醒", "确认提交实名信息?一旦审核通过后,将不可更改。", function() {
- realnameimg(temp)
- expertimg(temp2);
- });
- }
- })
- expertuploader();
- realnameuploader();
-
- function realnameuploader() {
-
- 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) {
- $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 expertuploader() {
- var uploader2 = WebUploader.create({
- auto: true,
- swf: 'webuploader/Uploader.swf',
- server: '../ajax/cachedFileUpload',
-
-
- pick: '#filePicker2',
- duplicate: true,
-
- accept: {
- title: 'Images',
- extensions: 'gif,jpg,jpeg,bmp,png',
- mimeTypes: 'image/*'
- }
- });
-
- uploader2.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 $list2 = $("#fileList2");
- $list2.prepend($li);
-
-
-
- uploader2.makeThumb(file, function(error, src) {
- $img.attr('src', src);
- }, 1000, 1000);
- $li.on('mouseenter', function() {
- $btns.stop().animate({
- height: 30
- });
- });
- $li.on('mouseleave', function() {
- $btns.stop().animate({
- height: 0
- });
- });
- });
-
- uploader2.on('uploadSuccess', function(file, data) {
- var cacheImageKey = data.data[0].cacheKey;
- temp2.push(cacheImageKey);
- })
-
- $("#fileList2").on("click", ".cancel", function() {
- $(this).parent().parent().remove();
- })
- }
- })
- function isexpert() {
- $.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) {
- authStatusExpert = $info.authStatusExpert;
- authStatus = $info.authStatus;
-
- if(authStatusExpert == -1) {
- $("#identProcess").text("很遗憾,您没有通过认证。");
- $("#identts").text("请更换符合要求的认证材料再试试。");
- $("#identBtn").show().text("重新认证");
- } else if(authStatusExpert == 0) {
- $("#identProcess").text("成为科袖认证专家用户,与企业开展合作,将您的科研价值变现!");
- $("#identProcess").css({
- "width": "300px"
- });
- $("#identBtn").show().text("开始认证");
- } else if(authStatusExpert == 1) {
- $("#identProcess").text("认证信息提交成功!");
- $("#identts").text("我们将尽快对您的信息进行认证,通过后您将成为科袖认证专家,获得特殊功能权限!");
- } else if(authStatusExpert == 2) {
- $("#identProcess").text("我们正在对您的材料进行认证,请稍等片刻。");
- $("#identProcess").css({
- "width": "280px"
- });
- } else if(authStatusExpert == 3) {
- $("#identProcess").text("恭喜您已成为科袖认证专家!");
- $("#identts").text("在【我的工作台】可以查看发布中的需求,与企业展开合作,将科研价值变现。");
- $("#identBtn").show().text("进入[我的工作台]");
- $("#identBtn").on("click", function() {
- window.location.href = "workspaces.html";
- })
- }
- if(authStatus == 3) {
- if(authStatusExpert == -1 || authStatusExpert == 0) {
- $("#identBtn").on("click", function() {
- $(".IdentityState,.realname").hide();
- $(".IdentityUp").show();
- $(".subUp").addClass("expertSubmit");
- })
- }
- } else if(authStatus == -1 || authStatus == 0) {
- if(authStatusExpert == -1 || authStatusExpert == 0) {
- $("#identBtn").on("click", function() {
- $(".IdentityState").hide();
- $(".IdentityUp").show();
- $(".subUp").addClass("realnameSubmit");
- })
- }
- } else if(authStatus == 1 || authStatus == 2) {
- $("#identBtn").hide();
- $("#identProcess").text("我们正在对您的材料进行认证,请稍等片刻。");
- $("#identProcess").css({
- "width": "280px"
- });
- }
- }
- },
- error: function() {
- $.MsgBox.Alert('消息', '服务器链接超时');
- return;
- }
- });
- }
- function expertimg(temp) {
- $.ajax("/ajax/authApply/expert", {
- data: {
- "professorId": $.cookie("userid"),
- "fns": temp
- },
- dataType: 'json',
- type: 'post',
- async: false,
- timeout: 10000,
- traditional: true,
- success: function(data) {
-
- if(data.success) {
- $(".IdentityUp").hide();
- $(".IdentityState").show();
- location.reload(true);
- }
- },
- error: function() {
- $.MsgBox.Alert('消息', '服务器链接超时');
- }
- });
- }
- function realnameimg(temp2) {
- $.ajax("/ajax/authApply/realName", {
- data: {
- "professorId": $.cookie("userid"),
- "fns": temp2
- },
- dataType: 'json',
- type: 'post',
- async: false,
- timeout: 10000,
- traditional: true,
- success: function(data) {
-
- if(data.success) {
- $(".IdentityUp").hide();
- $(".IdentityState").show();
- location.reload(true);
- }
- },
- error: function() {
- $.MsgBox.Alert('消息', '服务器链接超时');
- }
- });
- }
|