portal html css js resource

index.js 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. $(function(){
  2. loginStatus();//判断个人是否登录
  3. //加载页面时,判断企业账号是否登录
  4. var orgid = $.cookie('orgId');
  5. $("#cmpSettled").on("click",function(){
  6. if (orgid && orgid != "null" && orgid != null) {
  7. location.href="cmp-portal/cmp-workspaces.html"
  8. }else{
  9. location.href="cmp-portal/cmp-settled-reg.html"
  10. }
  11. })
  12. $("#gocmp").on("click",function(){
  13. if (orgid && orgid != "null" && orgid != null) {
  14. location.href="cmp-portal/cmp-workspaces.html"
  15. }else{
  16. location.href="cmp-portal/cmp-settled-log.html"
  17. }
  18. })
  19. /*发布需求*/
  20. $("#postNow").click(function(){
  21. if(userid=="null"||userid==undefined){
  22. location.href="login.html";
  23. }
  24. $.ajax({
  25. url: "/ajax/professor/auth",
  26. type: "GET",
  27. timeout: 10000,
  28. dataType: "json",
  29. data: {
  30. "id": userid,
  31. },
  32. success: function(data, textState) {
  33. if(data.success) {
  34. var $rta=data.data;
  35. if($rta.authStatus==3){
  36. location.href="myDemand.html";
  37. }else{
  38. location.href="realname-authentication.html"
  39. }
  40. }
  41. },
  42. error: function(XMLHttpRequest, textStats, errorThrown) {
  43. }
  44. })
  45. })
  46. /*我是专家*/
  47. $("#JoinKeXiu").click(function(){
  48. if(userid=="null"||userid==undefined){
  49. location.href="login.html";
  50. }
  51. $.ajax({
  52. url: "/ajax/professor/auth",
  53. type: "GET",
  54. timeout: 10000,
  55. dataType: "json",
  56. data: {
  57. "id": userid,
  58. },
  59. success: function(data, textState) {
  60. if(data.success) {
  61. var $rta=data.data;
  62. if($rta.authType==1){
  63. location.href="needList.html";
  64. }else{
  65. location.href="expert-authentication.html"
  66. }
  67. }
  68. },
  69. error: function(XMLHttpRequest, textStats, errorThrown) {
  70. }
  71. })
  72. })
  73. //热门领域
  74. $(".field").bind("click",function(){
  75. location.href = "search.html?subject=" + encodeURI($(this).text());
  76. })
  77. //热门专家
  78. $('.professor').hover(function() {
  79. $(this).find(".professor-data").stop(true, false).animate({
  80. "padding": "94px 0",
  81. "top": "-50px"
  82. })
  83. }, function() {
  84. $(this).find(".professor-data").stop(true, false).animate({
  85. "padding": "25px 0",
  86. "top": "58%"
  87. })
  88. })
  89. })