Parcourir la Source

1.咨询列表专家信息字符bug
2.资源浏览中,科研资源中咨询默认样式以及头像bug
3.资源列表中,咨询专家信息bug
4.咨询列表中,用户身份认证标识

wangaidan 8 ans auparavant
Parent
commit
4fc4b0178b

+ 2 - 3
src/main/webapp/js/common.js

@ -277,13 +277,12 @@ function concultProInfo(professorId){
277 277
					$("#proModify").removeClass("displayNone");
278 278
				}
279 279
				
280
				//没有头像
280
				//头像
281 281
				if(myData["hasHeadImage"] == 0){
282 282
					$("#prohead").attr("src","images/default-photo.jpg");
283 283
				}
284
				//有头像
285 284
				else {
286
					$("#prohead").attr("src","images/head/"+myData["id"]+"_m.jpg");
285
					$("#prohead").attr("src","images/head/"+myData["id"]+"_l.jpg");
287 286
				}
288 287
				
289 288
				

+ 130 - 187
src/main/webapp/js/consult.js

@ -26,202 +26,145 @@ function handleData(data,attrParams,btnCls){
26 26
	for(var i = 0; i < data.length;i++){
27 27
		//text:回复/查看,state:进行中/已完成/未评价,photoUrl:头像地址,proModify:专家认证
28 28
		var text,state,stateStyle,photoUrl,proModify;
29
		var modifyclass = '';
30
		if(data[i]["professor"]){//过滤没有专家对象的数据
29 31
		
30
		if(data[i]["professor"]){
31
			
32
		
33
		
34
		if(data[i]["consultStatus"] == 0){
35
			state = "进行中";
36
			stateStyle = 'status-1';
37
			text = '回复';
38
		} else if (data[i]["consultStatus"] == 1) {
39
			text = "查看";
40
			state = "已完成";
41
			stateStyle = 'status-3';
42
			if(attrParams == 'consultId'){
43
				if(data[i]["assessStatus"] == 0){
44
					state = "待评价";
45
					stateStyle = 'status-2';
46
				}
47
			} 
48
		}else if(data[i]["consultStatus"] == undefined){
49
			text = "";
50
			state = "";
51
		}
52
		//数据为空时
53
		if(data[i]["professor"] == undefined || data[i]["professor"] == null || data[i]["professor"] == ''){
54
			return ;
55
		}
56
		
57
		/*if(data[i]["professor"]["title"] == undefined || data[i]["professor"]["title"] == null || data[i]["professor"]["title"] == ''){
58
			title = '';
59
		}else {
60
			title = data[i]["professor"]["title"];
61
		}
62
		if(data[i]["professor"]["office"] == undefined || data[i]["professor"]["office"] == null || data[i]["professor"]["office"] == ''){
63
			office = '';
64
		}else {
65
			if(data[i]["professor"]["title"] != ''){
66
				office = ',' + data[i]["professor"]["office"];
67
			}else {
68
				office = data[i]["professor"]["office"];
69
			}
70
		}
71
		if(data[i]["professor"]["orgName"] == undefined || data[i]["professor"]["orgName"] == null || data[i]["professor"]["orgName"] == ''){
72
			orgName = '';
73
		}else {
74
			if(data[i]["professor"]["office"] != ''){
75
				orgName = ',' + data[i]["professor"]["orgName"];
76
			}else {
77
				orgName =  data[i]["professor"]["orgName"];
32
			if(data[i]["consultStatus"] == 0){
33
				state = "进行中";
34
				stateStyle = 'status-1';
35
				text = '回复';
36
			} else if (data[i]["consultStatus"] == 1) {
37
				text = "查看";
38
				state = "已完成";
39
				stateStyle = 'status-3';
40
				if(attrParams == 'consultId'){
41
					if(data[i]["assessStatus"] == 0){
42
						state = "待评价";
43
						stateStyle = 'status-2';
44
					}
45
				} 
46
			}else if(data[i]["consultStatus"] == undefined){
47
				text = "";
48
				state = "";
78 49
			}
79 50
			
80
		}
81
		if(data[i]["professor"]["department"] == undefined || data[i]["professor"]["department"] == null || data[i]["professor"]["department"] == ''){
82
			department = '';
83
		}else {
84
			if(data[i]["professor"]["orgName"] != ''){
85
				department = ',' + data[i]["professor"]["department"];
86
			}else {
87
				department = data[i]["professor"]["department"];
51
			
52
			//专家头像
53
			if(data[i]["professor"]["hasHeadImage"] == 0){
54
				photoUrl = "images/default-photo.jpg"
55
				
56
			}else{
57
				photoUrl = "images/head/"+data[i]["professor"]["id"]+"_l.jpg"
58
				
59
			};
60
			//认证
61
			if(data[i]["professor"]["authentication"] == true){
62
				proModify = "display:inline-block;"
63
			}else{
64
				proModify = "display:none;"
88 65
			}
89
		}
90
		
91
		if(data[i]["professor"]["address"] == undefined || data[i]["professor"]["address"] == null || data[i]["professor"]["address"] == ''){
92
			address  = '';
93
		}else {
66
			console.log(data[i]["professor"]);
94 67
			
95
			address = ' | ' + data[i]["professor"]["address"];
96
		}*/
97
		
98
		//专家头像
99
		if(data[i]["professor"]["hasHeadImage"] == 0){
100
			photoUrl = "images/default-photo.jpg"
68
			if(data[i]["professor"].authType) {//专家
69
				modifyclass = 'authicon authicon-cu';
70
         									
71
			} else {//普通用户
72
				if(data[i]["professor"].authStatus) {//身份已认证
73
					if(data[i]["professor"].authentication == 1) {//科研工作者
74
						modifyclass = "authicon2 authicon-mana";
75
																
76
					} else if(data[i]["professor"].authentication == 2) {//企业专家
77
						modifyclass = "authicon2 authicon-staff";			
78
						
79
					} else {//学生
80
						modifyclass = "authicon2 authicon-stu";
81
														
82
					}
83
				}else{//身份未认证
84
					
85
				}
86
				
87
			};
101 88
			
102
		}else{
103
			photoUrl = "images/head/"+data[i]["professor"]["id"]+"_l.jpg"
104 89
			
105
		};
106
		//认证
107
		if(data[i]["professor"]["authentication"] == true){
108
			proModify = "display:inline-block;"
109
		}else{
110
			proModify = "display:none;"
111
		}
112
		
113
114
		//未读消息
115
		var unread = unreadConsultFn (userid,data[i]["consultId"],i);
116
		
117
		htmlStr += "<div class='workselectitem' id='" +data[i]["consultId"] +"' >" +
118
				"<table width='100%'><tbody><tr><td width='14%' class='messagebox'>" +
119
							"<a class='workhead workitimg headRadius'>" +
120
								"<img class='headPhoto' src='"+photoUrl+"'  width='100%' height='100%'>" +
121
							"</a>" +
122
							"<span class='msgprompt showUnreadMsg' style='"+unread.style+"' id='" +data[i]["consultId"] +"'>"+unread.unreadCount+"</span>" +
123
						"</td>" +
124
						"<td style='position:relative;top:20px;' width='86%'>" +
125
						"<div class='workinfor worksitcon'><h4><a class='named' id='nameS'> " + data[i]["professor"]["name"] +" </a>"+
126
						 "<img class='modifyicon' style='"+proModify+"' src='images/onauth.png'><input type='text' class='assessStar' value='"+data[i]["assessStar"] +"' style='display: none;'></h4><h6>";
127
							
128
							if(data[i]["professor"]["title"]){
129
								htmlStr +="<span>" + data[i]["professor"]["title"] +"</span>, ";
130
							};
131
							if(data[i]["professor"]["office"]){
132
								htmlStr +="<span>"+data[i]["professor"]["office"]+"</span>, ";
133
								};
134
							if(data[i]["professor"]["orgName"]){
135
								htmlStr += "<span>"+data[i]["professor"]["orgName"] +"</span>, ";
136
							};
137
							if(data[i]["professor"]["department"]){
138
								htmlStr += "<span>"+data[i]["professor"]["department"] +"</span>";
139
							};
140
							if(data[i]["professor"]["address"]){
141
								htmlStr += ' | '+ "<span>"+data[i]["professor"]["address"]+"</span>";
142
							};
143
							htmlStr += "</h6><h6>"+
144
								"<span>咨询主题:<em> " + data[i]["consultTitle"] +"  </em></span>" +
145
									"&nbsp;&nbsp;&nbsp;&nbsp;" +
146
									"<span>咨询类型:<em> " + data[i]["consultType"] +"  </em></span>" +
147
									"&nbsp;&nbsp;&nbsp;&nbsp;<span>" +
148
									"咨询发起时间:<em>  " +
149
									data[i]["createTime"].substr(0,4) + "-" + data[i]["createTime"].substr(4,2) + "-" + data[i]["createTime"].substr(6,2) + " " + data[i]["createTime"].substr(8,2)+ ":" +data[i]["createTime"].substr(10,2)+
150
									"</em>" +
151
									"</span></h6>" +
152
									"<p style='margin-top:5px;'><span class='lasttime'>   " +
153
									lastReplyFn(userid,data[i]["consultId"])["lastReplyTime"]+
154
									" </span>" +
155
									"</p>" +
156
									"<p class='rebackcon lastReplyCon' >"+lastReplyFn(userid,data[i]["consultId"])["lastReplyCon"]+"</p>" +
157
									"</div>" +
158
									"<div class='workhandle'>" +
159
										"<div class='rightopert floatR'>" +
160
											"<span   attrP='"+attrParams+"' class='replybtn "+btnCls+"' id='"+ data[i]["consultId"]+"' consultStatus='"+ data[i]["consultStatus"]+"' assess='"+ data[i]["assessStatus"]+ "' thanks='"+ data[i]["thanksStatus"]+
161
											"' onclick='clickLookBtn2(\""+userid+"\",\""+attrParams+"\",\""+data[i]["consultId"]+"\","+data[i]["consultStatus"]+","+data[i]["assessStatus"]+","+data[i]["thanksStatus"]+");'>" +
162
											text +
163
											"</span>" +
164
											"<span class='moreopert complain'>...</span>" +
165
											"<ul class='moreopertbtn'>" +
166
												"<li>投诉</li>" +
167
											"</ul>" +
168
										"</div>" +
169
										"<div class='leftstate floatR'>" +
170
											"<span class='coultstate  "+stateStyle+"'><i>"+state+"</i></span>" +
171
										"</div>" +
172
									"</div>" +
173
								"</td>" +
174
							"</tr></tbody></table>" +
175
		"</div>";
176
		
177
		/*htmlStr += 
178
			"<div class='workselectitem' id='" +data[i]["consultId"] +"' >" +
179
				"<table width='100%'>" +
180
					"<tbody><tr>" +
181
						"<td width='14%' class='messagebox'>" +
182
							"<a class='workhead workitimg headRadius'>" +
183
								"<img class='headPhoto' src='"+photoUrl+"'  width='100%' height='100%'>" +
184
							"</a>" +
185
							"<span class='msgprompt showUnreadMsg' style='"+unread.style+"' id='" +data[i]["consultId"] +"'>"+unread.unreadCount+"</span>" +
186
						"</td>" +
187
						"<td style='position:relative;top:20px;' width='86%'>" +
188
							"<div class='workinfor worksitcon'>" +
189
								"<h4><a class='named' id='nameS'> " + data[i]["professor"]["name"] +" </a><img class='modifyicon' style='"+proModify+"' src='images/onauth.png'><input type='text' class='assessStar' value='"+data[i]["assessStar"] +"' style='display: none;'></h4>" +
190
								"<h6><span>" + title +"</span><span>"+office+"</span><span>"+orgName +"</span><span>"+department +"</span><span>"+address+"</span></h6>" +
191
								"<h6>"+
192
								"<span>咨询主题:<em> " + data[i]["consultTitle"] +"  </em></span>" +
193
									"&nbsp;&nbsp;&nbsp;&nbsp;" +
194
									"<span>咨询类型:<em> " + data[i]["consultType"] +"  </em></span>" +
195
									"&nbsp;&nbsp;&nbsp;&nbsp;<span>" +
196
									"咨询发起时间:<em>  " +
197
									data[i]["createTime"].substr(0,4) + "-" + data[i]["createTime"].substr(4,2) + "-" + data[i]["createTime"].substr(6,2) + " " + data[i]["createTime"].substr(8,2)+ ":" +data[i]["createTime"].substr(10,2)+
198
									"</em>" +
199
									"</span></h6>" +
200
									"<p style='margin-top:5px;'><span class='lasttime'>   " +
201
									lastReplyFn(userid,data[i]["consultId"])["lastReplyTime"]+
202
									" </span>" +
203
									"</p>" +
204
									"<p class='rebackcon lastReplyCon' >"+lastReplyFn(userid,data[i]["consultId"])["lastReplyCon"]+"</p>" +
205
									"</div>" +
206
									"<div class='workhandle'>" +
207
										"<div class='rightopert floatR'>" +
208
											"<span   attrP='"+attrParams+"' class='replybtn "+btnCls+"' id='"+ data[i]["consultId"]+"' consultStatus='"+ data[i]["consultStatus"]+"' assess='"+ data[i]["assessStatus"]+ "' thanks='"+ data[i]["thanksStatus"]+
209
											"' onclick='clickLookBtn2(\""+userid+"\",\""+attrParams+"\",\""+data[i]["consultId"]+"\","+data[i]["consultStatus"]+","+data[i]["assessStatus"]+","+data[i]["thanksStatus"]+");'>" +
210
											text +
211
											"</span>" +
212
											"<span class='moreopert complain'>...</span>" +
213
											"<ul class='moreopertbtn'>" +
214
												"<li>投诉</li>" +
215
											"</ul>" +
90
			
91
			
92
			
93
			
94
			
95
	
96
			//未读消息
97
			var unread = unreadConsultFn (userid,data[i]["consultId"],i);
98
			
99
			htmlStr += "<div class='workselectitem' id='" +data[i]["consultId"] +"' >" +
100
					"<table width='100%'><tbody><tr><td width='14%' class='messagebox'>" +
101
								"<a class='workhead workitimg headRadius'>" +
102
									"<img class='headPhoto' src='"+photoUrl+"'  width='100%' height='100%'>" +
103
								"</a>" +
104
								"<span class='msgprompt showUnreadMsg' style='"+unread.style+"' id='" +data[i]["consultId"] +"'>"+unread.unreadCount+"</span>" +
105
							"</td>" +
106
							"<td style='position:relative;top:20px;' width='86%'>" +
107
							"<div class='workinfor worksitcon'><h4><a class='named' id='nameS'> " + data[i]["professor"]["name"] +" </a>"+
108
							 "<a class='modifyicon "+modifyclass+"'></a><input type='text' class='assessStar' value='"+data[i]["assessStar"] +"' style='display: none;'></h4><h6>";
109
								
110
								if(data[i]["professor"]["title"]){
111
									htmlStr +="<span>" + data[i]["professor"]["title"] +"</span>, ";
112
								};
113
								if(data[i]["professor"]["office"]){
114
									if(data[i]["professor"]["orgName"] || data[i]["professor"]["department"]){
115
										htmlStr +="<span>"+data[i]["professor"]["office"]+"</span>, ";
116
									}else{
117
										htmlStr +="<span>"+data[i]["professor"]["office"]+"</span>";
118
										}
119
									
120
								};
121
								if(data[i]["professor"]["orgName"]){
122
									if(data[i]["professor"]["department"]){
123
										htmlStr += "<span>"+data[i]["professor"]["orgName"] +"</span>, ";
124
									}else{
125
										htmlStr += "<span>"+data[i]["professor"]["orgName"] +"</span>";
126
									}
127
									
128
								};
129
								if(data[i]["professor"]["department"]){
130
									htmlStr += "<span>"+data[i]["professor"]["department"] +"</span>";
131
								};
132
								if(data[i]["professor"]["address"]){
133
									htmlStr += ' | '+ "<span>"+data[i]["professor"]["address"]+"</span>";
134
								};
135
								htmlStr += "</h6><h6>"+
136
									"<span>咨询主题:<em> " + data[i]["consultTitle"] +"  </em></span>" +
137
										"&nbsp;&nbsp;&nbsp;&nbsp;" +
138
										"<span>咨询类型:<em> " + data[i]["consultType"] +"  </em></span>" +
139
										"&nbsp;&nbsp;&nbsp;&nbsp;<span>" +
140
										"咨询发起时间:<em>  " +
141
										data[i]["createTime"].substr(0,4) + "-" + data[i]["createTime"].substr(4,2) + "-" + data[i]["createTime"].substr(6,2) + " " + data[i]["createTime"].substr(8,2)+ ":" +data[i]["createTime"].substr(10,2)+
142
										"</em>" +
143
										"</span></h6>" +
144
										"<p style='margin-top:5px;'><span class='lasttime'>   " +
145
										lastReplyFn(userid,data[i]["consultId"])["lastReplyTime"]+
146
										" </span>" +
147
										"</p>" +
148
										"<p class='rebackcon lastReplyCon' >"+lastReplyFn(userid,data[i]["consultId"])["lastReplyCon"]+"</p>" +
216 149
										"</div>" +
217
										"<div class='leftstate floatR'>" +
218
											"<span class='coultstate  "+stateStyle+"'><i>"+state+"</i></span>" +
150
										"<div class='workhandle'>" +
151
											"<div class='rightopert floatR'>" +
152
												"<span   attrP='"+attrParams+"' class='replybtn "+btnCls+"' id='"+ data[i]["consultId"]+"' consultStatus='"+ data[i]["consultStatus"]+"' assess='"+ data[i]["assessStatus"]+ "' thanks='"+ data[i]["thanksStatus"]+
153
												"' onclick='clickLookBtn2(\""+userid+"\",\""+attrParams+"\",\""+data[i]["consultId"]+"\","+data[i]["consultStatus"]+","+data[i]["assessStatus"]+","+data[i]["thanksStatus"]+");'>" +
154
												text +
155
												"</span>" +
156
												"<span class='moreopert complain'>...</span>" +
157
												"<ul class='moreopertbtn'>" +
158
													"<li>投诉</li>" +
159
												"</ul>" +
160
											"</div>" +
161
											"<div class='leftstate floatR'>" +
162
												"<span class='coultstate  "+stateStyle+"'><i>"+state+"</i></span>" +
163
											"</div>" +
219 164
										"</div>" +
220
									"</div>" +
221
								"</td>" +
222
							"</tr></tbody></table>" +
223
		"</div>";*/
224
							
165
									"</td>" +
166
								"</tr></tbody></table>" +
167
							"</div>";
225 168
									
226 169
		}
227 170
		

+ 9 - 2
src/main/webapp/js/information.brow.js

@ -759,8 +759,15 @@ var resou;
759 759
			var professorId = $(this).attr("professorId");
760 760
			consultHandler();
761 761
			
762
			$("ul.menucon").children().eq(1).addClass("clicknow");
763
			var consultTitleVal = $(this).parent().parent().parent().find(".consultTitleVal").text();
762
			var liEle = $("ul.menucon").children();
763
			
764
			for(var i = 0; i < liEle.length; i ++){
765
				$(liEle[i]).removeClass('clicknow');
766
				$(liEle[1]).addClass("clicknow");
767
			};
768
			var item = $(this).parent().parent().parent();
769
			
770
			var consultTitleVal = item.find(".consultTitleVal").text();
764 771
			$("#consultTitle").val("关于"+consultTitleVal+"的咨询");
765 772
		}else {
766 773
			$.MsgBox.Alert("消息提醒","请先登录再进行咨询");

+ 11 - 10
src/main/webapp/js/search.js

@ -324,9 +324,10 @@ $(function(){
324 324
 						//资源中点击咨询
325 325
						//$(".consultbtn").bind("click",clickResouceConsultHandler);
326 326
						$(".about").on("click",'.consultbtn',function(e){
327
							
327 328
							e.stopPropagation();//阻止事件冒泡,影响点击咨询
328 329
							e.cancelBubble = true;// ie下阻止冒泡
329
							clickResouceConsultHandler();
330
							clickResouceConsultHandler($(this),$(this).attr('id'));
330 331
							
331 332
						});
332 333
 					},				
@ -789,6 +790,7 @@ $(function(){
789 790
790 791
		if (userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
791 792
			var professorId = $(this).attr("id");
793
			
792 794
			ConsultApply();
793 795
			//点击的发送
794 796
			$("#sendConsultBtn").click(function(){
@ -815,12 +817,13 @@ $(function(){
815 817
	 };
816 818
	 
817 819
	 
818
	 //找资源中 点击咨询
819
	 function clickResouceConsultHandler(){
820
	 
821
	 //找资源中 点击咨询 obj点击对象
822
	 function clickResouceConsultHandler(obj,professorId){
820 823
		
821 824
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined'){
822 825
			
823
			var professorId = $(this).attr("id");
826
//			var professorId = $(this).attr("id");
824 827
			ConsultApply();
825 828
			//默认选中资源咨询和标题
826 829
			for(var i = 0; i < $("ul.menucon").children().length;i++){
@ -828,17 +831,15 @@ $(function(){
828 831
				$("ul.menucon").children().eq(1).addClass("clicknow");
829 832
			}
830 833
			
834
			var item = obj.parent().parent().parent();
835
			var consultTitleVal = item.find(".resouname").text();
831 836
			
832
			var consultTitleVal = $(this).parent().prev().find("a").text();
833
			console.log($(this).parent());
834
			console.log($(this).parent().prev());
835
			//alert(consultTitleVal);
836 837
			$("#consultTitle").val("关于"+consultTitleVal+"的咨询");
837 838
			//点击的发送
838 839
			$("#sendConsultBtn").click(function(){
839
				sendConsultHandler($(this).attr("proId"));
840
				sendConsultHandler($(this).attr("proId"));//common.js中
840 841
			});
841
			concultProInfo(professorId);
842
			concultProInfo(professorId);//common.js中
842 843
					
843 844
		}else {
844 845