portal html css js resource

platDemond.js 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. $(document).ready(function() {
  2. loginStatus(); //判断个人是否登录
  3. var userid=$.cookie("userid");
  4. var demandId = GetQueryString("demandId");
  5. var pid = GetQueryString("pid");
  6. getDemandinfo();
  7. getPlatName();
  8. userFun();
  9. $(".showStatus").on('click',".meSendBack",function(){
  10. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  11. $(".questionCover").fadeIn();
  12. $("body").css("position", "fixed");
  13. } else {
  14. quickLog();
  15. operatTab();
  16. closeLog();
  17. }
  18. });
  19. $("#workclose,#preSte").on("click",function(){
  20. $("#queTit").val('');
  21. $(".questionCover").fadeOut();
  22. $("body").css("position", "");
  23. })
  24. $(".showStatus").on("click",".flexCenter",function(){
  25. location.href="userInforShow.html?professorId="+userid;
  26. })
  27. $("#pubSte").on("click",function(){
  28. if (!$('#queTit').val()) {
  29. $.MsgBox.Alert('提示', '留言不能为空')
  30. return;
  31. }
  32. replayDemand();
  33. })
  34. function getPlatName() {
  35. $.ajax({
  36. url: "/ajax/platform/info",
  37. type: "GET",
  38. timeout: 10000,
  39. dataType: "json",
  40. traditional:true,
  41. data:{
  42. id: pid
  43. },
  44. success: function(data) {
  45. if(data.success) {
  46. $('.platName').text(data.data.name);
  47. }
  48. },
  49. error: function() {
  50. $.MsgBox.Alert('提示', '链接服务器超时')
  51. }
  52. })
  53. }
  54. function getDemandinfo(){
  55. $.ajax({
  56. "url": "/ajax/platform/demand/qo",
  57. "type": "GET",
  58. "data": {
  59. "id": demandId,
  60. "pid": pid,
  61. },
  62. "dataType": "json",
  63. "success": function(data) {
  64. console.log(data);
  65. if(data.success) {
  66. var $da=data.data;
  67. $("#demandTit").text($da.title); //名字
  68. var thisNum="";
  69. thisNum+='<li><span>需求方:</span> <span>'+$da.linkOrg+'</span></li>';
  70. thisNum+='<li><span>发布时间:</span><span>'+commenTime($da.publishTime)+'</span></li>';
  71. $("#demandNum").prepend(thisNum);
  72. $("#demandDesp")[0].innerText=$da.descp; //内容
  73. document.title = $da.title + "-科袖网";
  74. var strCon="";
  75. if($da.city){ strCon+='<li>所在城市:'+$da.city+'</li>' }
  76. if($da.duration){ strCon+='<li>预计周期:'+$da.duration+'</li>' }
  77. if($da.cost){ strCon+='<li>费用预算:'+$da.cost+'</li>' }
  78. if($da.invalidDay){ strCon+='<li>有效期至:'+TimeTr($da.invalidDay)+'</li>' }
  79. $(strCon).appendTo($("#demandInf"));
  80. }
  81. },
  82. 'error': function() {
  83. $.MsgBox.Alert('提示', '服务器连接超时!');
  84. }
  85. });
  86. }
  87. function replayDemand() {
  88. $.ajax({
  89. "url": "/ajax/platform/demand/reply",
  90. "type": "POST",
  91. "data": {
  92. "id": demandId,
  93. "pid": pid,
  94. "uid": userid,
  95. "descp": $('#queTit').val()
  96. },
  97. "dataType": "json",
  98. "success": function(data) {
  99. console.log(data);
  100. if(data.success) {
  101. $(".questionCover").fadeOut();
  102. $("body").css("position", "");
  103. $(".queStep").find("textarea").val("")
  104. $.MsgBox.Alert("提示","留言发布成功");
  105. $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
  106. userFun();
  107. }
  108. },
  109. 'error': function() {
  110. $.MsgBox.Alert('提示', '服务器连接超时!');
  111. }
  112. })
  113. }
  114. function getProfessor(id,descp,timer) {
  115. $.ajax({
  116. "url": "/ajax/professor/baseInfo/"+id,
  117. "type": "get",
  118. "dataType": "json",
  119. "success": function(data) {
  120. if(data.success) {
  121. var $data=data.data;
  122. var img;
  123. var oClass = autho($data.authType, $data.orgAuth, $data.authStatus);
  124. var oTitle = "";
  125. if($data.title) {
  126. oTitle = $data.title;
  127. } else {
  128. if($data.office) {
  129. oTitle = $data.office;
  130. }
  131. }
  132. if($data.hasHeadImage==1) {
  133. img = "/images/head/" + $data.id + "_l.jpg";
  134. } else {
  135. img = "../images/default-photo.jpg"
  136. }
  137. var oSt = '<li>您已回复该需求</li>'
  138. oSt += '<li class="flexCenter" style="cursor:pointer" data-id="'+$data.id +'">'
  139. oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url(' + img + ');"></div>'
  140. oSt += '<div class = "madiaInfo" style="padding-right:0">'
  141. oSt += '<p class = "ellipsisSty">'
  142. oSt += '<span class = "h1Font" id="name">' + $data.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em >'
  143. oSt += '</p>'
  144. oSt += '<p class="h2Font ellipsisSty">' + oTitle + '</p>'
  145. oSt += '</div>'
  146. oSt += '</li>'
  147. oSt += '<li><span style="margin-right:10px;">留言:</span>'+descp+'<span style="float:right;">'+timer+'</span></li>'
  148. $(".showStatus").html(oSt);
  149. }
  150. },
  151. 'error': function() {
  152. $.MsgBox.Alert('提示', '服务器连接超时!');
  153. }
  154. })
  155. }
  156. function userFun() {
  157. $.ajax({
  158. "url": "/ajax/platform/demand/pro",
  159. "type": "get",
  160. "data": {
  161. "id":demandId ,
  162. "pid":pid,
  163. "uid":userid
  164. },
  165. "async": true,
  166. "datatype":"json",
  167. "success": function(data) {
  168. if(data.success) {
  169. console.log(data);
  170. if(data.data) {
  171. getProfessor(userid,data.data.descp,commenTime(data.data.assTime));
  172. $(".showStatus").addClass("showStatusY")
  173. } else {
  174. $(".showStatus").html('<input type="button" class="frmconbtn btnModel meSendBack" value="立即回复">')
  175. }
  176. }
  177. },
  178. "error": function() {
  179. $.MsgBox.Alert('提示', '链接服务器超时')
  180. }
  181. });
  182. }
  183. })