portal html css js resource

userInforShow.js 81KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304
  1. $(function() {
  2. loginStatus();//判断个人是否登录
  3. var userid = $.cookie("userid");
  4. var professorId = GetQueryString("professorId");
  5. if(GetQueryString("flag")) {
  6. researchAlert(GetQueryString("flag"))
  7. }
  8. function researchAlert(cap){
  9. $.ajax({
  10. url: "/ajax/researchAreaLog/ql",
  11. dataType: 'json', //数据格式类型
  12. type: 'GET', //http请求类型
  13. timeout: 10000, //超时设置
  14. data: {
  15. "professorId": professorId,
  16. 'caption': cap,
  17. "rows": 1000
  18. },
  19. success: function(data) {
  20. console.log(data)
  21. if(data.success) {
  22. $("#areaCon").html("");
  23. var $info = data.data;
  24. $("#subArea").text(cap);
  25. $(".resAreaCover").fadeIn();
  26. $(".resAreaTip").addClass("displayNone")
  27. $(".resAreaCon").show()
  28. if($info.length == 0) {
  29. $(".resAreaCon").hide();
  30. $(".resAreaTip").removeClass("displayNone")
  31. return;
  32. }
  33. for(var i = 0; i < $info.length; i++) {
  34. var liItem = document.createElement("li");
  35. document.getElementById("areaCon").appendChild(liItem);
  36. detailPro($info[i],liItem);
  37. }
  38. $("body").css("position", "fixed");
  39. }
  40. },
  41. error: function() {}
  42. });
  43. }
  44. if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
  45. location.href="http://" + window.location.host + "/e/p.html?id="+professorId;
  46. }
  47. var oArray=[];
  48. var watchType=1;
  49. var QTime,QId,ATime,AId,WTime,WId,rows= 2;
  50. if(professorId) {
  51. getUserInfo(professorId);//获取个人详细信息
  52. //historyEvaluate();//获取历史合作及评价
  53. getResource(10,1,true);//获取个人发布的资源
  54. getArticle(10,1,true);//获取个人发布的文章
  55. getPaper(10,1,true);//获取个人发布的论文
  56. getPatent(10,1,true);//获取个人发布的专利
  57. getDemands(5,1,true);//获取个人发布的需求
  58. attentCount();
  59. collAttent(10,1,true);
  60. getMyAnswer(professorId,true);//获取个人的回答
  61. if(userid!=professorId){
  62. liulanAdd();
  63. relevantExperts();//合作专家
  64. relevantarticalList();//相关文章
  65. likeExperts();//感兴趣专家
  66. information();
  67. ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
  68. $(".goSpan").show();
  69. $(".moreBuUl li.attentType").hide();
  70. $(".moreBuUl li.attendMy").addClass("liNow").text("关注他的人");
  71. $("#item8user>.coninfobox").eq(9).show().siblings().hide();
  72. watchType=0;
  73. attentMy();
  74. }else{
  75. getMyQuestion(userid,true);//获取个人的提问
  76. $(".goSpanTo").show();
  77. $(".myoneself").show();
  78. }
  79. $(document).bind("click",function(e){
  80. var target = $(e.target);
  81. if(target.closest(".moreBuUl>li.rightbtn").length == 0){
  82. $(".table-drop").hide();
  83. }
  84. })
  85. $(".navconBox").on("click","li",function(){
  86. $(this).addClass("liNow").siblings().removeClass("liNow");
  87. $(".leftconBox .leftconItem").eq($(".navconBox li").index(this)).show().siblings().hide();
  88. })
  89. $(".navconBox>.mainNavUl").on("click","li:not('.rightbtn')",function(){
  90. $(".moreNav").hide();
  91. })
  92. $(".navconBox>.mainNavUl").on("click","li.wenda",function(){//问答
  93. if(userid === professorId) {
  94. $(".wendaNav").show();
  95. }else{
  96. $("#item6user .coninfobox").eq(0).addClass("displayNone").siblings().removeClass("displayNone");
  97. }
  98. })
  99. $(".navconBox>.mainNavUl").on("click","li.rightbtn",function(){//更多
  100. $(".moreBu").show();
  101. $(".wendaNav").hide();
  102. })
  103. $(".wendaUl").on("click","li",function(){//获取关注对象类型标志
  104. console.log($(".wendaUl li").index(this))
  105. $("#item6user>.coninfobox").eq($(".wendaUl li").index(this)).show().siblings().hide();
  106. })
  107. $(".moreBuUl").on("click","li:not('.rightbtn')",function(){//获取关注对象类型标志
  108. $("#item8user").find(".js-load-more").unbind();
  109. $("#item8user").find(".js-load-more").remove();
  110. $("#item8user").find("ul").each(function () {
  111. $(this).html("");
  112. });
  113. watchType=$(this).attr("data-num");
  114. console.log($(".moreBuUl li:not('.rightbtn')").index(this))
  115. $("#item8user>.coninfobox").eq($(".moreBuUl li:not('.rightbtn')").index(this)).show().siblings().hide();
  116. WTime = "";WId = "";
  117. if(watchType==0){
  118. attentMy()
  119. }else if(watchType == 9) {
  120. getMyWatchA(userid,true)
  121. }else if(watchType == 8) {
  122. getMyWatchQ(userid, true);
  123. }else{
  124. collAttent(10,1,true);
  125. }
  126. })
  127. $(".navconBox .moreBu>.moreBuUl").on("click","li.rightbtn",function(){
  128. $(this).find(".table-drop").show();
  129. })
  130. $(".table-drop").on("click","li",function(){
  131. $(".navconBox .moreBu>.moreBuUl>.rightbtn").find("span").html($(this).text());
  132. $(".table-drop").fadeOut(1000);
  133. })
  134. $("#myAttends").on("click",function(){
  135. $(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
  136. $(".navconBox .moreBu").show();
  137. $("#item8user").show().siblings().hide();
  138. $(".moreBuUl li.attentType").eq(0).addClass("liNow").siblings().removeClass("liNow");
  139. $("#item8user>.coninfobox").eq(0).show().siblings().hide();
  140. })
  141. $("#attendmyGo").on("click",function(){
  142. $(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
  143. $(".navconBox .moreBu").show();
  144. $("#item8user").show().siblings().hide();
  145. $(".moreBuUl li.attendMy").addClass("liNow").siblings().removeClass("liNow");
  146. $("#item8user>.coninfobox").eq(9).show().siblings().hide();
  147. watchType=0
  148. attentMy();
  149. })
  150. //点击联系按钮
  151. $("#conbtn").on('click', function(){
  152. if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
  153. location.href="tidings.html?id="+professorId
  154. } else {
  155. quickLog();
  156. operatTab();
  157. closeLog();
  158. }
  159. });
  160. //点击关注按钮
  161. $("#attentBtn").on('click', function() {
  162. if(userid && userid != null && userid != "null") {
  163. if($(this).is('.attenedSpan')){
  164. cancelCollectionAbout(professorId,$(this), 1)
  165. } else {
  166. collectionAbout(professorId,$(this), 1);
  167. }
  168. attentCount();//关注者数量刷新
  169. attentMy();
  170. }else{
  171. quickLog();
  172. operatTab();
  173. closeLog();
  174. }
  175. });
  176. /*研究方向点赞*/
  177. var clFlag = 1;
  178. $("#researchAreaShow").on("click", ".plus", function() {
  179. if(userid && userid != null && userid != "null") {
  180. //点赞变化样式
  181. if(clFlag) {
  182. clFlag = 0;
  183. } else {
  184. return;
  185. }
  186. if($(this).data("isagree") > -1) {
  187. $(this).stop(true, true).animate({
  188. backgroundPositionY: 0
  189. }, 300); //变成未点赞样式
  190. } else {
  191. $(this).stop(true, true).animate({
  192. backgroundPositionY: -26
  193. }, 300); //变成点赞样式
  194. }
  195. $.ajax({
  196. "url": $(this).data("isagree") > -1 ? "/ajax/researchArea/unAgree" : "/ajax/researchArea/agree",
  197. "type": "POST",
  198. "data": {
  199. "targetId": $(this).data("pid"),
  200. "targetCaption": oArray[$(this).data("caption")],
  201. "opId": userid,
  202. "uname":$.cookie("userName")
  203. },
  204. "contentType": "application/x-www-form-urlencoded",
  205. "success": function(dataStr) {
  206. if(dataStr.success) {
  207. $.get("/ajax/professor/info/" + professorId, function(dataStr) {
  208. if(dataStr.success) {
  209. clFlag = 1;
  210. var $info = dataStr.data;
  211. if($info) {
  212. $("#researchAreaShow").empty("")
  213. if($info.researchAreas) {
  214. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  215. }
  216. }
  217. }
  218. })
  219. } else {
  220. $.MsgBox.Alert("提示", dataStr.msg);
  221. }
  222. }
  223. });
  224. } else {
  225. quickLog();
  226. operatTab();
  227. closeLog();
  228. }
  229. })
  230. function information(){
  231. $.ajax({
  232. url: "/ajax/baseUserInfo",
  233. dataType: 'json', //数据格式类型
  234. type: 'GET', //http请求类型
  235. timeout: 10000, //超时设置
  236. data: {
  237. "id": professorId
  238. },
  239. "success": function(data) {
  240. if(data.success){
  241. console.log(data);
  242. if(!data.data.activeTime){
  243. $(".last_meg").removeClass("displayNone");
  244. $(".message_b").on("click",function(){
  245. $(".meg_md5").toggle();
  246. if(data.data.email && data.data.mobilePhone){
  247. $("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号或邮箱 '+data.data.email);
  248. }else if(data.data.mobilePhone && !data.data.email){
  249. $("#wayTel").text('尾号为 '+data.data.mobilePhone+' 的手机号');
  250. }else if(data.data.email && !data.data.mobilePhone){
  251. $("#wayTel").text('邮箱 '+data.data.email);
  252. }
  253. })
  254. }else{
  255. $(".last_meg").addClass("displayNone");
  256. }
  257. }
  258. },
  259. "error": function() {
  260. $.MsgBox.Alert('提示', '链接服务器超时')
  261. }
  262. });
  263. }
  264. //点击每个研究方向弹出研究方向详情窗口
  265. $("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
  266. var cap = $(this).attr("caption");
  267. researchAlert(cap)
  268. });
  269. //关闭按钮
  270. $("#workclose").click(function() {
  271. $(".resAreaCover").fadeOut();
  272. $("body").css("position", "");
  273. });
  274. //点击查看全部资源
  275. $(".coninfobox").on("click","#seeMoreR",function(){
  276. document.body.scrollTop = document.documentElement.scrollTop = 0;
  277. $(".navconBox ul>li").eq(1).addClass("liNow").siblings().removeClass("liNow");
  278. $("#item1user").hide();
  279. $("#item2user").show();
  280. })
  281. //点击查看全部文章
  282. $(".coninfobox").on("click","#seeMoreA",function(){
  283. document.body.scrollTop = document.documentElement.scrollTop = 0;
  284. $(".navconBox ul>li").eq(2).addClass("liNow").siblings().removeClass("liNow");
  285. $("#item1user").hide();
  286. $("#item3user").show();
  287. })
  288. //点击查看全部专利
  289. $(".coninfobox").on("click","#seeMoreP",function(){
  290. document.body.scrollTop = document.documentElement.scrollTop = 0;
  291. $(".navconBox ul>li").eq(3).addClass("liNow").siblings().removeClass("liNow");
  292. $("#item1user").hide();
  293. $("#item4user").show();
  294. })
  295. //点击查看全部论文
  296. $(".coninfobox").on("click","#seeMoreL",function(){
  297. document.body.scrollTop = document.documentElement.scrollTop = 0;
  298. $(".navconBox ul>li").eq(4).addClass("liNow").siblings().removeClass("liNow");
  299. $("#item1user").hide();
  300. $("#item5user").show();
  301. })
  302. //点击查看全部问题
  303. $(".coninfobox").on("click","#seeMoreQA",function(){
  304. document.body.scrollTop = document.documentElement.scrollTop = 0;
  305. $(".navconBox ul>li").eq(5).addClass("liNow").siblings().removeClass("liNow");
  306. $("#item1user").hide();
  307. $("#item6user").show();
  308. if(userid === professorId) {
  309. $(".wendaNav").show();
  310. }else{
  311. $("#item6user .coninfobox").eq(0).addClass("displayNone").siblings().removeClass("displayNone");
  312. }
  313. })
  314. }
  315. function attentCount(){
  316. $.ajax({//我关注的
  317. type:"get",
  318. url:"/ajax/watch/countObject",
  319. data: {
  320. id: professorId,
  321. type: 1, //1:专家 2:资源 3:文章
  322. },
  323. async:true,
  324. success:function(data){
  325. if(data.success){
  326. if(data.data){
  327. $("#myFocus").html(data.data)
  328. }else{
  329. $("#myFocus").html("0")
  330. }
  331. }
  332. }
  333. });
  334. $.ajax({//关注我的
  335. type:"get",
  336. url:"/ajax/watch/countProfessor",
  337. data: {
  338. id: professorId,
  339. type: 1,
  340. },
  341. async:true,
  342. success:function(data){
  343. if(data.success){
  344. if(data.data){
  345. $("#focusMe").html(data.data)
  346. }else{
  347. $("#focusMe").html("0")
  348. }
  349. }
  350. }
  351. });
  352. }
  353. function liulanAdd() {
  354. $.ajax({
  355. "url": "/ajax/professor/incPageViews",
  356. "type": "POST",
  357. "dataType": "json",
  358. "async": true,
  359. "data": {
  360. "id": professorId,
  361. },
  362. "success": function(data) {
  363. if(data.success) {
  364. console.log(data);
  365. }
  366. },
  367. "error": function() {
  368. $.MsgBox.Alert('提示', '链接服务器超时')
  369. }
  370. });
  371. }
  372. //用户详细信息
  373. function getUserInfo(professorId){
  374. $.ajax({
  375. type:"get",
  376. url:"/ajax/professor/info/"+ professorId,
  377. async:true,
  378. success: function(data) {
  379. var $info = data.data;
  380. if(data.success) {
  381. console.log(data)
  382. if($info.hasHeadImage){
  383. $("#proHead").css("background-image","url(/images/head/"+ $info.id +"_l.jpg)");
  384. }
  385. $("#proName").text($info.name);
  386. var oStyS=autho($info.authType,$info.orgAuth,$info.authStatus);
  387. $("#proAuth").addClass(oStyS.sty); $("#proAuth").attr("title",oStyS.title);
  388. if($info.address){
  389. $("#proAddress").html($info.address + "<span style='margin-right:10px;'></span>");
  390. }
  391. var proOther="";
  392. if($info.orgName){
  393. if($info.department){
  394. if($info.office){
  395. proOther = $info.orgName + "," + $info.department + "," + $info.office
  396. }else{
  397. proOther = $info.orgName + "," + $info.department
  398. }
  399. }else{
  400. if($info.office){
  401. proOther = $info.orgName +"," + $info.office
  402. }else{
  403. proOther = $info.orgName
  404. }
  405. }
  406. }else{
  407. if($info.department){
  408. if($info.office){
  409. proOther = $info.department + "," + $info.office
  410. }else{
  411. proOther = $info.department
  412. }
  413. }else{
  414. if($info.office){
  415. proOther = $info.office
  416. }
  417. }
  418. }
  419. $("#proOther").text(proOther);
  420. var llqtitle=$info.name + "-" + proOther.replace(/,/gi,"-") + "-科袖网";//修改浏览器title信息
  421. if($info.title){
  422. $("#proTit").html($info.title + "<span style='margin-right:10px;'></span>");
  423. llqtitle = $info.name + "-" + $info.title + "-" + proOther.replace(/,/gi,"-") + "-科袖网";
  424. }
  425. document.title = llqtitle;
  426. //主页浏览量
  427. $("#viewNums").text($info.pageViews);
  428. //个人简介
  429. if($info.descp) {
  430. $("#descpS").parents(".coninfobox").removeClass("displayNone");
  431. $("#item1user>.nodatabox").addClass("displayNone");
  432. $("#descpS").text($info.descp);
  433. }
  434. //学术领域
  435. if($info.subject) {
  436. $("#subjectShow").parents(".coninfobox").removeClass("displayNone");
  437. $("#item1user>.nodatabox").addClass("displayNone");
  438. subjectShow($info.subject);
  439. }
  440. //研究方向
  441. if($info.researchAreas.length) {
  442. $("#researchAreaShow").parents(".coninfobox").removeClass("displayNone");
  443. $("#item1user>.nodatabox").addClass("displayNone");
  444. researchAreaShow($info.researchAreas, $info.editResearchAreaLogs);
  445. }
  446. //行业领域
  447. if($info.industry) {
  448. $("#industryShow").parents(".coninfobox").removeClass("displayNone");
  449. $("#item1user>.nodatabox").addClass("displayNone");
  450. industryShow($info.industry);
  451. }
  452. //教育背景
  453. if($info.edus.length) {
  454. eduBgShow($info.edus);
  455. } else {
  456. $("#eduBgShow").parents(".coninfobox").hide();
  457. }
  458. //兼职
  459. if($info.jobs.length) {
  460. timeJobShow($info.jobs);
  461. } else {
  462. $("#timeJobShow").parents(".coninfobox").hide();
  463. }
  464. //项目
  465. if($info.projects.length) {
  466. projectShow($info.projects)
  467. } else {
  468. $("#projectShow").parents(".coninfobox").hide();
  469. }
  470. //荣誉
  471. if($info.honors.length) {
  472. honorShow($info.honors);
  473. } else {
  474. $("#honorShow").parents(".coninfobox").hide();
  475. }
  476. if($info.honors.length == 0 && $info.projects.length == 0 && $info.jobs.length == 0 && $info.edus.length == 0){
  477. $("#item6user>.nodatabox").show();
  478. $("#item6user>.nodatabox").find(".noContip").text("用户尚未完善详细资料")
  479. }
  480. var weibotitle = $info.name;
  481. var weibourl = window.location.href;
  482. var weibopic ="http://"+window.location.host+"/images/head/"+ $info.id +"_l.jpg";
  483. $("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
  484. }
  485. },
  486. error: function() {
  487. $.MsgBox.Alert('提示', '链接服务器超时')
  488. }
  489. });
  490. }
  491. function subjectShow(data) {
  492. if(data != undefined && data.length != 0) {
  493. var subs = new Array();
  494. if(data.indexOf(',')) {
  495. subs = data.split(',');
  496. } else {
  497. subs[0] = data;
  498. }
  499. if(subs.length > 0) {
  500. for(var i = 0; i < subs.length; i++) {
  501. $("#subjectShow").append("<li>" + subs[i] + "</li>");
  502. };
  503. }
  504. }
  505. }
  506. function researchAreaShow(dataStrs, dataStrrecords) {
  507. if(dataStrs != undefined && dataStrs.length != 0) {
  508. var html = [];
  509. for(var i = 0; i < dataStrs.length; ++i) {
  510. var dataStr = dataStrs[i];
  511. var $photos = [];
  512. //获取头像
  513. if(dataStrrecords.length > 0) {
  514. $photos = getRecords(dataStrrecords, dataStr.caption);
  515. }
  516. var isAgree = -1;
  517. for(var j = 0; j < $photos.length; j++) {
  518. if(userid == $photos[j].id)
  519. isAgree++;
  520. }
  521. oArray[i]=dataStr.caption;
  522. if(professorId != userid) {
  523. if(isAgree) {
  524. var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><span class="plus" data-pid="'+ dataStr.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ dataStr.caption +'">';
  525. } else {
  526. var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><span class="plus" style="background-position-y:-26px" data-pid="'+ dataStr.professorId +'" data-caption="'+ i + '" data-isagree="' + isAgree + '"></span><div class="favorCount" caption="'+ dataStr.caption +'">';
  527. }
  528. } else {
  529. var showDiv = '<li><div class="favorBox" caption="'+ dataStr.caption +'"><span class="like">'+ dataStr.count +'</span>'+ dataStr.caption +'</div><div class="favorCount" caption="'+ dataStr.caption +'">';
  530. }
  531. if($photos.length < 6) {
  532. for(var j = 0; j < $photos.length; ++j) {
  533. if($photos[j].img) {
  534. showDiv += '<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
  535. } else {
  536. showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
  537. }
  538. }
  539. } else {
  540. for(var j = $photos.length - 5; j < $photos.length; ++j) {
  541. if($photos[j].img) {
  542. showDiv +='<span class="like-people" style="background-image: url(../images/head/'+ $photos[j].id +'_s.jpg);"></span>';
  543. } else {
  544. showDiv += '<span class="like-people" style="background-image: url(../images/default-photo.jpg);"></span>';
  545. }
  546. }
  547. showDiv += '<span class="like-people like-more"></span>';
  548. }
  549. showDiv += "</div></li>";
  550. html.push(showDiv);
  551. }
  552. document.getElementById("researchAreaShow").innerHTML = html.join('');
  553. }
  554. }
  555. function industryShow(data) {
  556. if(data != undefined && data.length != 0) {
  557. var subs = new Array();
  558. if(data.indexOf(',')) {
  559. subs = data.split(',');
  560. } else {
  561. subs[0] = data;
  562. }
  563. if(subs.length > 0) {
  564. for(var i = 0; i < subs.length; i++) {
  565. $("#industryShow").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
  566. };
  567. }
  568. }
  569. }
  570. function projectShow(data) {
  571. if(data.length > 0) {
  572. for(var i = 0; i < data.length; i++) {
  573. if(!data[i].descp) {
  574. data[i].descp = "";
  575. }
  576. var sDate = "";
  577. var eDate = "";
  578. if(data[i].startMonth) {
  579. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
  580. sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
  581. if(data[i].stopMonth) {
  582. eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  583. } else {
  584. eDate = " - "+ "至今";
  585. }
  586. }
  587. var projectHtml = '<li>';
  588. projectHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + sDate + eDate + '</small></div>';
  589. projectHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  590. projectHtml += '</li>';
  591. $("#projectShow").append(projectHtml);
  592. }
  593. }
  594. }
  595. function honorShow(data) {
  596. if(data.length > 0) {
  597. for(var i = 0; i < data.length; i++) {
  598. var timeho="";
  599. if(data[i].year){
  600. timeho = data[i].year+'年';
  601. }else{
  602. data[i].year="";
  603. }
  604. if(!data[i].descp) {
  605. data[i].descp = "";
  606. }
  607. var honorHtml = '<li>';
  608. honorHtml += '<div class="h4Font h4tit">' + data[i].name + '<small class="h6Font">' + timeho + '</small></div>';
  609. honorHtml += '<div class="h5Font">' + data[i].descp + '</div>';
  610. honorHtml += '</li>';
  611. $("#honorShow").append(honorHtml);
  612. }
  613. }
  614. }
  615. function timeJobShow(data) {
  616. if(data.length > 0) {
  617. for(var i = 0; i < data.length; i++) {
  618. if(data[i].department) {
  619. var dep = " - " + data[i].department;
  620. } else {
  621. var dep = ""
  622. }
  623. var sDate = "";
  624. var eDate = "";
  625. if(data[i].startMonth) {
  626. sDate = data[i].startMonth.substr(0, 4) + "年" + data[i].startMonth.substr(4, 6) + "月";
  627. sDateV = data[i].startMonth.substr(0, 4) + "-" + data[i].startMonth.substr(4, 6);
  628. if(data[i].stopMonth) {
  629. eDate =" - "+ data[i].stopMonth.substr(0, 4) + "年" + data[i].stopMonth.substr(4, 6) + "月";
  630. } else {
  631. eDate = " - "+ "至今";
  632. }
  633. }
  634. var JobHtml = '<li>';
  635. JobHtml += '<div class="h4Font h4tit">' + data[i].company + dep + ' - ' + data[i].title + '<small class="h6Font">' + sDate + eDate + '</small></div>';
  636. JobHtml += '</li>';
  637. $("#timeJobShow").append(JobHtml);
  638. }
  639. }
  640. }
  641. function eduBgShow(data) {
  642. if(data.length > 0) {
  643. for(var i = 0; i < data.length; i++) {
  644. var college="",major="",degree=""
  645. if(data[i].college){
  646. college =' - ' + data[i].college
  647. }else{
  648. data[i].college="";
  649. }
  650. if(data[i].major){
  651. major =' - ' + data[i].major
  652. }else{
  653. data[i].major="";
  654. }
  655. if(data[i].degree){
  656. degree =' - ' + data[i].degree
  657. if(data[i].degree==0){
  658. degree =""
  659. }
  660. }else{
  661. data[i].degree="";
  662. }
  663. var timebiye="";
  664. if(data[i].year){
  665. if(data[i].year.trim()=="至今"){
  666. timebiye=data[i].year;
  667. }else{
  668. timebiye=data[i].year+'年';
  669. }
  670. }else{
  671. timebiye="";
  672. }
  673. var showHtml = '<li><div class="h4Font h4tit">'
  674. showHtml += data[i].school + college + major + degree;
  675. showHtml +='<small class="h6Font">' + timebiye + '</small></div></li>';
  676. $("#eduBgShow").append(showHtml);
  677. }
  678. }
  679. }
  680. //判断点赞的用户是否有头像
  681. function getRecords($researchAreaLogs, caption) {
  682. var ret = [];
  683. var t = 0;
  684. for(var i = 0; i < $researchAreaLogs.length; i++) {
  685. if(caption == $researchAreaLogs[i].caption) {
  686. ret[t] = {
  687. id: $researchAreaLogs[i].opreteProfessorId,
  688. img: $researchAreaLogs[i].hasHeadImage
  689. }
  690. t++;
  691. }
  692. }
  693. return ret;
  694. }
  695. //合作历史及评价
  696. function historyEvaluate(){
  697. $.ajax({
  698. "url": "/ajax/consult/pqAssessHis",
  699. "type": "get",
  700. "data": {
  701. "professorId": professorId,
  702. "pageSize": 1000
  703. },
  704. "async": false,
  705. "success": function(response) {
  706. if(response.success) {
  707. var dataStr = response.data.data;
  708. if(dataStr.length>0){
  709. $("#historyEvaluate").parents(".coninfobox").removeClass("displayNone");
  710. $("#item1user>.nodatabox").addClass("displayNone");
  711. for(var i = 0; i < dataStr.length; i++) {
  712. var assessTime = commenTime(dataStr[i].assessTime);
  713. var assessContant ="";
  714. if(dataStr[i].assessContant) {
  715. assessContant = dataStr[i].assessContant;
  716. }
  717. var userhed='';
  718. if(dataStr[i].professor.hasHeadImage) {
  719. userhed = 'background-image:url(/images/head/' + dataStr[i].professor.id + '_l.jpg)';
  720. } else {
  721. userhed = 'background-image:url(/images/default-photo.jpg)';
  722. }
  723. var add = "";
  724. add += '<li class="flexCenter">';
  725. add += '<a href="userInforShow.html?professorId='+ dataStr[i].professor.id +'" class="userhref"><div class="madiaHead useHead useHeadMsg" style="'+ userhed +'"></div></a>'
  726. add += '<div class="madiaInfo"><div style="position: relative;">';
  727. add += '<a href="userInforShow.html?professorId='+ dataStr[i].professor.id +'" class="userhref"><span class="h1Font messageName">'+ dataStr[i].professor.name +'</span></a>';
  728. add += '<em class="authiconNew authicon-pro" title=" "></em><span class="commenttime">'+ assessTime +'</span>';
  729. add += '<ul class="starShow">';
  730. add += '<li></li> <li></li> <li></li> <li></li> <li></li>';
  731. add += '</ul></div>';
  732. add += '<p class="h2Font messageContent">'+ assessContant +'</p>';
  733. add += '</div></li>';
  734. var $add = $(add);
  735. $("#historyEvaluate").append($add);
  736. $add.find(".starShow>li:lt(" + dataStr[i].assessStar + ")").addClass('evastar');
  737. }
  738. }else{
  739. }
  740. }
  741. }
  742. })
  743. }
  744. //获取资源
  745. function getResource(pageSize, pageNo,isbind){
  746. $.ajax({
  747. "url": "/ajax/resource/pqProPublish",
  748. "type": "get",
  749. "async": false,
  750. "data": {
  751. "professorId": professorId,
  752. "pageSize": pageSize,
  753. "pageNo": pageNo
  754. },
  755. beforeSend: function() {
  756. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  757. $("#proResource").parent().find(".js-load-more").attr("disabled",true);
  758. $("#proResource").parent().find(".js-load-more").addClass("active");
  759. },
  760. complete:function () {
  761. $("#proResource").parent().find(".js-load-more").removeAttr("disabled");
  762. $("#proResource").parent().find(".js-load-more").removeClass("active");
  763. },
  764. "success": function(data) {
  765. console.log(data);
  766. if(data.success) {
  767. var madiaHead ='';
  768. if(data.data.total>0){
  769. $("#resCount").html(data.data.total)
  770. }else if(data.data.total>99){
  771. $("#resCount").html("99+")
  772. }
  773. var dataStr=data.data.data;
  774. if(dataStr.length > 0){
  775. $("#showResource").parents(".coninfobox").removeClass("displayNone");
  776. $("#item1user>.nodatabox").addClass("displayNone");
  777. for(var i = 0; i < dataStr.length; i++) {
  778. if(dataStr[i].images.length) {
  779. madiaHead ='/data/resource/' + dataStr[i].images[0].imageSrc ;
  780. }else{
  781. madiaHead ='/images/default-resource.jpg';
  782. }
  783. var strAdd = '';
  784. strAdd += '<li><a target="_blank" href="resourceShow.html?resourceId='+ dataStr[i].resourceId +'" class="flexCenter urlgo">';
  785. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ madiaHead +')"></div>';
  786. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].resourceName +'</p><p class="h2Font ellipsisSty-2">用途:'+ dataStr[i].supportedServices+'</p></div>';
  787. strAdd += '</a></li>';
  788. var $strAdd = $(strAdd);
  789. $("#proResource").append(strAdd);
  790. if(isbind==true && i==0){
  791. var $strAddO=$(strAdd);
  792. $("#showResource").html("");
  793. $("#showResource").append($strAddO);
  794. }
  795. }
  796. //分页
  797. if(isbind==true){
  798. // $("#proResource").siblings(".tcdPageCode").off("click").createPage({
  799. // pageCount: Math.ceil(data.data.total / 10),
  800. // current: data.data.pageNo,
  801. // backFn: function(p) {
  802. // $("#proResource").html("");
  803. // getResource(10, p,false);
  804. // document.body.scrollTop = document.documentElement.scrollTop = 0;
  805. // }
  806. // });
  807. $("#proResource").parent().find(".js-load-more").on("click", function () {
  808. getResource(10,++pageNo,false);
  809. });
  810. }
  811. if (pageNo >= Math.ceil(data.data.total / 10)) {
  812. $("#proResource").parent().find(".js-load-more").unbind("click");
  813. $("#proResource").parent().find(".js-load-more").hide();
  814. }
  815. }else{
  816. $("#proResource + .nodatabox").show();
  817. $("#proResource + .nodatabox").find(".noContip").text("用户尚未发布任何资源");
  818. if(isbind == true) {
  819. $("#proResource").parent().find(".js-load-more").hide();
  820. }
  821. }
  822. }
  823. },
  824. "error": function() {
  825. $.MsgBox.Alert("提示", "服务器连接超时")
  826. }
  827. });
  828. }
  829. //获取文章
  830. function getArticle(pageSize, pageNo,isbind){
  831. $.ajax({
  832. url: "/ajax/article/pqProPublish",
  833. dataType: 'json', //数据格式类型
  834. type: 'GET', //http请求类型
  835. data: {
  836. "professorId": professorId,
  837. "pageSize": pageSize,
  838. "pageNo": pageNo
  839. },
  840. beforeSend: function() {
  841. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  842. $("#proArticel").parent().find(".js-load-more").attr("disabled",true);
  843. $("#proArticel").parent().find(".js-load-more").addClass("active");
  844. },
  845. complete:function () {
  846. $("#proArticel").parent().find(".js-load-more").removeAttr("disabled");
  847. $("#proArticel").parent().find(".js-load-more").removeClass("active");
  848. },
  849. timeout: 10000, //超时设置
  850. success: function(data) {
  851. if(data.success) {
  852. var madiaHead ='/images/default-artical.jpg';
  853. if(data.data.total>0){
  854. $("#artCount").html(data.data.total)
  855. }else if(data.data.total>99){
  856. $("#artCount").html("99+")
  857. }
  858. var dataStr=data.data.data;
  859. if(dataStr.length > 0){
  860. $("#showArticle").parents(".coninfobox").removeClass("displayNone");
  861. $("#item1user>.nodatabox").addClass("displayNone");
  862. for(var i = 0; i < dataStr.length; i++) {
  863. if(dataStr[i].articleImg) {
  864. madiaHead ='/data/article/' + dataStr[i].articleImg ;
  865. }
  866. var sowU="";
  867. if(dataStr[i].pageViews!=0){
  868. if(dataStr[i].articleAgree!=0){
  869. sowU='<li><span>阅读量 '+dataStr[i].pageViews+'</span></li><li><span>赞 '+dataStr[i].articleAgree+'</span></li>'
  870. }else{
  871. sowU='<li><span>阅读量 '+dataStr[i].pageViews+'</span></li>'
  872. }
  873. }
  874. var strAdd = '';
  875. strAdd += '<li><a target="_blank" href="/'+ pageUrl('a',dataStr[i]) +'" class="flexCenter urlgo">';
  876. strAdd += '<div class="madiaHead artHead" style="background-image:url('+ madiaHead +')"></div>';
  877. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr[i].articleTitle +'</p>';
  878. strAdd += '<ul class="h2Font clearfix">';
  879. strAdd += '<li><span class="time">'+ commenTime(dataStr[i].publishTime) +'</span></li>';
  880. strAdd += sowU
  881. strAdd += '<li><span class="comment"></span></li>';
  882. strAdd += '</ul></div>';
  883. strAdd += '</a></li>';
  884. var $strAdd = $(strAdd);
  885. $("#proArticel").append( $strAdd);
  886. commentnum(dataStr[i].articleId, $strAdd) //文章评论数
  887. if(isbind==true && i==0){
  888. var $strAddO = $(strAdd);
  889. $("#showArticle").html("");
  890. $("#showArticle").append($strAddO);
  891. commentnum(dataStr[0].articleId,$strAddO)
  892. }
  893. }
  894. //分页
  895. if(isbind==true){
  896. // $("#proArticel").siblings(".tcdPageCode").off("click").createPage({
  897. // pageCount: Math.ceil(data.data.total / 10),
  898. // current: data.data.pageNo,
  899. // backFn: function(p) {
  900. // $("#proArticel").html("");
  901. // getArticle(10, p,false);
  902. // document.body.scrollTop = document.documentElement.scrollTop = 0;
  903. // }
  904. // });
  905. $("#proArticel").parent().find(".js-load-more").on("click", function () {
  906. getArticle(10,++pageNo,false);
  907. });
  908. }
  909. if (pageNo >= Math.ceil(data.data.total / 10)) {
  910. $("#proArticel").parent().find(".js-load-more").unbind("click");
  911. $("#proArticel").parent().find(".js-load-more").hide();
  912. }
  913. }else{
  914. $("#proArticel + .nodatabox").show();
  915. $("#proArticel + .nodatabox").find(".noContip").text("用户尚未发布任何文章");
  916. if(isbind==true) {
  917. $("#proArticel").parent().find(".js-load-more").hide();
  918. }
  919. }
  920. }
  921. },
  922. error: function() {
  923. return;
  924. }
  925. });
  926. }
  927. //获取专利
  928. function getPatent(pageSize, pageNo,isbind){
  929. $.ajax({
  930. url: "/ajax/ppatent/byProfessor",
  931. dataType: 'json', //数据格式类型
  932. type: 'GET', //http请求类型
  933. data: {
  934. "id": professorId,
  935. "pageSize": pageSize,
  936. "pageNo": pageNo
  937. },
  938. beforeSend: function() {
  939. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  940. $("#proPatent").parent().find(".js-load-more").attr("disabled",true);
  941. $("#proPatent").parent().find(".js-load-more").addClass("active");
  942. },
  943. complete:function () {
  944. $("#proPatent").parent().find(".js-load-more").removeAttr("disabled");
  945. $("#proPatent").parent().find(".js-load-more").removeClass("active");
  946. },
  947. timeout: 10000, //超时设置
  948. success: function(data) {
  949. if(data.success) {
  950. if(data.data.total>0){
  951. $("#patCount").html(data.data.total)
  952. }else if(data.data.total>99){
  953. $("#patCount").html("99+")
  954. }
  955. var dataStr=data.data.data;
  956. if(dataStr.length > 0){
  957. $("#showPatent").parents(".coninfobox").removeClass("displayNone");
  958. $("#item1user>.nodatabox").addClass("displayNone");
  959. for(var i = 0; i < dataStr.length; i++) {
  960. if(!dataStr[i].reqPerson){
  961. dataStr[i].reqPerson="";
  962. }
  963. var strAdd = '';
  964. strAdd += '<li><a target="_blank" href="/'+ pageUrl("pt",dataStr[i]) +'" class="flexCenter urlgo">';
  965. strAdd += '<div class="madiaHead patentHead"></div>';
  966. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  967. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  968. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  969. strAdd += '</div>';
  970. strAdd += '</a></li>';
  971. var $strAdd = $(strAdd);
  972. $("#proPatent").append( $strAdd);
  973. if(isbind==true && i==0){
  974. var $strAddO=$(strAdd);
  975. $("#showPatent").html("");
  976. $("#showPatent").append($strAddO);
  977. }
  978. }
  979. //分页
  980. if(isbind==true){
  981. // $("#proPatent").siblings(".tcdPageCode").off("click").createPage({
  982. // pageCount: Math.ceil(data.data.total / 10),
  983. // current: data.data.pageNo,
  984. // backFn: function(p) {
  985. // $("#proPatent").html("");
  986. // getPatent(10, p,false);
  987. // document.body.scrollTop = document.documentElement.scrollTop = 0;
  988. // }
  989. // });
  990. $("#proPatent").parent().find(".js-load-more").on("click", function () {
  991. getPatent(10,++pageNo,false);
  992. });
  993. }
  994. if (pageNo >= Math.ceil(data.data.total / 10)) {
  995. console.log("xmtt");
  996. $("#proPatent").parent().find(".js-load-more").unbind("click");
  997. $("#proPatent").parent().find(".js-load-more").hide();
  998. }
  999. }else{
  1000. $("#proPatent + .nodatabox").show();
  1001. $("#proPatent + .nodatabox").find(".noContip").text("用户尚未发布任何专利");
  1002. if(isbind==true) {
  1003. $("#proPatent").parent().find(".js-load-more").hide();
  1004. }
  1005. }
  1006. }
  1007. },
  1008. error: function() {
  1009. return;
  1010. }
  1011. });
  1012. }
  1013. //获取论文
  1014. function getPaper(pageSize, pageNo,isbind){
  1015. $.ajax({
  1016. url: "/ajax/ppaper/byProfessor",
  1017. dataType: 'json', //数据格式类型
  1018. type: 'GET', //http请求类型
  1019. data: {
  1020. "id": professorId,
  1021. "pageSize": pageSize,
  1022. "pageNo": pageNo
  1023. },
  1024. beforeSend: function() {
  1025. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  1026. $("#proPaper").parent().find(".js-load-more").attr("disabled",true);
  1027. $("#proPaper").parent().find(".js-load-more").addClass("active");
  1028. },
  1029. complete:function () {
  1030. $("#proPaper").parent().find(".js-load-more").removeAttr("disabled");
  1031. $("#proPaper").parent().find(".js-load-more").removeClass("active");
  1032. },
  1033. timeout: 10000, //超时设置
  1034. success: function(data) {
  1035. if(data.success) {
  1036. if(data.data.total>0){
  1037. $("#parCount").html(data.data.total)
  1038. }else if(data.data.total>99){
  1039. $("#parCount").html("99+")
  1040. }
  1041. var dataStr=data.data.data;
  1042. if(dataStr.length > 0){
  1043. $("#showPaper").parents(".coninfobox").removeClass("displayNone");
  1044. $("#item1user>.nodatabox").addClass("displayNone");
  1045. for(var i = 0; i < dataStr.length; i++) {
  1046. var moreInf=""
  1047. if(!dataStr[i].cn4periodical){
  1048. dataStr[i].cn4periodical="";
  1049. }
  1050. if(!dataStr[i].en4periodical){
  1051. dataStr[i].en4periodical="";
  1052. }
  1053. if(!dataStr[i].pubDay){
  1054. dataStr[i].pubDay="";
  1055. }
  1056. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  1057. var strAdd = '';
  1058. strAdd += '<li><a target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
  1059. strAdd += '<div class="madiaHead paperHead"></div>';
  1060. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  1061. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  1062. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  1063. strAdd += '</div>';
  1064. strAdd += '</a></li>';
  1065. var $strAdd = $(strAdd);
  1066. $("#proPaper").append( $strAdd);
  1067. if(isbind==true && i==0){
  1068. var $strAddO=$(strAdd);
  1069. $("#showPaper").html();
  1070. $("#showPaper").append($strAddO);
  1071. }
  1072. }
  1073. //分页
  1074. if(isbind==true){
  1075. // $("#proPaper").siblings(".tcdPageCode").off("click").createPage({
  1076. // pageCount: Math.ceil(data.data.total / 10),
  1077. // current: data.data.pageNo,
  1078. // backFn: function(p) {
  1079. // $("#proPaper").html("");
  1080. // getPaper(10, p,false);
  1081. // document.body.scrollTop = document.documentElement.scrollTop = 0;
  1082. // }
  1083. // });
  1084. $("#proPaper").parent().find(".js-load-more").on("click", function () {
  1085. getPaper(10,++pageNo,false);
  1086. });
  1087. }
  1088. if (pageNo >= Math.ceil(data.data.total / 10)) {
  1089. $("#proPaper").parent().find(".js-load-more").unbind("click");
  1090. $("#proPaper").parent().find(".js-load-more").hide();
  1091. }
  1092. }else{
  1093. $("#proPaper + .nodatabox").show();
  1094. $("#proPaper + .nodatabox").find(".noContip").text("用户尚未发布任何论文");
  1095. if(isbind) {
  1096. $("#proPaper").parent().find(".js-load-more").hide();
  1097. }
  1098. }
  1099. }
  1100. },
  1101. error: function() {
  1102. return;
  1103. }
  1104. });
  1105. }
  1106. //获取问答
  1107. function getMyAnswer(id,isbind) {
  1108. $.ajax({
  1109. url: "/ajax/question/answer/bySelf",
  1110. dataType: 'json',
  1111. type: 'GET',
  1112. data: {
  1113. "time":ATime,
  1114. "id":AId,
  1115. "rows":rows,
  1116. "uid":id
  1117. },
  1118. beforeSend: function() {
  1119. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  1120. $("#proA").parent().find(".js-load-more").attr("disabled",true);
  1121. $("#proA").parent().find(".js-load-more").addClass("active");
  1122. },
  1123. complete:function () {
  1124. $("#proA").parent().find(".js-load-more").removeAttr("disabled");
  1125. $("#proA").parent().find(".js-load-more").removeClass("active");
  1126. },
  1127. success: function(data) {
  1128. if(data.success) {
  1129. // if(data.data.total>0){
  1130. // $("#qaCount").html(data.data.total)
  1131. // }else if(data.data.total>99){
  1132. // $("#qaCount").html("99+")
  1133. // }
  1134. var dataStr=data.data;
  1135. if(dataStr.length > 0){
  1136. $("#showAnswer").parents(".coninfobox").removeClass("displayNone");
  1137. $("#item1user>.nodatabox").addClass("displayNone");
  1138. ATime = dataStr[dataStr.length - 1].createTime;
  1139. AId = dataStr[dataStr.length - 1].id;
  1140. for(var i = 0; i < dataStr.length; i++) {
  1141. var listLi = $('<li class="mui-table-view-cell">').appendTo($("#proA"));
  1142. answer(dataStr[i], listLi);
  1143. if(isbind==true && i==0){
  1144. var li = listLi.clone();
  1145. $("#showAnswer").html();
  1146. $("#showAnswer").append(li);
  1147. questioninfo(dataStr[i].qid, li);
  1148. proinfo(dataStr[i].uid, li);
  1149. leaveMsgCount(dataStr[i].id, li);
  1150. }
  1151. }
  1152. if(isbind==true){
  1153. $("#proA").parent().find(".js-load-more").on("click", function () {
  1154. getMyAnswer(id,false);
  1155. });
  1156. }
  1157. if (dataStr.length < rows) {
  1158. $("#proA").parent().find(".js-load-more").unbind("click");
  1159. $("#proA").parent().find(".js-load-more").hide();
  1160. }
  1161. }else{
  1162. $("#proA + .nodatabox").show();
  1163. $("#proA + .nodatabox").find(".noContip").text("用户尚未回答任何问题");
  1164. }
  1165. }
  1166. },
  1167. error: function() {
  1168. return;
  1169. }
  1170. });
  1171. }
  1172. // 获取问题
  1173. function getMyQuestion(id,isbind) {
  1174. $.ajax({
  1175. url: "/ajax/question/my",
  1176. dataType: 'json',
  1177. type: 'GET',
  1178. data: {
  1179. "time":QTime,
  1180. "id":QId,
  1181. "rows":rows,
  1182. "uid":id
  1183. },
  1184. beforeSend: function() {
  1185. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  1186. $("#proQ").parent().find(".js-load-more").attr("disabled",true);
  1187. $("#proQ").parent().find(".js-load-more").addClass("active");
  1188. },
  1189. complete:function () {
  1190. $("#proQ").parent().find(".js-load-more").removeAttr("disabled");
  1191. $("#proQ").parent().find(".js-load-more").removeClass("active");
  1192. },
  1193. success: function(data) {
  1194. if(data.success) {
  1195. // if(data.data.total>0){
  1196. // $("#qaCount").html(data.data.total)
  1197. // }else if(data.data.total>99){
  1198. // $("#qaCount").html("99+")
  1199. // }
  1200. var dataStr=data.data;
  1201. if(dataStr.length > 0){
  1202. QTime = dataStr[dataStr.length - 1].createTime;
  1203. QId = dataStr[dataStr.length - 1].id;
  1204. for(var i = 0; i < dataStr.length; i++) {
  1205. var listLi = $('<li class="mui-table-view-cell">').appendTo($("#proQ"));
  1206. question(dataStr[i], listLi);
  1207. if(isbind==true && i==0){
  1208. $("#proQ").html();
  1209. }
  1210. }
  1211. if(isbind==true){
  1212. $("#proQ").parent().find(".js-load-more").on("click", function () {
  1213. getMyQuestion(id,false);
  1214. });
  1215. }
  1216. if (dataStr.length < rows) {
  1217. $("#proQ").parent().find(".js-load-more").unbind("click");
  1218. $("#proQ").parent().find(".js-load-more").hide();
  1219. }
  1220. }else{
  1221. $("#proQ + .nodatabox").show();
  1222. $("#proQ + .nodatabox").find(".noContip").text("用户尚未提出任何问题");
  1223. }
  1224. }
  1225. },
  1226. error: function() {
  1227. return;
  1228. }
  1229. });
  1230. }
  1231. //我关注的问题
  1232. function getMyWatchQ(id,isbind) {
  1233. $.ajax({
  1234. url: "/ajax/question/watch",
  1235. dataType: 'json',
  1236. type: 'GET',
  1237. data: {
  1238. "time":WTime,
  1239. "id":WId,
  1240. "rows":rows,
  1241. "uid":id
  1242. },
  1243. beforeSend: function() {
  1244. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  1245. $("#item8user").find(".js-load-more").attr("disabled",true);
  1246. $("#item8user").find(".js-load-more").addClass("active");
  1247. },
  1248. complete:function () {
  1249. $("#item8user").find(".js-load-more").removeAttr("disabled");
  1250. $("#item8user").find(".js-load-more").removeClass("active");
  1251. },
  1252. success: function(data) {
  1253. if(data.success) {
  1254. // if(data.data.total>0){
  1255. // $("#qaCount").html(data.data.total)
  1256. // }else if(data.data.total>99){
  1257. // $("#qaCount").html("99+")
  1258. // }
  1259. var dataStr=data.data;
  1260. if(dataStr.length > 0){
  1261. WTime = dataStr[dataStr.length - 1].createTime;
  1262. WId = dataStr[dataStr.length - 1].id;
  1263. for(var i = 0; i < dataStr.length; i++) {
  1264. var listLi = $('<li class="mui-table-view-cell">').appendTo($("#attendQuestion"));
  1265. question(dataStr[i], listLi);
  1266. if(isbind==true && i==0){
  1267. var li = listLi.clone();
  1268. $("#showAnswer").html();
  1269. $("#showAnswer").append(li);
  1270. questioninfo(dataStr[i].qid, li);
  1271. proinfo(dataStr[i].uid, li);
  1272. leaveMsgCount(dataStr[i].id, li);
  1273. }
  1274. }
  1275. if(isbind==true){
  1276. $("#item8user").append('<button class="js-load-more"></button>');
  1277. $("#item8user").find(".js-load-more").on("click", function () {
  1278. getMyWatchQ(id,false);
  1279. });
  1280. }
  1281. if (dataStr.length < rows) {
  1282. $("#item8user").parent().find(".js-load-more").unbind("click");
  1283. $("#item8user").parent().find(".js-load-more").hide();
  1284. }
  1285. }else{
  1286. $("#attendQuestion + .nodatabox").show();
  1287. $("#attendQuestion + .nodatabox").find(".noContip").text("用户尚未回答任何问题");
  1288. }
  1289. }
  1290. },
  1291. error: function() {
  1292. return;
  1293. }
  1294. });
  1295. }
  1296. //我关注的回答
  1297. function getMyWatchA(id,isbind) {
  1298. $.ajax({
  1299. url: "/ajax/question/answer/byWatch",
  1300. dataType: 'json',
  1301. type: 'GET',
  1302. data: {
  1303. "time":WTime,
  1304. "id":WId,
  1305. "rows":rows,
  1306. "uid":id
  1307. },
  1308. beforeSend: function() {
  1309. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  1310. $("#item8user").find(".js-load-more").attr("disabled",true);
  1311. $("#item8user").find(".js-load-more").addClass("active");
  1312. },
  1313. complete:function () {
  1314. $("#item8user").find(".js-load-more").removeAttr("disabled");
  1315. $("#item8user").find(".js-load-more").removeClass("active");
  1316. },
  1317. success: function(data) {
  1318. if(data.success) {
  1319. // if(data.data.total>0){
  1320. // $("#qaCount").html(data.data.total)
  1321. // }else if(data.data.total>99){
  1322. // $("#qaCount").html("99+")
  1323. // }
  1324. var dataStr=data.data;
  1325. if(dataStr.length > 0){
  1326. WTime = dataStr[dataStr.length - 1].createTime;
  1327. WId = dataStr[dataStr.length - 1].id;
  1328. for(var i = 0; i < dataStr.length; i++) {
  1329. var listLi = $('<li class="mui-table-view-cell">').appendTo($("#attendAnswer"));
  1330. answer(dataStr[i], listLi);
  1331. }
  1332. if(isbind==true){
  1333. $("#item8user").append('<button class="js-load-more"></button>');
  1334. $("#item8user").find(".js-load-more").on("click", function () {
  1335. getMyWatchA(id,false);
  1336. });
  1337. }
  1338. if (dataStr.length < rows) {
  1339. $("#item8user").parent().find(".js-load-more").unbind("click");
  1340. $("#item8user").parent().find(".js-load-more").hide();
  1341. }
  1342. }else{
  1343. $("#attendAnswer + .nodatabox").show();
  1344. $("#attendAnswer + .nodatabox").find(".noContip").text("用户尚未回答任何问题");
  1345. }
  1346. }
  1347. },
  1348. error: function() {
  1349. return;
  1350. }
  1351. });
  1352. }
  1353. //查文章评论数
  1354. function commentnum(articleId, $itemlist) {
  1355. $.ajax({
  1356. "url": "/ajax/leaveWord/lwCount",
  1357. "type": "GET",
  1358. "dataType": "json",
  1359. "async": false,
  1360. "data": {
  1361. "articleId": articleId
  1362. },
  1363. "success": function(data) {
  1364. if(data.success) {
  1365. if(data.data>0){
  1366. $itemlist.find(".comment").text("留言 " + data.data);
  1367. }
  1368. }
  1369. },
  1370. "error": function() {
  1371. $.MsgBox.Alert('提示', '链接服务器超时')
  1372. }
  1373. });
  1374. }
  1375. //合作专家
  1376. function relevantExperts(){
  1377. $.ajax({
  1378. "url": "/ajax/professor/coadjutant",
  1379. "type": "get",
  1380. "dataType" : "json",
  1381. "data" :{"id":professorId},
  1382. "success": function(data) {
  1383. if(data.success && data.data) {
  1384. console.log(data)
  1385. for(var i = 0; i < data.data.length; i++) {
  1386. var ExpId = data.data[i].professorId;
  1387. var paperN=data.data[i].paperCount;
  1388. var patentN=data.data[i].patentCount;
  1389. var liItem=$('<li class="flexCenter"></li>').appendTo($("#relatePro"));
  1390. relExpertsList(ExpId,paperN,patentN,liItem);
  1391. }
  1392. }
  1393. },
  1394. "error": function() {
  1395. $.MsgBox.Alert('提示', '链接服务器超时')
  1396. }
  1397. });
  1398. }
  1399. //合作专家信息
  1400. function relExpertsList(Id,numL,numZ,liItem){
  1401. $.ajax({
  1402. "url" : "/ajax/professor/info/"+Id,
  1403. "type" : "GET" ,
  1404. "dataType" : "json",
  1405. "success" : function(data) {
  1406. if (data.success && data.data!=""){
  1407. $("#relatePro").parents(".conBlock").removeClass("displayNone");
  1408. var itemlist = '<a target="_blank" href="" class="urlgo">';
  1409. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  1410. itemlist += '<div class="madiaInfo">';
  1411. itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
  1412. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  1413. itemlist += '<p class="h2Font ellipsisSty" id="copNum"></p>';
  1414. itemlist += '</div></a>';
  1415. $(itemlist).appendTo(liItem);
  1416. var $itemlist =liItem;
  1417. if(numL){
  1418. if(numZ){
  1419. $itemlist.find("#copNum").text("合作:"+numZ+"项专利,"+numL+"篇论文")
  1420. }else{
  1421. $itemlist.find("#copNum").text("合作:"+numL+"篇论文")
  1422. }
  1423. }else{
  1424. if(numZ){
  1425. $itemlist.find("#copNum").text("合作:"+numZ+"项专利")
  1426. }else{
  1427. }
  1428. }
  1429. if(data.data.title) {
  1430. if(data.data.orgName) {
  1431. $itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
  1432. }else{
  1433. $itemlist.find("#usertitle").text(data.data.title);
  1434. }
  1435. }else{
  1436. if(data.data.office) {
  1437. if(data.data.orgName) {
  1438. $itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
  1439. }else{
  1440. $itemlist.find("#usertitle").text(data.data.office);
  1441. }
  1442. }else{
  1443. if(data.data.orgName) {
  1444. $itemlist.find("#usertitle").text(data.data.orgName);
  1445. }
  1446. }
  1447. }
  1448. $itemlist.find("#userName").text(data.data.name);
  1449. $itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
  1450. if(data.data.hasHeadImage == 1) {
  1451. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
  1452. }
  1453. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  1454. $itemlist.find(".authiconNew").attr("title", userType.title);
  1455. $itemlist.find(".authiconNew").addClass(userType.sty);
  1456. }
  1457. },
  1458. "error":function(){
  1459. $.MsgBox.Alert('提示','链接服务器超时')
  1460. }
  1461. });
  1462. }
  1463. //相关文章信息
  1464. function relevantarticalList(){
  1465. $.ajax({
  1466. "url" : "/ajax/article/byAssProfessor",
  1467. "type" : "GET" ,
  1468. "dataType" : "json",
  1469. "data" :{"id":professorId},
  1470. "traditional": true, //传数组必须加这个
  1471. "success" : function(data) {
  1472. console.log(data);
  1473. if (data.success && data.data!=""){
  1474. $("#relateArt").parents(".conBlock").removeClass("displayNone");
  1475. var itemlist = '';
  1476. $("#relateArt").html("");
  1477. for(var i = 0; i < data.data.length; i++) {
  1478. var itemlist = '<li class="flexCenter"><a target="_blank" href="/'+ pageUrl('a',data.data[i]) +'" class="urlgo">';
  1479. itemlist += '<p class="h2Font ellipsisSty-2"><em class="circlePre"></em>'+data.data[i].articleTitle+'</p>';
  1480. itemlist += '</a></li>';
  1481. $itemlist = $(itemlist);
  1482. $("#relateArt").append($itemlist);
  1483. }
  1484. }
  1485. },
  1486. "error":function(){
  1487. $.MsgBox.Alert('提示','链接服务器超时')
  1488. }
  1489. });
  1490. }
  1491. //感兴趣
  1492. function likeExperts(){
  1493. $.ajax({
  1494. "url": "/ajax/professor/ralateProfessors",
  1495. "type": "get",
  1496. "dataType" : "json",
  1497. "data" :{"professorId":professorId},
  1498. "success": function(data) {
  1499. if(data.success && data.data) {
  1500. console.log(data)
  1501. var lengthT;
  1502. if(data.data.length>5){
  1503. lengthT=5;
  1504. }else{
  1505. lengthT=data.data.length
  1506. }
  1507. for(var i = 0; i < lengthT; i++) {
  1508. var ExpId = data.data[i].id;
  1509. likeExpertsList(ExpId);
  1510. }
  1511. }
  1512. },
  1513. "error": function() {
  1514. $.MsgBox.Alert('提示', '链接服务器超时')
  1515. }
  1516. });
  1517. }
  1518. //感兴趣专家
  1519. function likeExpertsList(ExpId){
  1520. $.ajax({
  1521. "url" : "/ajax/professor/info/"+ExpId,
  1522. "type" : "GET" ,
  1523. "dataType" : "json",
  1524. "success" : function(data) {
  1525. if (data.success && data.data!=""){
  1526. console.log(data)
  1527. $("#likePro").parents(".conBlock").removeClass("displayNone");
  1528. var itemlist = '<li class="flexCenter"><a target="_blank" href="" class="urlgo">';
  1529. itemlist += '<div class="madiaHead useHead" id="userimg"></div>';
  1530. itemlist += '<div class="madiaInfo">';
  1531. itemlist += '<p><span class="h1Font" id="userName"></span><em class="authiconNew" title=""></em></p>';
  1532. itemlist += '<p class="ellipsisSty h2Font" id="usertitle"></p>';
  1533. itemlist += '</div></a></li>';
  1534. $itemlist = $(itemlist);
  1535. $("#likePro").append($itemlist);
  1536. if(data.data.title) {
  1537. if(data.data.orgName) {
  1538. $itemlist.find("#usertitle").text(data.data.title +","+ data.data.orgName);
  1539. }else{
  1540. $itemlist.find("#usertitle").text(data.data.title);
  1541. }
  1542. }else{
  1543. if(data.data.office) {
  1544. if(data.data.orgName) {
  1545. $itemlist.find("#usertitle").text(data.data.office +","+ data.data.orgName);
  1546. }else{
  1547. $itemlist.find("#usertitle").text(data.data.office);
  1548. }
  1549. }else{
  1550. if(data.data.orgName) {
  1551. $itemlist.find("#usertitle").text(data.data.orgName);
  1552. }
  1553. }
  1554. }
  1555. $itemlist.find("#userName").text(data.data.name);
  1556. $itemlist.find(".urlgo").attr("href", "userInforShow.html?professorId="+data.data.id);
  1557. if(data.data.hasHeadImage == 1) {
  1558. $itemlist.find("#userimg").attr("style", "background-image: url(/images/head/" + data.data.id + "_l.jpg);");
  1559. }
  1560. var userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
  1561. $itemlist.find(".authiconNew").attr("title", userType.title);
  1562. $itemlist.find(".authiconNew").addClass(userType.sty);
  1563. }
  1564. },
  1565. "error":function(){
  1566. $.MsgBox.Alert('提示','链接服务器超时')
  1567. }
  1568. });
  1569. }
  1570. //获取需求
  1571. function getDemands(pageSize, pageNo,isbind) {
  1572. $.ajax({
  1573. url: "/ajax/demand/pq",
  1574. type: "GET",
  1575. timeout: 10000,
  1576. dataType: "json",
  1577. data: {
  1578. "state":'1',
  1579. "uid":professorId,
  1580. "pageNo": pageNo,
  1581. "pageSize":pageSize
  1582. },
  1583. beforeSend: function() {
  1584. $("#showDemand").append('<img src="../images/loading.gif" class="loading" />');
  1585. },
  1586. success: function(data) {
  1587. if(data.success) {
  1588. $("#showDemand").html(" ");
  1589. var $info = data.data.data;
  1590. if($info.length > 0){
  1591. $("#showDemand").parents(".needinfobox").removeClass("displayNone");
  1592. $("#item1user>.nodatabox").addClass("displayNone");
  1593. for(var i = 0; i < $info.length; i++) {
  1594. var liStr=$("<li></li>").appendTo("#showDemand");
  1595. demandHtml($info[i],liStr);
  1596. }
  1597. // if(isbind == true) {
  1598. // $(".tcdPageCode").createPage({
  1599. // pageCount: Math.ceil(data.data.total / pageSize),
  1600. // current: data.data.data.pageNo,
  1601. // backFn: function(p) {
  1602. // demandList(false,10, p);
  1603. // }
  1604. // });
  1605. // }
  1606. }else{
  1607. $("#showDemand").parents(".needinfobox").addClass("displayNone");
  1608. }
  1609. }
  1610. $(".loading").remove();
  1611. },
  1612. error: function() {
  1613. $.MsgBox.Alert('提示', '链接服务器超时')
  1614. }
  1615. })
  1616. }
  1617. function demandHtml(dataStr,liStr) {
  1618. var sowU="";
  1619. if(dataStr.pageViews!=0){
  1620. sowU='<li><span>浏览量 '+dataStr.pageViews +'</span></li>'
  1621. }
  1622. var strCon='';
  1623. strCon+='<a class="" target="_blank" href="demandShow.html?demandId='+dataStr.id+'" class="madiaInfo">'
  1624. strCon+='<p class="h1Font ellipsisSty">'+ dataStr.title +'</p>'
  1625. strCon+='<ul class="showliTop h3Font clearfix">'
  1626. strCon+='<li><span>发布于 '+commenTime(dataStr.createTime)+'</span></li>'
  1627. strCon+= sowU
  1628. strCon+='</ul>'
  1629. strCon+='<p class="h2Font ellipsisSty-2">'+dataStr.descp+'</p>'
  1630. strCon+='<ul class="showli clearfix h3Font">'
  1631. if(dataStr.city){ strCon+='<li>所在城市:'+dataStr.city+'</li>' }
  1632. if(dataStr.duration!=0){ strCon+='<li>预期时长:'+demandDuration[dataStr.duration]+'</li>' }
  1633. if(dataStr.cost!=0){ strCon+='<li>费用预算:'+demandCost[dataStr.cost]+'</li>' }
  1634. if(dataStr.invalidDay){ strCon+='<li>有效期至:'+TimeTr(dataStr.invalidDay)+'</li>' }
  1635. strCon+='</ul>'
  1636. strCon+='</a>'
  1637. $(strCon).appendTo(liStr);
  1638. }
  1639. //收藏与关注
  1640. function attentMy(){
  1641. var num=watchType;
  1642. $.ajax({
  1643. url: "/ajax/watch/qaWatch",
  1644. dataType: 'json', //数据格式类型
  1645. type: 'GET', //http请求类型
  1646. data: {
  1647. "watchObject": professorId,
  1648. },
  1649. timeout: 10000, //超时设置
  1650. success: function(data) {
  1651. if(data.success) {
  1652. document.getElementById("attendMy").innerHTML="";
  1653. document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.add("displayNone");
  1654. if(data.data.length>0){
  1655. var datalist = data.data;
  1656. for(var i = 0; i < datalist.length; i++) {
  1657. var liItem = document.createElement("li");
  1658. liItem.className="mui-table-view-cell";
  1659. document.getElementById("attendMy").appendChild(liItem);
  1660. detailPro(datalist[i],liItem);
  1661. }
  1662. }else{
  1663. document.getElementById("attendMy").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  1664. }
  1665. }
  1666. },
  1667. error: function() {
  1668. return;
  1669. }
  1670. });
  1671. }
  1672. function collAttent(pageSize, pageNo,isbind,num){
  1673. if(!num){
  1674. var num=watchType;
  1675. }
  1676. $.ajax({
  1677. url: "/ajax/watch/qaPro",
  1678. dataType: 'json', //数据格式类型
  1679. type: 'GET', //http请求类型
  1680. data: {
  1681. "professorId": professorId,
  1682. "watchType": num,
  1683. "pageNo": pageNo,
  1684. "pageSize":pageSize
  1685. },
  1686. beforeSend: function() {
  1687. // $(".table-body").append('<img src="../images/loading.gif" class="loading" />');
  1688. $("#item8user").find(".js-load-more").attr("disabled",true);
  1689. $("#item8user").find(".js-load-more").addClass("active");
  1690. },
  1691. complete:function () {
  1692. $("#item8user").find(".js-load-more").removeAttr("disabled");
  1693. $("#item8user").find(".js-load-more").removeClass("active");
  1694. },
  1695. timeout: 10000, //超时设置
  1696. success: function(data) {
  1697. console.log(data)
  1698. var tcdPage;
  1699. if(data.success && data.data.data != "") {
  1700. var datalist = data.data.data;
  1701. if(num==1){
  1702. // document.getElementById("attendPro").innerHTML="";
  1703. for(var i = 0; i < datalist.length; i++) {
  1704. var liItem = document.createElement("li");
  1705. liItem.className="mui-table-view-cell";
  1706. document.getElementById("attendPro").appendChild(liItem);
  1707. detailPro(datalist[i],liItem);
  1708. }
  1709. }else if(num==2){
  1710. detailRes(datalist);
  1711. }else if(num==3){
  1712. detailArt(datalist);
  1713. }else if(num==4){
  1714. detailPat(datalist);
  1715. }else if(num==5){
  1716. detailPer(datalist);
  1717. }else if(num==6){
  1718. detailCmp(datalist);
  1719. }else if(num==7){
  1720. detailDemand(datalist);
  1721. }
  1722. if(isbind==true){
  1723. // tcdPage.off("click").createPage({
  1724. // pageCount: Math.ceil(data.data.total / 10),
  1725. // current: data.data.pageNo,
  1726. // backFn: function(p) {
  1727. // collAttent(10, p,false,num);
  1728. // document.body.scrollTop = document.documentElement.scrollTop = 0;
  1729. // }
  1730. // });
  1731. $("#item8user").append('<button class="js-load-more"></button>');
  1732. $("#item8user").find(".js-load-more").on("click", function () {
  1733. collAttent(10,++pageNo,false,num);
  1734. });
  1735. }
  1736. if (pageNo >= Math.ceil(data.data.total / 10)) {
  1737. $("#item8user").find(".js-load-more").unbind("click");
  1738. $("#item8user").find(".js-load-more").hide();
  1739. }
  1740. }else{
  1741. if(num==1){
  1742. document.getElementById("attendPro").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  1743. if(isbind==true) {
  1744. $("#attendPro").parent().find(".js-load-more").hide()
  1745. }
  1746. }else if(num==2){
  1747. document.getElementById("attendRes").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  1748. if(isbind==true) {
  1749. $("#attendRes").parent().find(".js-load-more").hide()
  1750. }
  1751. }else if(num==3){
  1752. document.getElementById("attendArt").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  1753. if(isbind==true) {
  1754. $("#attendArt").parent().find(".js-load-more").hide()
  1755. }
  1756. }else if(num==4){
  1757. document.getElementById("attendPatent").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  1758. if(isbind==true) {
  1759. $("#attendPatent").parent().find(".js-load-more").hide()
  1760. }
  1761. }else if(num==5){
  1762. document.getElementById("attendPaper").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  1763. if(isbind==true) {
  1764. $("#attendPaper").parent().find(".js-load-more").hide()
  1765. }
  1766. }else if(num==6){
  1767. document.getElementById("attendCmp").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  1768. if(isbind==true) {
  1769. $("#attendCmp").parent().find(".js-load-more").hide()
  1770. }
  1771. }else if(num==7){
  1772. document.getElementById("attendDemand").parentNode.querySelector(".nodatabox").classList.remove("displayNone");
  1773. if(isbind==true) {
  1774. $("#attendDemand").parent().find(".js-load-more").hide()
  1775. }
  1776. }
  1777. }
  1778. },
  1779. error: function() {
  1780. return;
  1781. }
  1782. });
  1783. }
  1784. function detailPro(datalist,liItem) {
  1785. var userType = autho(datalist.professor.authType, datalist.professor.orgAuth, datalist.professor.authStatus);
  1786. var os = "";
  1787. if(datalist.professor.title) {
  1788. if(datalist.professor.orgName) {
  1789. os = datalist.professor.title + "," + datalist.professor.orgName;
  1790. } else {
  1791. os = datalist.professor.title;
  1792. }
  1793. } else {
  1794. if(datalist.professor.office) {
  1795. if(datalist.professor.orgName) {
  1796. os = datalist.professor.office + "," + datalist.professor.orgName;
  1797. } else {
  1798. os = datalist.professor.office;
  1799. }
  1800. } else {
  1801. if(datalist.professor.orgName) {
  1802. os = datalist.professor.orgName;
  1803. }
  1804. }
  1805. }
  1806. var baImg = "../images/default-photo.jpg";
  1807. if(datalist.professor.hasHeadImage == 1) {
  1808. baImg = "/images/head/" + datalist.professor.id + "_l.jpg";
  1809. }
  1810. var strAdd = '';
  1811. strAdd += '<a target="_blank" href="userInforShow.html?professorId='+ datalist.professor.id +'" class="flexCenter urlgo">';
  1812. strAdd += '<div class="madiaHead useHead" style="width: 80px;height: 80px;margin-top: -40px;background-image:url(' + baImg + ')"></div>';
  1813. strAdd += '<div class="madiaInfo" style="padding-left:92px"><p class="h1Font ellipsisSty">' + datalist.professor.name + '</span><em class="authiconNew ' + userType.sty + '" title="科袖认证专家"></em></p>';
  1814. strAdd += '<p class="h2Font ellipsisSty">' + os + '</p>';
  1815. strAdd += '</div>';
  1816. strAdd += '</a>';
  1817. liItem.innerHTML = strAdd
  1818. }
  1819. function detailCmp(datalist) {
  1820. // document.getElementById("attendCmp").innerHTML="";
  1821. var arr=[];
  1822. for(var i in datalist) {
  1823. arr[i]=datalist[i].watchObject;
  1824. }
  1825. $.ajax({
  1826. url:"/ajax/org/qm",
  1827. data: {
  1828. id:arr,
  1829. },
  1830. dataType: 'json', //数据格式类型
  1831. type: 'get', //http请求类型
  1832. traditional: true,
  1833. success: function(data) {
  1834. if(data.success && data.data != "") {
  1835. var dataStr=data.data;
  1836. for(var i = 0; i < dataStr.length; i++) {
  1837. var li = document.createElement("li");
  1838. li.setAttribute("data-id", dataStr[i].id);
  1839. var oimg = (dataStr[i].hasOrgLogo) ?"/images/org/" + dataStr[i].id + ".jpg" : "../images/default-icon.jpg";
  1840. var oAuth = (dataStr[i].authStatus == 3) ? 'authicon-com-ok' : '';
  1841. var orgName = (dataStr[i].forShort) ? dataStr[i].forShort : dataStr[i].name;
  1842. var orgType = (dataStr[i].orgType == '2') ? "上市企业" : "";
  1843. var orgOther = (dataStr[i].industry) ? dataStr[i].industry.replace(/,/gi, " | ") : "";
  1844. li.className = "mui-table-view-cell";
  1845. var itemlist=''
  1846. itemlist += '<a class="flexCenter" target="_blank" href="cmpInforShow.html?orgId='+dataStr[i].id+'"><div class="madiaHead cmpHead">';
  1847. itemlist += '<div class="boxBlock"><img class="boxBlockimg" src="' + oimg + '"></div></div>';
  1848. itemlist += '<div class="madiaInfo">';
  1849. itemlist += '<p class="h1Font"><span>' + orgName + '</span><em class="authiconNew ' + oAuth + '" title="科袖认证企业"></em></p>';
  1850. itemlist += '<p class="h2Font ellipsisSty"><span>' + orgType + '</span> <span>' + orgOther + '</span></p>';
  1851. itemlist += '</div></a>';
  1852. li.innerHTML = itemlist
  1853. document.getElementById("attendCmp").appendChild(li);
  1854. }
  1855. }
  1856. },
  1857. error: function() {
  1858. }
  1859. });
  1860. }
  1861. function detailPat(datalist) {
  1862. // document.getElementById("attendPatent").innerHTML="";
  1863. if(datalist.length<0){
  1864. $("#attendPatent + .nodatabox").removeClass("displayNone");
  1865. return;
  1866. }
  1867. var arr=[];
  1868. for(var i in datalist) {
  1869. arr[i]=datalist[i].watchObject;
  1870. }
  1871. $.ajax({
  1872. url:"/ajax/ppatent/qm",
  1873. data: {
  1874. id:arr,
  1875. },
  1876. dataType: 'json', //数据格式类型
  1877. type: 'get', //http请求类型
  1878. traditional: true,
  1879. success: function(data) {
  1880. if(data.success && data.data != "") {
  1881. var dataStr=data.data;
  1882. for(var i = 0; i < dataStr.length; i++) {
  1883. var li = document.createElement("li");
  1884. li.className = "mui-table-view-cell";
  1885. var strAdd = '';
  1886. strAdd += '<a target="_blank" href="/'+ pageUrl("pt",dataStr[i]) +'" class="flexCenter urlgo">';
  1887. strAdd += '<div class="madiaHead patentHead"></div>';
  1888. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  1889. strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  1890. strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
  1891. strAdd += '</div>';
  1892. strAdd += '</a>';
  1893. li.innerHTML = strAdd
  1894. document.getElementById("attendPatent").appendChild(li);
  1895. }
  1896. }
  1897. },
  1898. error: function() {
  1899. }
  1900. });
  1901. }
  1902. function detailPer(datalist) {
  1903. // document.getElementById("attendPaper").innerHTML="";
  1904. var arr=[];
  1905. for(var i in datalist) {
  1906. arr[i]=datalist[i].watchObject;
  1907. }
  1908. $.ajax({
  1909. url:"/ajax/ppaper/qm",
  1910. data: {
  1911. id:arr,
  1912. },
  1913. dataType: 'json', //数据格式类型
  1914. type: 'get', //http请求类型
  1915. traditional: true,
  1916. success: function(data) {
  1917. if(data.success && data.data != "") {
  1918. var dataStr=data.data;
  1919. for(var i = 0; i < dataStr.length; i++) {
  1920. var moreInf=""
  1921. if(!dataStr[i].cn4periodical){
  1922. dataStr[i].cn4periodical="";
  1923. }
  1924. if(!dataStr[i].en4periodical){
  1925. dataStr[i].en4periodical="";
  1926. }
  1927. if(!dataStr[i].pubDay){
  1928. dataStr[i].pubDay="";
  1929. }
  1930. moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
  1931. var li = document.createElement("li");
  1932. li.className = "mui-table-view-cell";
  1933. var strAdd = '';
  1934. strAdd += '<a target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
  1935. strAdd += '<div class="madiaHead paperHead"></div>';
  1936. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
  1937. strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
  1938. strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
  1939. strAdd += '</div>';
  1940. strAdd += '</a>';
  1941. li.innerHTML = strAdd
  1942. document.getElementById("attendPaper").appendChild(li);
  1943. }
  1944. }
  1945. },
  1946. error: function() {
  1947. }
  1948. });
  1949. }
  1950. function detailRes(datalist) {
  1951. // document.getElementById("attendRes").innerHTML="";
  1952. for(var i = 0; i < datalist.length; i++) {
  1953. var dataStr = datalist[i].resource;
  1954. var namepo, userType;
  1955. if(dataStr.resourceType == 1) {
  1956. namepo = dataStr.editProfessor.name;
  1957. userType = autho(dataStr.editProfessor.authType, dataStr.editProfessor.orgAuth, dataStr.editProfessor.authStatus);
  1958. } else {
  1959. if(dataStr.organization.forShort){
  1960. namepo = dataStr.organization.forShort;
  1961. }else{
  1962. namepo = dataStr.organization.name;
  1963. }
  1964. userType={}
  1965. if(dataStr.organization.authStatus==3){
  1966. userType.sty="authicon-com-ok"
  1967. userType.title="科袖认证企业"
  1968. }
  1969. }
  1970. var rImg = "../images/default-resource.jpg";
  1971. if(dataStr.images.length) {
  1972. rImg = "/data/resource/" + dataStr.images[0].imageSrc;
  1973. }
  1974. var li = document.createElement("li");
  1975. li.className = "mui-table-view-cell";
  1976. var strAdd = '';
  1977. strAdd += '<a target="_blank" href="resourceShow.html?resourceId='+ dataStr.resourceId +'" class="flexCenter urlgo">';
  1978. strAdd += '<div class="madiaHead resouseHead" style="background-image:url('+ rImg +')"></div>';
  1979. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.resourceName +'</p>';
  1980. strAdd += '<p class="h1Font ellipsisSty">'+ namepo +'<em class="authiconNew ' + userType.sty + '" title="'+userType.title+'"></em></p>';
  1981. strAdd += '<p class="h2Font ellipsisSty-2">用途:'+ dataStr.supportedServices+'</p></div>';
  1982. strAdd += '</a>';
  1983. li.innerHTML =strAdd
  1984. document.getElementById("attendRes").appendChild(li);
  1985. }
  1986. }
  1987. function detailArt(datalist) {
  1988. // document.getElementById("attendArt").innerHTML="";
  1989. for(var i = 0; i < datalist.length; i++) {
  1990. var dataItem = datalist[i].article;
  1991. var arImg = "../images/default-artical.jpg";
  1992. if(dataItem.articleImg) {
  1993. arImg ="/data/article/" + dataItem.articleImg
  1994. }
  1995. var title = dataItem.articleTitle;
  1996. var name = ""
  1997. var li = document.createElement("li");
  1998. if( dataItem.articleType == 1) {
  1999. name = dataItem.professor.name;
  2000. } else {
  2001. if(dataItem.organization.forShort){
  2002. name = dataItem.organization.forShort;
  2003. }else{
  2004. name = dataItem.organization.name;
  2005. }
  2006. }
  2007. li.className = "mui-table-view-cell";
  2008. var strAdd = '';
  2009. strAdd += '<a target="_blank" href="/'+ pageUrl('a',dataItem) +'" class="flexCenter urlgo">';
  2010. strAdd += '<div class="madiaHead artHead" style="background-image:url('+ arImg +')"></div>';
  2011. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataItem.articleTitle +'</p>';
  2012. strAdd += '<ul class="h2Font clearfix">';
  2013. strAdd += '<li><span>'+ name +'</span></li>';
  2014. strAdd += '<li><span class="time">'+ commenTime(dataItem.publishTime) +'</span></li>';
  2015. strAdd += '<li><span class="comment"></span></li>';
  2016. strAdd += '</ul></div>';
  2017. strAdd += '</a>';
  2018. li.innerHTML = strAdd
  2019. document.getElementById("attendArt").appendChild(li);
  2020. }
  2021. }
  2022. function detailDemand(datalist) {
  2023. // document.getElementById("attendDemand").innerHTML="";
  2024. var arr=[];
  2025. for(var i in datalist) {
  2026. arr[i]=datalist[i].watchObject;
  2027. }
  2028. $.ajax({
  2029. url:"/ajax/demand/qm",
  2030. data: {
  2031. id:arr,
  2032. },
  2033. dataType: 'json', //数据格式类型
  2034. type: 'get', //http请求类型
  2035. traditional: true,
  2036. success: function(data) {
  2037. if(data.success && data.data != "") {
  2038. var dataStr=data.data;
  2039. for(var i = 0; i < dataStr.length; i++) {
  2040. var li = document.createElement("li");
  2041. li.className = "mui-table-view-cell";
  2042. var strCon='<a target="_blank" href="demandShow.html?demandId='+ dataStr[i].id +'" class="flexCenter urlgo">';
  2043. strCon+='<div class="madiaInfo" style="padding-left:0">'
  2044. strCon+='<p class="h1Font ellipsisSty">'+ dataStr[i].title +'</p>'
  2045. strCon+='<ul class="showli clearfix h3Font">'
  2046. if(dataStr[i].city){ strCon+='<li>'+dataStr[i].city+'</li>' }
  2047. if(dataStr[i].duration!=0){ strCon+='<li>预期 '+demandDuration[dataStr[i].duration]+'</li>' }
  2048. if(dataStr[i].cost!=0){ strCon+='<li>预算 '+demandCost[dataStr[i].cost]+'</li>' }
  2049. if(dataStr[i].invalidDay){ strCon+='<li>有效期至 '+TimeTr(dataStr[i].invalidDay)+'</li>' }
  2050. strCon+='</ul></div></a>'
  2051. li.innerHTML = strCon
  2052. document.getElementById("attendDemand").appendChild(li);
  2053. }
  2054. }
  2055. },
  2056. error: function() {
  2057. }
  2058. });
  2059. }
  2060. function answer(dataStr,listLi){
  2061. var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.qid+'&topid='+dataStr.id+'">'+
  2062. '<div class="madiaInfo" style="padding-left: 0">' +
  2063. '<div class="ellipsisSty qa-question"></div>' +
  2064. '<div class="flexCenter qa-owner">' +
  2065. '</div>' +
  2066. '<p class="qa-con ellipsisSty-3">' + (dataStr.cnt).replace(/\n/g,"<br />") +'</p>' +
  2067. '<div class="showspan">' +
  2068. '<span>'+commenTime(dataStr.createTime)+'</span>' +
  2069. '<span class="agree"></span>' +
  2070. '<span class="leaveMsgCount"></span>' +
  2071. '</div>' +
  2072. '</div></a>';
  2073. var $strAdd = $(strAdd);
  2074. listLi.append( $strAdd);
  2075. if(dataStr.agree > 0) {
  2076. $strAdd.find(".agree").html("赞 "+dataStr.agree);
  2077. }
  2078. questioninfo(dataStr.qid, $strAdd);
  2079. proinfo(dataStr.uid, $strAdd);
  2080. leaveMsgCount(dataStr.id, $strAdd);
  2081. }
  2082. function question(dataStr,listLi) {
  2083. var baImg = "../images/default-q&a.jpg";
  2084. var subs = new Array();
  2085. if(dataStr.img) {
  2086. if(dataStr.img.indexOf(',')) {
  2087. subs = dataStr.img.split(',');
  2088. } else {
  2089. subs[0] = dataStr.img;
  2090. }
  2091. baImg = "/data/question"+ subs[0];
  2092. }
  2093. var hd = "";
  2094. if (dataStr.replyCount > 0) {
  2095. hd = '<li><span>回答 ' + dataStr.replyCount + '</span></li>'
  2096. }
  2097. var strAdd = '<a target="_blank" href="/qa-show.html?id='+dataStr.id+'" class="flexCenter urlgo">'
  2098. strAdd += '<div class="madiaHead qa-Head" style="background-image:url('+ baImg +')"></div>';
  2099. strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty-2">'+ dataStr.title +'</p>';
  2100. strAdd += '<ul class="h2Font clearfix">'
  2101. strAdd += '<li><span class="time">'+commenTime(dataStr.createTime)+'</span></li><li><span class="qaPageview"></span></li>'+hd+'<li><span class="attendCount"></span></li>'
  2102. strAdd += '</ul></div></a>'
  2103. var $str = $(strAdd);
  2104. listLi.append($str);
  2105. attendCount(dataStr.id, $str);
  2106. questioninfo(dataStr.id, $str);
  2107. }
  2108. function proinfo(pid, $str) {
  2109. $.ajax({
  2110. "url":"/ajax/professor/baseInfo/" + pid,
  2111. "type": "GET",
  2112. "dataType": "json",
  2113. "data": {},
  2114. "success": function(data) {
  2115. if(data.success) {
  2116. var dataStr = data.data
  2117. var baImg = "../images/default-photo.jpg";
  2118. if (dataStr.hasHeadImage == 1) {
  2119. baImg = "/images/head/" + dataStr.id + "_l.jpg";
  2120. }
  2121. var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
  2122. var os = "";
  2123. if (dataStr.title) {
  2124. if (dataStr.orgName) {
  2125. os = dataStr.title + "," + dataStr.orgName;
  2126. } else {
  2127. os = dataStr.title;
  2128. }
  2129. } else {
  2130. if (dataStr.office) {
  2131. if (dataStr.orgName) {
  2132. os = dataStr.office + "," + dataStr.orgName;
  2133. } else {
  2134. os = dataStr.office;
  2135. }
  2136. } else {
  2137. if (dataStr.orgName) {
  2138. os = dataStr.orgName;
  2139. }
  2140. }
  2141. }
  2142. var str = '<div class="owner-head useHead" style="background-image:url(' + baImg + ')"></div>' +
  2143. '<div class="owner-info">' +
  2144. '<div class="owner-name"><span class="h1Font">' + dataStr.name + '</span><em class="authicon ' + userType.sty + '" title="' + userType.title + '"></em></div>' +
  2145. '<div class="owner-tit mui-ellipsis h2Font">' + os + '</div>' +
  2146. '</div>'
  2147. $str.find(".qa-owner").html(str)
  2148. }
  2149. },
  2150. "error": function() {
  2151. }
  2152. });
  2153. }
  2154. function questioninfo(qid, $str) {
  2155. $.ajax({
  2156. "url":"/ajax/question/qo",
  2157. "type": "GET",
  2158. "dataType": "json",
  2159. "data": {
  2160. id:qid
  2161. },
  2162. "success": function(data) {
  2163. if(data.success) {
  2164. $str.find(".qa-question").html(data.data.title);
  2165. if(data.data.pageViews>0){
  2166. $str.find(".qaPageview").html("阅读量 "+data.data.pageViews);
  2167. }else{
  2168. $str.find(".qaPageview").hide()
  2169. }
  2170. }
  2171. },
  2172. "error": function() {
  2173. }
  2174. });
  2175. }
  2176. function leaveMsgCount(id, $str) {
  2177. $.ajax({
  2178. "url":"/ajax/leavemsg/count",
  2179. "type": "GET",
  2180. "dataType": "json",
  2181. "data": {
  2182. sid:id,
  2183. stype: "4"
  2184. },
  2185. "success": function(data) {
  2186. if(data.success) {
  2187. if(data.data > 0) {
  2188. $str.find(".leaveMsgCount").html("留言 " + data.data);
  2189. }
  2190. }
  2191. },
  2192. "error": function() {
  2193. }
  2194. });
  2195. }
  2196. function attendCount(id, $str) {
  2197. $.ajax({
  2198. "url":"/ajax/watch/countProfessor",
  2199. "type": "GET",
  2200. "dataType": "json",
  2201. "data": {
  2202. id:id,
  2203. type: 8
  2204. },
  2205. "success": function(data) {
  2206. if(data.success) {
  2207. if(data.data > 0) {
  2208. $str.find(".attendCount").html("关注 "+data.data);
  2209. }
  2210. }
  2211. },
  2212. "error": function() {
  2213. }
  2214. });
  2215. }
  2216. //纠错反馈
  2217. $(".correctSubmit").on("click",function(){
  2218. var cntCon=$(this).siblings(".correctCon").val();
  2219. var cntUser="";
  2220. if(userid && userid != null && userid != "null") {
  2221. cntUser = userid;
  2222. }
  2223. if(cntCon.length>500){
  2224. $.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
  2225. return;
  2226. }else{
  2227. $.ajax({
  2228. "url": "/ajax/feedback/error/professor",
  2229. "type": "POST",
  2230. "dataType": "json",
  2231. "async": true,
  2232. "data": {
  2233. "id": professorId,
  2234. "cnt":cntCon,
  2235. "user":cntUser
  2236. },
  2237. "success": function(data) {
  2238. if(data.success) {
  2239. backSuccessed();
  2240. }
  2241. },
  2242. "error": function() {
  2243. $.MsgBox.Alert('提示', '链接服务器超时')
  2244. }
  2245. });
  2246. }
  2247. })
  2248. })