123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- $(document).ready(function() {
- loginStatus();
- var userid=$.cookie("userid");
- var demandId = GetQueryString("demandId");
- var pid = GetQueryString("pid");
- getDemandinfo();
- getPlatName();
- userFun();
- $(".showStatus").on('click',".meSendBack",function(){
- if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
- $(".questionCover").fadeIn();
- $("body").css("position", "fixed");
- } else {
- quickLog();
- operatTab();
- closeLog();
- }
- });
- $("#workclose,#preSte").on("click",function(){
- $("#queTit").val('');
- $(".questionCover").fadeOut();
- $("body").css("position", "");
- })
- $(".showStatus").on("click",".flexCenter",function(){
- location.href="userInforShow.html?professorId="+userid;
- })
- $("#pubSte").on("click",function(){
- if (!$('#queTit').val()) {
- $.MsgBox.Alert('提示', '留言不能为空')
- return;
- }
- replayDemand();
- })
- function getPlatName() {
- $.ajax({
- url: "/ajax/platform/info",
- type: "GET",
- timeout: 10000,
- dataType: "json",
- traditional:true,
- data:{
- id: pid
- },
- success: function(data) {
- if(data.success) {
- $('.platName').text(data.data.name);
- }
- },
- error: function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- })
- }
- function getDemandinfo(){
- $.ajax({
- "url": "/ajax/platform/demand/qo",
- "type": "GET",
- "data": {
- "id": demandId,
- "pid": pid,
- },
- "dataType": "json",
- "success": function(data) {
- console.log(data);
- if(data.success) {
- var $da=data.data;
- $("#demandTit").text($da.title);
- var thisNum="";
- thisNum+='<li><span>需求方:</span> <span>'+$da.linkOrg+'</span></li>';
- thisNum+='<li><span>发布时间:</span><span>'+commenTime($da.publishTime)+'</span></li>';
- $("#demandNum").prepend(thisNum);
- $("#demandDesp")[0].innerText=$da.descp;
- document.title = $da.title + "-科袖网";
- var strCon="";
- if($da.city){ strCon+='<li>所在城市:'+$da.city+'</li>' }
- if($da.duration){ strCon+='<li>预计周期:'+$da.duration+'</li>' }
- if($da.cost){ strCon+='<li>费用预算:'+$da.cost+'</li>' }
- if($da.invalidDay){ strCon+='<li>有效期至:'+TimeTr($da.invalidDay)+'</li>' }
- $(strCon).appendTo($("#demandInf"));
- }
- },
- 'error': function() {
- $.MsgBox.Alert('提示', '服务器连接超时!');
- }
- });
-
- }
- function replayDemand() {
- $.ajax({
- "url": "/ajax/platform/demand/reply",
- "type": "POST",
- "data": {
- "id": demandId,
- "pid": pid,
- "uid": userid,
- "descp": $('#queTit').val()
- },
- "dataType": "json",
- "success": function(data) {
- console.log(data);
- if(data.success) {
- $(".questionCover").fadeOut();
- $("body").css("position", "");
- $(".queStep").find("textarea").val("")
- $.MsgBox.Alert("提示","留言发布成功");
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- userFun();
- }
- },
- 'error': function() {
- $.MsgBox.Alert('提示', '服务器连接超时!');
- }
- })
- }
- function getProfessor(id,descp,timer) {
- $.ajax({
- "url": "/ajax/professor/baseInfo/"+id,
- "type": "get",
- "dataType": "json",
- "success": function(data) {
- if(data.success) {
- var $data=data.data;
- var img;
- var oClass = autho($data.authType, $data.orgAuth, $data.authStatus);
- var oTitle = "";
- if($data.title) {
- oTitle = $data.title;
- } else {
- if($data.office) {
- oTitle = $data.office;
- }
- }
- if($data.hasHeadImage==1) {
- img = "/images/head/" + $data.id + "_l.jpg";
- } else {
- img = "../images/default-photo.jpg"
- }
- var oSt = '<li>您已回复该需求</li>'
- oSt += '<li class="flexCenter" style="cursor:pointer" data-id="'+$data.id +'">'
- oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url(' + img + ');"></div>'
- oSt += '<div class = "madiaInfo" style="padding-right:0">'
- oSt += '<p class = "ellipsisSty">'
- oSt += '<span class = "h1Font" id="name">' + $data.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em >'
- oSt += '</p>'
- oSt += '<p class="h2Font ellipsisSty">' + oTitle + '</p>'
- oSt += '</div>'
- oSt += '</li>'
- oSt += '<li><span style="margin-right:10px;">留言:</span>'+descp+'<span style="float:right;">'+timer+'</span></li>'
- $(".showStatus").html(oSt);
- }
- },
- 'error': function() {
- $.MsgBox.Alert('提示', '服务器连接超时!');
- }
- })
- }
- function userFun() {
- $.ajax({
- "url": "/ajax/platform/demand/pro",
- "type": "get",
- "data": {
- "id":demandId ,
- "pid":pid,
- "uid":userid
- },
- "async": true,
- "datatype":"json",
- "success": function(data) {
- if(data.success) {
- console.log(data);
- if(data.data) {
- getProfessor(userid,data.data.descp,commenTime(data.data.assTime));
- $(".showStatus").addClass("showStatusY")
- } else {
- $(".showStatus").html('<input type="button" class="frmconbtn btnModel meSendBack" value="立即回复">')
- }
- }
- },
- "error": function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- });
-
- }
- })
|