123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862 |
- $(function() {
- loginStatus();
- $(document).scroll(function() {
- var top = $(document).scrollTop();
- if(top != 0) {
- $(".searchbox").fadeIn(1000);
- } else {
- $(".searchbox").fadeOut(1000);
- }
- });
- var newc = GetQueryString("lookFor");
- if(newc == 0 || newc == "") {
- var c = 0;
- } else {
- var c = 1;
-
- $("#div_select").text("找资源");
- }
-
- * var lookFor2 = 0; $("#lookFor2 ul li").on("click",function(){
- * lookFor2=$(this).index(); }); //enter绑定时间
- * $("#searchContent").keydown(function(e){ if(e.which==13) { synContent(2);
- * synContent(1); var searchContent = $("#searchContent").val(); if(lookFor2 =
- * 1){ $("#div_select").text("找资源"); location.href =
- * "search.html?searchContent=" + encodeURI(searchContent); } }
- * })
- */
- var userid = $.cookie("userid");
- var subject;
- var subb = $.trim(GetQueryString("subject"));
- var industry;
- var pageSize;
- var sub = "SUBJECT";
- var indu = "INDUSTRY";
- var address = $("#address .colorbg")[0].title;
- $("#searchContent").val(GetQueryString("searchContent"));
- $("#hsearchContent").val(GetQueryString("searchContent"));
- var key = $("#searchContent").val();
- var getData = function(key, subject, industry, pageSize, pageNo, isbind,
- add) {
- if(c == 0) {
- $
- .ajax({
- "url": "/ajax/professor/pqBaseInfo",
- "type": "GET",
- "data": {
- "key": key,
- "subject": subject,
- "industry": industry,
- "pageSize": pageSize,
- "pageNo": pageNo,
- "address": add
- },
- "contentType": "application/x-www-form-urlencoded",
- "success": function($data) {
- if($data.success) {
-
- $("#professorList").html("");
- for(var i = 0; i < $data.data.data.length; i++) {
-
- var dataHtml = "<div class='item'>";
- dataHtml += "<a class='infoi' href='information-brow.html?professorId=" +
- $data.data.data[i].id +
- "' ><div class='photo1 userRadius'>"
- if($data.data.data[i].hasHeadImage) {
- dataHtml += "<img class='images' style='width:100%;' src='/images/head/" +
- $data.data.data[i].id +
- "_l.jpg'/></div></a>";
- } else {
- dataHtml += "<img class='images' style='width:100%;' src='/images/default-photo.jpg'/></div></a>";
- }
- dataHtml += "<div class='synopsis'>";
- dataHtml += "<a href='javascript:void();' class='named'>";
- if(typeof($data.data.data[i].name) !== "undefined") {
- dataHtml += $data.data.data[i].name;
- }
- dataHtml += "</a><a href='information-brow.html?professorId=" +
- $data.data.data[i].id +
- "' class='authiconNew'></a>";
- dataHtml += "<div class='position'>";
- if($data.data.data[i].office) {
- dataHtml += $data.data.data[i].office +
- ", ";
- }
- if($data.data.data[i].title) {
- dataHtml += $data.data.data[i].title +
- ", ";
- }
- if($data.data.data[i].department) {
- dataHtml += $data.data.data[i].department +
- ", ";
- }
- if($data.data.data[i].orgName) {
- dataHtml += $data.data.data[i].orgName;
- }
- if($data.data.data[i].address) {
- dataHtml += " | " +
- $data.data.data[i].address;
- }
- dataHtml += "</div>";
- dataHtml += "<div class='ellipsisbox science'>";
- if(typeof($data.data.data[i].subject) !== "undefined") {
- dataHtml += "<p>学术领域:" +
- $data.data.data[i].subject +
- "</p>";
- }
- dataHtml += "</div>";
- dataHtml += "<div class='ellipsisbox industry'>";
- if(typeof($data.data.data[i].industry) !== "undefined") {
- dataHtml += "<p>应用行业:" +
- $data.data.data[i].industry +
- "</p>";
- }
-
- if($data.data.data[i].researchAreas.length) {
- dataHtml += "<p>研究方向:"
- for(var m = 0; m < $data.data.data[i].researchAreas.length; m++) {
- dataHtml += $data.data.data[i].researchAreas[m].caption;
- if(m<$data.data.data[i].researchAreas.length-1){
- dataHtml += " , "
- }
- }
- dataHtml += "</p>";
- }
-
- dataHtml += "</div>";
- dataHtml += "</div>";
- if($data.data.data[i].id != userid) {
- dataHtml += "<div class='operbox'><span class='operbtn onlyConsultbtn' id='" +
- $data.data.data[i]['id'] +
- "'>咨询</span></div>";
- }
- var $datahtml = $(dataHtml);
- $("#professorList").append(dataHtml);
- var photoHeight = $(".photo1").eq(i).height();
- var middleHeight = $(".synopsis").eq(i).height();
- if(middleHeight < photoHeight) {
- $(".synopsis").eq(i).height(photoHeight);
- }
-
- var oSty=autho($data.data.data[i].authType,$data.data.data[i].orgAuth,$data.data.data[i].authStatus);
- $(".authiconNew").eq(i).addClass(oSty.sty);
- $(".authiconNew").eq(i).attr("title",oSty.title);
-
- (function(i) {
- $('.synopsis')
- .eq(i)
- .click(
- function() {
- location.href = 'information-brow.html?professorId=' +
- $data.data.data[i].id;
- })
- }
- )(i);
- }
-
- $(".onlyConsultbtn").bind("click", clickSeachProConsultHandler);
- if(isbind == true) {
- $(".tcdPageCode").createPage({
- pageCount: Math.ceil($data.data.total / pageSize),
- current: $data.data.pageNo,
- backFn: function(p) {
- getData(key, subject, industry, pageSize, p, false);
- }
- });
- }
- } else {
- $.MsgBox.Alert("message", $data.msg);
- }
- }
- });
- } else {
-
- $.ajax({
- "url": "/ajax/resource/pq",
- "type": "get",
- "data": {
- "key": key,
- "subject": subject,
- "industry": industry,
- "pageSize": pageSize,
- "pageNo": pageNo,
- "address": add
- },
- "contentType": "application/x-www-form-urlencoded",
- "success": function(data) {
-
- if(data.success) {
- $("#professorList").html("");
- var $da = data.data.data;
- for(var i = 0; i < $da.length; i++) {
- var add = '<div class="item"><div class="remess" resourceId=' + $da[i].resourceId + '>'
- add += '<div class="clearfix"><a class="resourcephoto headRadius" ><div class="ResImgBox" style="background:#ffffff;"><img class="resImg headRadius resourceImg" src="" /></div></a>'
- add += '<div class="synopsis" style="width:66%;">'
- add += '<div class="cousultName"><a class="resouname" href="javascript:void();">' + $da[i].resourceName + '</a></div>'
-
- var oStyT=autho($da[i].editProfessor.authType,$da[i].editProfessor.orgAuth,$da[i].editProfessor.authStatus);
- if($da[i].editProfessor.name) {
- add += '<div class="belongname"><a style="float:left;display:block;">' + $da[i].editProfessor.name + '</a><a class="authiconNew '+ oStyT.sty+'" title="'+ oStyT.title +'"></a></div>'
- }
- if($da[i].editProfessor.title == undefined) {
- $da[i].editProfessor.title = "";
- }
- if($da[i].editProfessor.department == undefined) {
- $da[i].editProfessor.department = "";
- }
- if($da[i].editProfessor.orgName == undefined) {
- $da[i].editProfessor.orgName = "";
- }
- add += '<div style="clear:both"></div><div class="positionbox">'
- if($da[i].editProfessor.title && $da[i].editProfessor.department && $da[i].editProfessor.orgName) {
- add += $da[i].editProfessor.title + "," + $da[i].editProfessor.department + "," + $da[i].editProfessor.orgName;
- } else if(!$da[i].editProfessor.title && $da[i].editProfessor.department && $da[i].editProfessor.orgName) {
- add += $da[i].editProfessor.department + "," + $da[i].editProfessor.orgName;
- } else if($da[i].editProfessor.title && !$da[i].editProfessor.department && $da[i].editProfessor.orgName) {
- add += $da[i].editProfessor.title + "," + $da[i].editProfessor.orgName;
- } else if($da[i].editProfessor.title && $da[i].editProfessor.department && !$da[i].editProfessor.orgName) {
- add += $da[i].editProfessor.title + "," + $da[i].editProfessor.department;
- } else if(!$da[i].editProfessor.title && !$da[i].editProfessor.department && $da[i].editProfessor.orgName) {
- add += $da[i].editProfessor.orgName
- } else if(!$da[i].editProfessor.title && $da[i].editProfessor.department && !$da[i].editProfessor.orgName) {
- add += $da[i].editProfessor.department
- } else if($da[i].editProfessor.title && !$da[i].editProfessor.department && !$da[i].editProfessor.orgName) {
- add += $da[i].editProfessor.title
- }
- add += '</div>'
- if($da[i].subject) {
- add += '<div class="ellipsisbox sciencebox"><p>学术领域:' + $da[i].subject + '</p></div>'
- }
- if($da[i].industry) {
- add += '<div class="ellipsisbox industrybox"><p>应用行业:' + $da[i].industry + '</p></div>'
- }
- if($da[i].supportedServices) {
- add += '<div class="ellipsisbox provideservice"><p>应用用途:' + $da[i].supportedServices + '</p></div></div>'
- }
- add += "</div>"
- if(userid == $da[i]["editProfessor"]["id"]) {
- add += '<div class="operbox"><span class="operbtn consultbtn" id="' + $da[i]["editProfessor"]["id"] + '" style="display:none;">咨询</span><span style="display: none;" class="operbtn applybtn appl" resourceId=' + $da[i].resourceId + ' resourceName=' + $da[i].resourceName + ' editProfessor=' + $da[i].editProfessor.name + '>申请</span></div>'
- } else {
- add += '<div class="operbox"><span class="operbtn consultbtn" id="' + $da[i]["editProfessor"]["id"] + '">咨询</span><span style="display: none;" class="operbtn applybtn appl" resourceId=' + $da[i].resourceId + ' resourceName=' + $da[i].resourceName + ' editProfessor=' + $da[i].editProfessor.name + '>申请</span></div>'
- }
- add += '</div></div>'
- var $add = $(add);
- $("#professorList").append($add);
-
- if(data.data.data[i].images.length) {
- $add.find(".resourceImg").attr("src", "/images/resource/" + $da[i].resourceId + ".jpg");
- } else {
- $add.find(".resourceImg").attr("src", "/images/default-resource.jpg");
- }
- }
- if(isbind == true) {
- $(".tcdPageCode").createPage({
- pageCount: Math.ceil(data.data.total / pageSize),
- current: data.data.pageNo,
- backFn: function(p) {
- getData(key, subject, industry, pageSize, p, false);
- }
- });
- }
- } else {
- $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
- $("#mb_btn_ok").val("去登录");
- }
-
-
- },
- });
- }
- }
- $(".about").on("click", '.consultbtn', function(e) {
- e.stopPropagation();
- e.cancelBubble = true;
- clickResouceConsultHandler($(this), $(this).attr('id'));
- });
- var subjectList = function() {
- $.get("../ajax/dataDict/qaDictCode", {
- dictCode: "SUBJECT"
- }, function(data) {
- if(data.success) {
-
-
- $(".andmore").eq(0).hide();
- }*/
- $("#subject").find(".sub").remove();
- for(var i = 0; i < data.data.length; i++) {
- $("#subject").append(
- "<a href='#' class='sub'title='" +
- data.data[i].caption + "'>" +
- data.data[i].caption + "</a>");
- if(subb) {
- if(subb == data.data[i].caption) {
- $('.sub').eq(i).addClass('colorbg').siblings()
- .removeClass("colorbg");
- }
- }
- if(i > 20)
- break;
- }
- } else {
- $.MsgBox.Alert("message", data.msg);
- }
- })
- }
- var Address = function() {
- $.get("../ajax/dataDict/qaCity", {
- dictCode: "ADDRESS"
- }, function(data) {
- if(data.success) {
- $("#address").empty();
- $("#address").prepend('<a href="#" class="colorbg no3" title="">不限</a>');
-
- $(".andmore").eq(2).hide();
- }*/
- for(var i = 0; i < data.data.length; i++) {
- $("#address").append(
- "<a href='#' title='" + data.data[i].caption + "'>" +
- data.data[i].caption + "</a>");
- if(i > 20)
- break;
- }
- } else {
- $.MsgBox.Alert("message", data.msg);
- }
- })
- }
- var industryList = function() {
- $.get("../ajax/dataDict/qaDictCode", {
- dictCode: "INDUSTRY"
- }, function(data) {
-
- if(data.success) {
-
- $(".andmore").eq(1).hide();
- }*/
- $("#industry").find(".indu").remove();
- for(var i = 0; i < data.data.length; i++) {
- $("#industry").append(
- "<a href='#' class='indu'title='" +
- data.data[i].caption + "'>" +
- data.data[i].caption + "</a>");
- if(i > 20)
- break;
- }
- } else {
- $.MsgBox.Alert("message", data.msg);
- }
- })
- }
- var findProfessor = function() {
- if(subb) {
- subject = subb;
- } else {
- subject = $("#subject .colorbg")[0].title;
- }
- industry = $("#industry .colorbg")[0].title;
- pageSize = 10;
- getData(key, subject, industry, pageSize, 1, true, address);
- }
-
- $("#searchContent").keydown(function(e) {
- if(e.which == 13) {
- synContent(2);
- key = $("#searchContent").val();
- $("#professorList").remove();
- $(".aboutpro").append(
- '<div class="about-in" id="professorList"></div>')
- $(".tcdPageCode").remove();
- $(".aboutpro").append('<div class="tcdPageCode"></div>');
- getData(key, subject, industry, 10, 1, true, address);
- }
- })
- $("#hsearchContent").keydown(function(e) {
- if(e.which == 13) {
- synContent(1);
- key = $("#searchContent").val();
- $("#professorList").remove();
- $(".aboutpro").append(
- '<div class="about-in" id="professorList"></div>')
- $(".tcdPageCode").remove();
- $(".aboutpro").append('<div class="tcdPageCode"></div>');
- getData(key, subject, industry, 10, 1, true, address);
- }
- })
- $("#search1").on(
- "click",
- function() {
- $("#hsearchContent").val($("#searchContent").val());
- key = $("#searchContent").val();
- $("#professorList").remove();
- $(".aboutpro").append(
- '<div class="about-in" id="professorList"></div>')
- $(".tcdPageCode").remove();
- $(".aboutpro").append('<div class="tcdPageCode"></div>');
- getData(key, subject, industry, 10, 1, true, address);
- })
- $("#hsearch").on(
- "click",
- function() {
- $("#searchContent").val($("#hsearchContent").val());
- key = $("#hsearchContent").val();
- location.href = "javascript:;";
- $("#professorList").remove();
- $(".aboutpro").append(
- '<div class="about-in" id="professorList"></div>')
- $(".tcdPageCode").remove();
- $(".aboutpro").append('<div class="tcdPageCode"></div>');
- getData(key, subject, industry, 10, 1, true, address);
- })
- subjectList();
- industryList();
- findProfessor();
- Address();
- $(".class1").eq(0).on(
- "click",
- "a",
- function() {
- $(this).addClass("colorbg").siblings().removeClass("colorbg");
- key = $("#searchContent").val();
- subject = $(this).attr('title');
- $("#professorList").remove();
- $(".aboutpro").append(
- '<div class="about-in" id="professorList"></div>')
- $(".tcdPageCode").remove();
- $(".aboutpro").append('<div class="tcdPageCode"></div>');
- getData(key, subject, industry, 10, 1, true, address);
- });
- $(".class1").eq(1).on(
- "click",
- "a",
- function() {
- $(this).addClass("colorbg").siblings().removeClass("colorbg");
- industry = $(this).attr('title');
- key = $("#searchContent").val();
- $("#professorList").remove();
- $(".aboutpro").append(
- '<div class="about-in" id="professorList"></div>')
- $(".tcdPageCode").remove();
- $(".aboutpro").append('<div class="tcdPageCode"></div>');
- getData(key, subject, industry, 10, 1, true, address);
- });
- $(".class1").eq(2).on(
- "click",
- "a",
- function() {
- $(this).addClass("colorbg").siblings().removeClass("colorbg");
- address = $(this).attr('title');
- key = $("#searchContent").val();
- $("#professorList").remove();
- $(".aboutpro").append(
- '<div class="about-in" id="professorList"></div>')
- $(".tcdPageCode").remove();
- $(".aboutpro").append('<div class="tcdPageCode"></div>');
- getData(key, subject, industry, 10, 1, true, address);
- });
-
- var listi = 0;
- $(".andmore").click(function() {
- $(this).find(".updown").css("background-position", "left");
- $(this).parent().css("height", "48px");
- if(listi % 2 == 0) {
- } else {
- $(this).find(".updown").css("background-position", "right");
- $(this).parent().css("height", "auto");
- }
- listi++;
- })
-
- $(".class1").on("click", "a", function() {
- $(this).addClass("colorbg").siblings().removeClass("colorbg");
- })
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $(".lishow li").on(
- "click",
- function() {
- c = $(this).index();
- $("#industry").find(".no2").addClass("colorbg").siblings()
- .removeClass("colorbg");
- $("#subject").find(".nox").addClass("colorbg").siblings()
- .removeClass("colorbg");
- key = $("#searchContent").val();
- industry = "";
- subject = "";
- address = "";
- if(c == 0) {
- sub = "SUBJECT";
- indu = "INDUSTRY";
- } else {
- sub = "SUBJECT";
- indu = "INDUSTRY";
- }
- industryList();
- subjectList();
- Address();
- $("#professorList").remove();
- $(".aboutpro").append(
- '<div class="about-in" id="professorList"></div>')
- $(".tcdPageCode").remove();
- $(".aboutpro").append('<div class="tcdPageCode"></div>');
- getData(key, subject, industry, pageSize, 1, true, address);
- });
-
- $('.about')
- .on(
- "click",
- '.remess',
- function() {
- var resourceID = $(this).attr("resourceId");
- location.href = "resourceInfo.html?resourceId=" + resourceID;
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- })
-
- function getIdentity(professorId) {
- $
- .ajax({
- "url": "ajax/professor/" + professorId,
- "type": "get",
- "async": false,
- "success": function(data) {
- if(data.success) {
- $(".frmtype option")[0].value = data.data.name;
- $(".frmtype option")[1].value = data.data.organization.name;
- } else {
- $.MsgBox.Alert("消息提醒", "系统异常!");
- }
- },
- "error": function() {
- $.MsgBox.Alert('message', 'failddd')
- }
- })
- }
- function replaceStr(s) {
- var pattern = new RegExp("-");
- var rs = "";
- for(var i = 0; i < s.length; i++) {
- rs = rs + s.substr(i, 1).replace(pattern, '');
- }
- return rs;
- }
- $('.aboutpro')
- .on(
- "click",
- '.appl',
- function() {
- ResourceApply();
- $(".limitBox").removeClass("limitBox");
- $(".limitwords").removeClass("limitwords");
- $(".limitwordbox").removeClass("limitwordbox");
-
- var myDate = new Date();
- var nowYear = myDate.getFullYear();
- var nowMonth = myDate.getMonth() + 1;
- var nowDate = myDate.getDate();
- if(nowMonth < 10) {
- nowMonth = "0" + nowMonth.toString();
- }
- if(nowDate < 10) {
- nowDate = "0" + nowDate.toString();
- }
- var now = nowYear + "-" + nowMonth + "-" + nowDate;
- $("#datepicker").val(now);
- $("#datepicker").datepicker({
- "dateFormat": " yy-mm-dd"
- });
- $(".timelo").css("display", "none");
- var resName = $(this).attr("resourcename");
- var name = $(this).attr("professor");
- var resourceID = $(this).attr("resourceId");
- $
- .ajax({
- "url": "/ajax/resource/" + resourceID,
- "type": "get",
- "async": false,
- "success": function(info) {
- if(info.success) {
- if(info.data.images.length) {
- $(".resouImage").attr(
- "src",
- "/images/resource/" +
- resourceID +
- ".jpg");
- } else {
- $(".resouImage")
- .attr("src",
- "/images/default-resource.jpg");
- }
- }
- }
- })
- $(".namecon").text(name);
- $(".applysure").hide();
- $(".btnboxup").hide();
- $(".log").text(resName);
- getIdentity(userid);
- $("#deliver")
- .on(
- "click",
- function() {
- var $data = {};
- $data.demandId = userid;
- $data.resourceId = resourceID;
- $data.detailDemand = $(".detail")
- .val();
-
- $data.deliverTime = replaceStr($
- .trim($(".dealTime").val()));
- $data.operationStatus = 1;
- $data.applysquare = $(
- ".frmtype option:selected")
- .val();
- $
- .ajax({
- "url": "/ajax/operation",
- "type": "POST",
- "success": function(
- rdata) {
- if(rdata.success) {
- $.MsgBox
- .Alert(
- '消息提醒',
- '资源"' +
- resName +
- '"申请发送成功!');
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- $(".blackcover")
- .remove();
- $("body")
- .css(
- "position",
- "");
-
- } else {
- $.MsgBox
- .Alert(
- '消息提醒',
- '资源"' +
- resName +
- '"申请发送失败,请重新申请!');
- }
- },
- "data": $data,
- "beforeSend": function() { },
- "contentType": "application/x-www-form-urlencoded",
- dataType: "json"
- });
- });
- });
-
- function clickSeachProConsultHandler() {
- if(userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
- var professorId = $(this).attr("id");
- ConsultApply();
-
- $("#sendConsultBtn").click(function() {
- sendConsultHandler($(this).attr("proId"))
- });
- concultProInfo(professorId);
- } else {
- $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
- $("#mb_btn_ok").val("去登录");
- var aele = document.createElement('a');
- $("#mb_btnbox").append(aele);
- $("#mb_btnbox a").css({
- 'display': "block",
- 'width': '100%',
- 'height': '40px',
- 'position': 'absolute',
- 'bottom': '-6px',
- 'left': '0'
- });
- aele.setAttribute('href', '../login.html');
- }
- };
-
- function clickResouceConsultHandler(obj, professorId) {
- if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
-
- ConsultApply();
-
- for(var i = 0; i < $("ul.menucon").children().length; i++) {
- $("ul.menucon").children().eq(i).removeClass("clicknow");
- $("ul.menucon").children().eq(1).addClass("clicknow");
- }
- var item = obj.parent().parent().parent();
- var consultTitleVal = item.find(".resouname").text();
- $("#consultTitle").val("关于" + consultTitleVal + "的咨询");
-
- $("#sendConsultBtn").click(function() {
- sendConsultHandler($(this).attr("proId"));
- });
- concultProInfo(professorId);
- } else {
- $.MsgBox.Alert("消息提醒", "请先登录再进行咨询");
- $("#mb_btn_ok").val("去登录");
- var aele = document.createElement('a');
- $("#mb_btnbox").append(aele);
- $("#mb_btnbox a").css({
- 'display': "block",
- 'width': '100%',
- 'height': '40px',
- 'position': 'absolute',
- 'bottom': '-6px',
- 'left': '0'
- });
- aele.setAttribute('href', '../login.html');
- }
- };
-
- var professorId = $(this).attr("proId");
- var consult_type = $(".clicknow").text();//咨询类型
- var consult_title = $("#consultTitle").val();//咨询主题
- var consult_content = $("#consultcontent").val();//咨询内容
- var consultStr = {
- "consultType":consult_type,
- "consultTitle":consult_title,
- "consultContant":consult_content,
- "professorId":professorId,
- "consultantId":userid
- };
-
- if(consult_type == '' || consult_title == '' || consult_content == ''){
- $.MsgBox.Alert("message","请填写完整");
- };
- if(consult_type == ''){
- $.MsgBox.Alert("消息","请选择联系目的");
- }
- if(consult_title == ''){
- $.MsgBox.Alert("消息","请填写咨询目的");
- }
- if(consult_content == ''){
- $.MsgBox.Alert("消息","请填写咨询内容");
- }
-
- if(userid && userid != null && userid != "null" && consult_type != '' &&
- consult_title != '' && consult_content != ''
- ){
-
- $.ajax({
- "url" :"/ajax/consult",
- "type" : "post",
- //传值:咨询类型、主题、内容、专家id、申请人id
- "data" : consultStr,
- "contentType" : "application/x-www-form-urlencoded",
- "dataType" : "json",
- "success" : function(response) {
- consultId = response.data;//咨询id
-
-
- },
- "error":function (){
- $.MsgBox.Alert("消息","咨询申请失败");
- },
-
- "complete":function(){
- //$(".consultapply").remove();
- $(".blackcover").remove();
- $("body").css("position","");
- $.MsgBox.Alert("消息","咨询申请成功");
- },
- });
- }
- }*/
- });
|