Selaa lähdekoodia

朋涛
1.最新咨询最新回复图片ok,专家修改页面的专家个人信息完善
2.专家页面,模块没数据就不显示在页面上,没有登陆,咨询,跳转登陆页面

xiaoai_123 8 vuotta sitten
vanhempi
commit
243b490a10

+ 1 - 1
src/main/webapp/css/index.css

@ -193,7 +193,7 @@ input[type='radio'].radio:checked + .radio {background:url(../images/redio.png)
193 193
.coulstblock .coulstbox{display:block; width:200px; height:100px; padding:10px; background:rgba(256,256,256,.9); border:1px solid #ccc; border-radius:4px 4px 0 0; box-shadow: -3px -2px 8px -1px rgba(0,0,0,0.2); cursor: pointer;}
194 194
.coulstblock .coulstbox .prohead{ width:80px; height:80px; border-radius:50%; overflow:hidden;}
195 195
.coulstblock .coulstbox .coulstbtn{padding:24px 10px; margin-left:10px;}
196
.coulstblock .coulstbox .coulstbtn span{padding:4px 10px; display:block; width:60px; border-radius:2px; text-align:center; color:#fff; background:#ff8400;}
196
.coulstblock .coulstbox .coulstbtn span,#conbtn span{padding:4px 10px; display:block; width:60px; border-radius:2px; text-align:center; color:#fff; background:#ff8400;cursor:pointer}
197 197
/*专家信息头部*/
198 198
.information-head{ width:1050px; margin:auto;background:#fff; border:1px  solid #eaeaea; margin-top:30px; overflow:hidden; padding:20px 50px;}
199 199
.head-left{ float:left;width:200px; height:200px; border-radius:50%;position:relative;overflow:hidden;}

+ 5 - 5
src/main/webapp/information-brow.html

@ -65,13 +65,13 @@
65 65
			<div class="head-center">
66 66
				<div class="infor-browse">
67 67
					<a href="#" class="named" id="nameS"></a><a href="#" class="modify"></a>
68
					<div class="position" id="titleS"></div>
69
					<div class="science" id="orgNameS"></div>
70
					<div class="industry" id="industryS"></div>
68
					<div class="position" ><span id="office"></span ><span id="titleS"></span ></div>				
69
					<div class="science"><span id="industryS"></span ><span id="orgNameS"></span ></div>			
70
					<div class="address" id="address"></div>					
71 71
				</div>
72

72
				<div class="coulstbtn floatL" id="conbtn"><span>咨询</span></div>
73 73
			</div>
74
			<div class="head-right"><a href="" id="organ"><img id="orgImage"></a></div>
74
			<div class="head-right"><a  id="organ"><img id="orgImage"></a></div>
75 75
		</div>
76 76
		<div class="information-content">
77 77
			<div class="content-left" >

+ 11 - 5
src/main/webapp/information.html

@ -53,9 +53,9 @@
53 53
			<div class="head-center">
54 54
				<div class="infor-browse">
55 55
					<a href="#" class="named" id="nameS"></a><a href="#" class="modify"></a><a class="edit" ></a>
56
					<div class="position" id="titleS"></div>
57
					<div class="science" id="orgNameS"></div>
58
					<div class="industry" id="industryS"></div>
56
					<div class="position" ><span id="office"></span ><span id="titleS"></span ></div>				
57
					<div class="science"><span id="industryS"></span ><span id="orgNameS"></span ></div>			
58
					<div class="address" id="address"></div>
59 59
				</div>
60 60
				<div class="modifybox">
61 61
				<div class="infor">
@ -67,7 +67,12 @@
67 67
					</div>
68 68

69 69
				</div>
70

70
				<div class="infor">
71
					<span>职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位</span>
72
					<input type="text" class="input-txt" id="officeRevise">
73
					<span>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;址</span>
74
					<input type="text" class="input-txt" id="addressRevise">
75
				</div>
71 76
				<div class="infor">
72 77
					<span>部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门</span>
73 78
					<input type="text" class="input-txt" id="department">
@ -80,7 +85,8 @@
80 85
				</div>
81 86
				</div>
82 87
			</div>
83
		<div class="head-right"><a href="organization-brow.html"><img id="orgImage"></a></div>
88
			<!-- href="organization-brow.html" -->
89
		<div class="head-right"><a ><img id="orgImage"></a></div>
84 90
		</div>
85 91
		<div class="information-content">
86 92
			<div class="content-left" >

+ 80 - 18
src/main/webapp/js/information.brow.js

@ -243,8 +243,21 @@ loginStatus();//读取用户头像
243 243
						if ($info) {
244 244
							//展示专家的信息
245 245
							$("#nameS").text($info.name);
246
							$("#titleS").text($info.title);
247
							$("#orgNameS").text($info.orgName);
246
							if($info.office) {
247
								$("#office").text($info.office+",");
248
							}
249
							if($info.title) {
250
								$("#titleS").text($info.title);	
251
							}
252
							if($info.department) {
253
								$("#industryS").text($info.department+",");
254
							}
255
							if($info.orgName) {
256
								$("#orgNameS").text($info.orgName);
257
							}
258
							if($info.address) {
259
								$("#address").text($info.address);
260
							}																			
248 261
							$("#headImage").attr("src","/images/head/"+professorId+"_l.jpg");
249 262
								$("#headImage").load(function(){									
250 263
								})
@ -266,40 +279,83 @@ loginStatus();//读取用户头像
266 279
							//$("#organ").attr("href","organization-brow.html?orgId="+$info.orgId+"");
267 280
							//console.log($info.orgId);
268 281
							$("#orgName").val($info.orgName);
269
							$("#department").val($info.department);
270
							$("#descp").val($info.descp);
271
							//展示专家的学科
272
							subjectShow($info.subject);
273
							//研究方向
274
							if ($info.researchAreas) {
282
							$("#department").val($info.department);														
283
							if($info.descp==undefined&&$info.subject==undefined&&$info.researchAreas.length ==0&&$info.industry==undefined&&$info.edus.length ==0&&$info.jobs.length ==0&&$info.projects.length==0&&$info.papers.length ==0&&$info.patents.length ==0&&$info.honors.length ==0){								
284
								$("div:contains('专家信息')").parents(".menublock").hide();
285
							}
286
							if($info.descp){
287
								$("#descp").val($info.descp);
288
							}else{
289
								$("span:contains('个人简介')").parents(".introduction").hide();
290
								$("a:contains('个人简介')").hide();
291
							}
292
							
293
							//展示专家的学科							
294
							if($info.subject){
295
								subjectShow($info.subject);
296
							}else{
297
								$("span:contains('学术领域')").parents(".introduction").hide();
298
								$("a:contains('学术领域')").hide();
299
							}
300
							
301
							//研究方向						
302
							if ($info.researchAreas.length) {
275 303
								researchAreaShow($info.researchAreas,$info.researchAreaLogs);
304
							}else{							
305
								$("span:contains('研究方向')").parents(".introduction").hide();
306
								$("a:contains('研究方向')").hide();
276 307
							}
277
							//展示专家的行业
278
							industryShow($info.industry);
279
							//教育北京
280
							if ($info.edus) {
308
							//展示专家的行业							
309
							if($info.industry){
310
								industryShow($info.industry);
311
							}else{
312
								$("span:contains('应用行业')").parents(".introduction").hide();
313
								$("a:contains('应用行业')").hide();
314
							}
315
							
316
							//教育北京						
317
							if ($info.edus.length) {
281 318
								eduBgShow($info.edus);
282 319
							}
320
							else{
321
								$("span:contains('教育背景')").parents(".introduction").hide();
322
								$("a:contains('教育背景')").hide();
323
							}
283 324
							//兼职
284
							if ($info.jobs) {
325
							if ($info.jobs.length) {
285 326
								timeJobShow($info.jobs);
327
							}else{
328
								$("span:contains('社会兼职')").parents(".introduction").hide();
329
								$("a:contains('社会兼职')").hide();
286 330
							}
287 331
							//项目
288
							if ($info.projects) {
332
							if ($info.projects.length) {
289 333
								projectShow($info.projects)
334
							}else{
335
								$("span:contains('项目经历')").parents(".introduction").hide();
336
								$("a:contains('项目经历')").hide();
290 337
							}
291 338

292 339
							//论文
293
							if ($info.papers) {
340
							if ($info.papers.length) {
294 341
								paperShow($info.papers);
342
							}else{
343
								$("span:contains('著作、论文、文章')").parents(".introduction").hide();
344
								$("a:contains('著作、论文、文章')").hide();								
295 345
							}
296 346
							//专利
297
							if ($info.patents) {
347
							if ($info.patents.length) {
298 348
								patentShow($info.patents);
349
							}else{
350
								$("span:contains('专利')").parents(".introduction").hide();
351
								$("a:contains('专利')").hide();	
299 352
							}
300 353
							//荣誉
301
							if ($info.honors) {
354
							if ($info.honors.length) {
302 355
								honorShow($info.honors);
356
							}else{
357
								$("span:contains('荣誉及奖项')").parents(".introduction").hide();
358
								$("a:contains('获奖')").hide();	
303 359
							}
304 360
							 
305 361
					//下滑滚动不覆盖底部 
@ -381,6 +437,8 @@ $(".subsidebar").click(function(){
381 437
			if(data.data.length==0){
382 438
				$("#infor-browse").css("display","none");
383 439
				$(".resoubtn").css("display","none");
440
				$("span:contains('科研资源')").parents(".introduction").hide();
441
				$("a:contains('科研资源')").hide();
384 442
			}
385 443
			if(data.data.length > 0 && data.data.length <= 3){
386 444
				$("#infor-browse").css("display","block");
@ -614,7 +672,11 @@ $(".subsidebar").click(function(){
614 672
	
615 673

616 674
 	
617
	function consultHandler(){
675
	function consultHandler() {		
676
			if( userid=="null"){
677
			$.MsgBox.Alert("message","请先登录");
678
			location.href="login.html";
679
		}
618 680
		ConsultApply();
619 681
		//点击的发送
620 682
		$("#sendConsultBtn").click(function(){

+ 60 - 8
src/main/webapp/js/information.js

@ -150,8 +150,22 @@ $(function(){
150 150
		if ($info) {
151 151
			//展示专家的信息
152 152
			$("#nameS").text($info.name);
153
			$("#titleS").text($info.title);
154
			$("#orgNameS").text($info.orgName);
153
			if($info.office) {
154
				$("#office").text($info.office+",");
155
			}
156
			if($info.title) {
157
				$("#titleS").text($info.title);	
158
			}
159
			if($info.department) {
160
				$("#industryS").text($info.department+",");
161
			}
162
			if($info.orgName) {
163
				$("#orgNameS").text($info.orgName);
164
			}
165
			if($info.address) {
166
				$("#address").text($info.address);
167
			}					
168
			
155 169
			$("#headImage").attr("src", "/images/head/" + userid + "_l.jpg");
156 170
			$("#headImage").load(function() {})
157 171
				.error(function() {
@ -168,7 +182,9 @@ $(function(){
168 182
			$("#title").val($info.title);
169 183
			$("#orgId").val($info.orgId);
170 184
			$("#orgName").val($info.orgName);
171
			$("#department").val($info.department);
185
			$("#department").val($info.department);			
186
			$("#officeRevise").val($info.office);
187
			$("#addressRevise").val($info.address);
172 188
			$("#descp").val($info.descp);
173 189
			//展示专家的学术领域
174 190
			subjectShow($info.subject);
@ -263,7 +279,8 @@ $("#saveProfessor").on("click",function () {
263 279
	$data.orgName = $("#orgName").val();
264 280
	$data.title = $("#title").val();
265 281
	$data.department = $("#department").val();
266
	console.log($data);
282
	$data.address=$("#addressRevise").val();
283
	$data.office=$("#officeRevise").val();	
267 284
	var userid = $.cookie("userid");
268 285
	if (userid) {
269 286
		$data.id = userid;
@ -271,11 +288,46 @@ $("#saveProfessor").on("click",function () {
271 288
	$.ajax({"url" : "../ajax/professor",
272 289
		"type" : userid ? "PUT" : "POST",
273 290
		"success" : function(rdata) {
274
			console.log(rdata);
291
			
275 292
			if (rdata.success) {
276 293
				if (userid) {
277
					location.reload(true);
278
				} else {
294
				  	$.get("/ajax/professor/info/" + userid, function($data) {
295
				  		if ($data.success) {		
296
				  			var $info = $data.data;
297
				  			if ($info) {
298
				  				//展示专家的信息
299
				  				$(".modifybox").css("display","none");
300
				  				$(".infor-browse").css("display","block");
301
				  							$("#nameS").text($info.name);
302
				  							if($info.office) {
303
				  								$("#office").text($info.office+",");
304
				  							}
305
				  							if($info.title) {
306
				  								$("#titleS").text($info.title);	
307
				  							}
308
				  							if($info.department) {
309
				  								$("#industryS").text($info.department+",");
310
				  							}
311
				  							if($info.orgName) {
312
				  								$("#orgNameS").text($info.orgName);
313
				  							}
314
				  							if($info.address) {
315
				  								$("#address").text($info.address);
316
				  							}														
317
				  							//显示专家信息到保存数据
318
				  							$("#name").val($info.name);
319
				  							$("#title").val($info.title);
320
				  							$("#orgId").val($info.orgId);
321
				  							$("#orgName").val($info.orgName);
322
				  							$("#department").val($info.department);
323
				  							$("#officeRevise").val($info.office);
324
				  							$("#addressRevise").val($info.address);
325
				  					}
326
				  				}
327

328
				  		})
329
				}
330
				else {
279 331
					location.href = "information.html?id="+ rdata.data;
280 332
				}
281 333
			} else {
@ -988,7 +1040,7 @@ $("#honorList").on("click",".hon .remove",function(){
988 1040
function getProfessorData(){
989 1041
	$.get("/ajax/professor/info/" + userid, function($data) {
990 1042
	if ($data.success) {
991
		console.log($data)
1043
		
992 1044
	}
993 1045
	});
994 1046
}

+ 13 - 2
src/main/webapp/js/workindex.js

@ -12,10 +12,11 @@ $(function(){
12 12
			$("#nameS").text(data.data.name);
13 13
			$("#allConsultCount").text(data.data.consultCount);
14 14
			if(data.data.authentication){
15
				$(".modifyicon")[0].src="modifyicon"
15
				$(".modifyicon")[0].src="images/rz.png"
16 16
			}
17 17
			else{
18
				$(".modifyicon").hide();
18
				$(".modifyicon")[0].src="images/rz.png";
19
				$(".modifyicon").css("background","rgba(0,0,0,0.2)")
19 20
			}
20 21
			if(data.data.office) {
21 22
				$("#office").text(data.data.office+",");
@ -816,6 +817,11 @@ $(function(){
816 817
								+ newConsultData["createTime"].substr(8,2)+ ":" +newConsultData["createTime"].substr(10,2));
817 818
						$("#myFlatConsultTitle").html(newConsultData["consultTitle"]);
818 819
						$("#myFlatConsultContent").html(newConsultData["consultContant"]);
820
						if(response.data.professor.hasHeadImage){
821
							$("#proImage").attr("src","images/head/"+response.data.professor.id+"_m.jpg");
822
						}else{
823
							$("#proImage").attr("src","images/default-photo.jpg");
824
						}
819 825
					}
820 826
					else {
821 827
						$("#wbcon1").empty("");
@ -873,6 +879,11 @@ $(function(){
873 879
						$("#myFlatRelpyTitle").html(newReplyData["consult"]["consultTitle"]);
874 880
						
875 881
						$("#myFlatRelpyContent").html(newReplyData["tidingsContant"]);
882
						if(response.data.professor.hasHeadImage){
883
							$("#proreplayImage").attr("src","images/head/"+response.data.professor.id+"_m.jpg");
884
						}else{
885
							$("#proreplayImage").attr("src","images/default-photo.jpg");
886
						}
876 887
					}
877 888
					else {		$("#wbcon2").empty("")
878 889
							var height=$("#wbcon1").height();							

+ 2 - 2
src/main/webapp/workindex.html

@ -45,7 +45,7 @@
45 45
                    <div class="worktit">最新咨询<a class="worklinkbtn floatR" id="lookAllConsult">查看全部</a></div>
46 46
                    <div class="wbcon" id="wbcon1">
47 47
                        <div class="leftwb floatL">
48
                            <a href="" class="wbimg"><img src="images/default-photo.jpg" width="100%" height="100%"></a>
48
                            <a href="" class="wbimg"><img src="" width="100%" height="100%" id="proImage"></a>
49 49
                            <p id="myFlatProName">专家姓名</p>
50 50
                            <p id="myFlatProTitle"><span id="myReplyProOffice"></span><span id="myReplyProTitle"></span></p>
51 51
                            <p id="myFlatProDepartment"><span id="myReplyProDepartment"></span><span id="myReplyProOrgName"></p>
@ -70,7 +70,7 @@
70 70
                    <div class="worktit">最新回复<a class="worklinkbtn floatR" id="lookAllReply">查看全部</a></div>
71 71
                    <div class="wbcon" id="wbcon2">
72 72
                        <div class="leftwb floatL">
73
                            <a href="" class="wbimg"><img src="images/default-photo.jpg" width="100%" height="100%"></a>
73
                            <a href="" class="wbimg"><img src="" width="100%" height="100%" id="proreplayImage"></a>
74 74
                            <p id="myFlatReplyProName">专家姓名</p>
75 75
                            <p id="myFlatReplyProTitle"><span id="myProOffice"></span><span id="myProTitle"></span></p>
76 76
                            <p id="myFlatReplyProDepartment"><span id="myProDepartment"></span><span id="myProOrgName"></p>