|
@ -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
|
|
" " +
|
146
|
|
"<span>咨询类型:<em> " + data[i]["consultType"] +" </em></span>" +
|
147
|
|
" <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
|
|
" " +
|
194
|
|
"<span>咨询类型:<em> " + data[i]["consultType"] +" </em></span>" +
|
195
|
|
" <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
|
" " +
|
|
138
|
"<span>咨询类型:<em> " + data[i]["consultType"] +" </em></span>" +
|
|
139
|
" <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
|
|