Bladeren bron

Merge remote-tracking branch 'origin/dev' into test

happy 7 jaren geleden
bovenliggende
commit
b57cfd65f9
10 gewijzigde bestanden met toevoegingen van 366 en 16 verwijderingen
  1. 6 6
      css/workspace.css
  2. 1 1
      information-brow.html
  3. 1 1
      information.html
  4. 1 0
      js/common.js
  5. 1 1
      js/consultSure.js
  6. 351 0
      js/demand.js
  7. 2 4
      js/loginNew.js
  8. 1 1
      js/needList.js
  9. 1 1
      js/workindex.js
  10. 1 1
      myDemand.html

+ 6 - 6
css/workspace.css

@ -192,8 +192,8 @@ a.subcolor{ background-color:#ff9900; color:#fff;}
192 192
	width:650px;
193 193
	line-height: 24px;
194 194
	display:block;
195
	white-space:nowrap; 
196
	overflow:hidden;
195
	white-space:nowrap; 
196
	overflow:hidden;
197 197
	text-overflow:ellipsis;
198 198
}
199 199
@ -251,8 +251,8 @@ a.subcolor{ background-color:#ff9900; color:#fff;}
251 251
.dialogcontain .dialoginfo .dialogtitTopic{ font-weight: bold;font-size:18px;}
252 252
.dialogcontain .dialoginfo .thanksblock{/*width:400px; margin:auto;*/}
253 253
/*.dialogcontain .dialoginfo .thankbox{ margin:2px 6px;}*/
254
.dialogcontain .dialoginfo .evadbox{ overflow:hidden;  /*position: relative; width:164px;*/}
255
/*.dialogcontain .dialoginfo .evadbox .evadegree{position: absolute;right: 2px;top: 2px;}
254
.dialogcontain .dialoginfo .evadbox{ overflow:hidden;  /*position: relative; width:164px;*/}
255
/*.dialogcontain .dialoginfo .evadbox .evadegree{position: absolute;right: 2px;top: 2px;}
256 256
.dialogcontain .dialoginfo .evamargin{ margin:auto;}*/
257 257
258 258
/*.dialogcontain .dialoginfo .evadtit{ margin:2px 6px;}*/
@ -383,8 +383,8 @@ border-color:#FF9900; color:#FFFFFF}
383 383
.attentList li .proinfor{display: block;}
384 384
.attentList li:hover{background: #EFEFEF;}
385 385
.attentList li:first-child{margin-top:0}
386
.attentList li:after{position: absolute;bottom: 0;right: 0;left:126px;height: 1px;content: '';background-color: #c8c7cc;
387
    -webkit-transform: scaleY(.5);
386
.attentList li:after{position: absolute;bottom: 0;right: 0;left:126px;height: 1px;content: '';background-color: #c8c7cc;
387
    -webkit-transform: scaleY(.5);
388 388
            transform: scaleY(.5);}
389 389
.attentList li:last-child:after{background: none;}
390 390

+ 1 - 1
information-brow.html

@ -283,4 +283,4 @@
283 283
			</script>
284 284
	</body>
285 285
286
</html>
286
</html>

+ 1 - 1
information.html

@ -499,4 +499,4 @@
499 499
		</script>
500 500
	</body>
501 501

502
</html>
502
</html>

+ 1 - 0
js/common.js

@ -548,3 +548,4 @@ function TimeTr(dealtime) {
548 548
	}
549 549
	return formatTime;
550 550
}
551

+ 1 - 1
js/consultSure.js

@ -199,4 +199,4 @@ function submtbut(consultId, sendId, newtemp) {
199 199
			$.MsgBox.Alert('提示', "服务器链接超时");
200 200
		}
201 201
	});
202
}
202
}

+ 351 - 0
js/demand.js

@ -0,0 +1,351 @@
1
//用户id
2
var userid = $.cookie("userid");
3
4
//getConsultData参数
5
var pageSize = 5;
6
var pageNo, isbind, status, timeType, sortType;
7
8
getMyData(pageSize, 1, true, 0, 1, 0);
9
myRequirePullDownMenu();
10
11
function getMyData(pageSize, pageNo, isbind, status, timeType, sortType) {
12
	var params = {
13
		"consultantId": userid, //专家ID
14
		"status": status, //查询状态 0-全部,1-进行中,2-未感谢,3-未评价,4-已完成, 可以不传,默认为0
15
		"timeType": timeType, //排序目的 0-按发起时间,1-按最后回复时间,2-按完成时间 默认为0
16
		"sortType": sortType, //排序目的 0-倒序,1-正序 默认为0
17
		"pageSize": pageSize, //每页记录数 默认为5
18
		"pageNo": pageNo //当前页码 默认为1
19
	};
20
21
	$.ajax({
22
		url: "/ajax/consult/pqCon", //收到回复接口
23
		type: "get",
24
		data: params,
25
		dataType: "json",
26
		contentType: "application/x-www-form-urlencoded",
27
		success: function(response) {
28
			//数据为空时
29
			if(response["data"]["data"] == null || response["data"]["data"] == undefined || response["data"]["data"] == "") {
30
				return;
31
			} else {
32
				//拿到收到回复数据
33
				var replyStr;
34
				var allData = response.data;
35
				var myData = allData.data;
36
37
				$("#workContainer2").html("");
38
				if(myData.length != 0 && myData.length != null) {
39
					replyStr = handleData(myData, "consultId", "lookBtn");
40
					$("#workContainer2").append(replyStr);
41
42
				} else {
43
					return false;
44
				};
45
				//分页
46
				if(isbind == true) {
47
					$(".getReplyPage").createPage({
48
						pageCount: Math.ceil(allData.total / pageSize),
49
						current: allData.pageNo,
50
						backFn: function(p) {
51
							getMyData(pageSize, p, false, status, timeType, sortType);
52
						}
53
					});
54
				}
55
56
			}
57
58
		},
59
		error: function(response) {
60
			//收到回复错误返回
61
			$.MsgBox.Alert('提示', "收到回复数据请求失败");
62
		},
63
64
	});
65
};
66
67
//data:需要处理的数据,htmlStr:页面中需要的html字符串拼接,
68
//attrParams:数据中不同的参数比如:收到咨询是professorId,收到答复:consultantId
69
function handleData(data, attrParams, btnCls) {
70
	var htmlStr = '';
71
	var title,
72
		office,
73
		orgName,
74
		department,
75
		address;
76
77
	for(var i = 0; i < data.length; i++) {
78
		//text:回复/查看,state:进行中/已完成/未评价,photoUrl:头像地址,proModify:专家认证
79
		var text, state, stateStyle, photoUrl, proModify;
80
		var modifyclass = '';
81
		if(data[i]["professor"]) { //过滤没有专家对象的数据
82
83
			if(data[i]["consultStatus"] == 0) {
84
				state = "进行中";
85
				stateStyle = 'status-1';
86
				text = '回复';
87
			} else if(data[i]["consultStatus"] == 1) {
88
				text = "查看";
89
				state = "已完成";
90
				stateStyle = 'status-3';
91
				if(attrParams == 'consultId') {
92
					if(data[i]["assessStatus"] == 0) {
93
						state = "待评价";
94
						stateStyle = 'status-2';
95
					}
96
				}
97
			} else if(data[i]["consultStatus"] == 2) {
98
				text = "查看";
99
				state = "待回复";
100
				stateStyle = 'status-4';
101
			} else if(data[i]["consultStatus"] == 3) {
102
				text = "查看";
103
				state = "被谢绝";
104
				stateStyle = 'status-5';
105
			} else if(data[i]["consultStatus"] == undefined) {
106
				text = "";
107
				state = "";
108
			}
109
110
			//专家头像
111
			if(data[i]["professor"]["hasHeadImage"] == 0) {
112
				photoUrl = "images/default-photo.jpg"
113
114
			} else {
115
				photoUrl = "images/head/" + data[i]["professor"]["id"] + "_l.jpg"
116
117
			};
118
			//认证
119
			//			if(data[i]["professor"]["authentication"] == true){
120
			//				proModify = "display:inline-block;"
121
			//			}else{
122
			//				proModify = "display:none;"
123
			//			}
124
125
			if(data[i]["professor"].authType) { //专家
126
				modifyclass = 'authicon authicon-cu';
127
128
			} else { //普通用户
129
				if(data[i]["professor"].authStatus == 3) { 
130
					if(data[i]["professor"].authentication == 1) { //科研工作者
131
						modifyclass = "authicon2 authicon-mana";
132
	
133
					} else if(data[i]["professor"].authentication == 2) { //企业专家
134
						modifyclass = "authicon2 authicon-staff";
135
	
136
					} else { //学生
137
						modifyclass = "authicon2 authicon-stu";
138
					}
139
				}
140
			};
141
			//未读消息
142
			var unread = unreadConsultFn(userid, data[i]["consultId"], i);
143
144
			htmlStr += "<div class='workselectitem' id='" + data[i]["consultId"] + "' >" +
145
				"<table width='100%'><tbody><tr><td width='14%' class='messagebox'>" +
146
				"<a class='workhead workitimg headRadius'>" +
147
				"<img class='headPhoto' src='" + photoUrl + "'  width='100%' height='100%'>" +
148
				"</a>" +
149
				"<span class='msgprompt showUnreadMsg' style='" + unread.style + "' id='" + data[i]["consultId"] + "'>" + unread.unreadCount + "</span>" +
150
				"</td>" +
151
				"<td style='position:relative;top:20px;' width='86%'>" +
152
				"<div class='workinfor worksitcon'><h4><a class='named' id='nameS'> " + data[i]["professor"]["name"] + " </a>" +
153
				"<a class='modifyicon " + modifyclass + "'></a><input type='text' class='assessStar' value='" + data[i]["assessStar"] + "' style='display: none;'></h4><h6 class='h3Font'>";
154
155
			if(data[i]["professor"]["title"]) {
156
				htmlStr += "<span>" + data[i]["professor"]["title"] + "</span>, ";
157
			};
158
			if(data[i]["professor"]["office"]) {
159
				if(data[i]["professor"]["orgName"] || data[i]["professor"]["department"]) {
160
					htmlStr += "<span>" + data[i]["professor"]["office"] + "</span>, ";
161
				} else {
162
					htmlStr += "<span>" + data[i]["professor"]["office"] + "</span>";
163
				}
164
165
			};
166
			if(data[i]["professor"]["orgName"]) {
167
				if(data[i]["professor"]["department"]) {
168
					htmlStr += "<span>" + data[i]["professor"]["orgName"] + "</span>, ";
169
				} else {
170
					htmlStr += "<span>" + data[i]["professor"]["orgName"] + "</span>";
171
				}
172
173
			};
174
			if(data[i]["professor"]["department"]) {
175
				htmlStr += "<span>" + data[i]["professor"]["department"] + "</span>";
176
			};
177
			if(data[i]["professor"]["address"]) {
178
				htmlStr += ' | ' + "<span>" + data[i]["professor"]["address"] + "</span>";
179
			};
180
			htmlStr += "</h6><h6 style='position:relative;'>" +
181
				"<div class='titList'>咨询主题:<em class='h4Font'> " + data[i]["consultTitle"] + "  </em></div>" +
182
				"<span class='lasttime rightTime'>" + lastReplyFn(userid, data[i]["consultId"])["lastReplyTime"] + "</span>" +
183
184
				"<div style='height:70px;'><p class='rebackcon lastReplyCon' >" + lastReplyFn(userid, data[i]["consultId"])["lastReplyCon"] + "</p></div>" +
185
				"</h6></div>" +
186
				"<div class='workhandle'>" +
187
				"<div class='rightopert floatR'>" +
188
				"<span   attrP='" + attrParams + "' class='replybtn " + btnCls + "' id='" + data[i]["consultId"] + "' consultStatus='" + data[i]["consultStatus"] + "' assess='" + data[i]["assessStatus"] + "' thanks='" + data[i]["thanksStatus"] +
189
				"' onclick='clickLookBtn2(\"" + userid + "\",\"" + attrParams + "\",\"" + data[i]["consultId"] + "\"," + data[i]["consultStatus"] + "," + data[i]["assessStatus"] + "," + data[i]["thanksStatus"] + ");'>" +
190
				text +
191
				"</span>" +
192
				"<span class='moreopert complain'>...</span>" +
193
				"<ul class='moreopertbtn'>" +
194
				"<li>投诉</li>" +
195
				"</ul>" +
196
				"</div>" +
197
				"<div class='leftstate floatR'>" +
198
				"<span class='coultstate  " + stateStyle + "'><i>" + state + "</i></span>" +
199
				"</div>" +
200
				"<div class='leftstate floatR'>" +
201
				"<span class='coultstate coulstAim status-4'><i>" + data[i]["consultType"] + "</i></span>" +
202
				"</div>" +
203
				"</div>" +
204
				"</td>" +
205
				"</tr></tbody></table>" +
206
				"</div>";
207
208
		}
209
210
	};
211
212
	return htmlStr;
213
};
214
215
//未读信息接口
216
function unreadConsultFn(senderId, consultId, i) {
217
	var unreadCount, style;
218
	var params = {
219
		"senderId": senderId, //发送者ID
220
		"consultId": consultId //咨询ID
221
	};
222
	$.ajax({
223
		url: "/ajax/tidings/qaNotReadTidings",
224
		type: "get",
225
		async: false,
226
		data: params,
227
		success: function(response) {
228
			unreadCount = response["data"];
229
			console.log()
230
			if(unreadCount == 0) {
231
				style = "display:none;"
232
			} else {
233
				style = "display:block;"
234
235
			}
236
		},
237
		error: function(error) {
238
			$.MsgBox.Alert('提示', "未读消息请求失败");
239
		}
240
241
	});
242
	return {
243
		"unreadCount": unreadCount,
244
		"style": style
245
	}
246
247
};
248
249
//列表最后回复
250
function lastReplyFn(sendId, consultId) {
251
252
	var lastReplyTimeData, lastReplyTime, lastReplyCon;
253
	$.ajax({
254
		url: "/ajax/tidings/qaLastRevovery",
255
		async: false,
256
		data: {
257
			"consultId": consultId, //咨询ID
258
			"senderId": sendId //登录者ID
259
		},
260
		success: function(response) {
261
			//			console.log(response)
262
			if(response["data"] == null || response["data"] == "" || response["data"] == undefined) {
263
				lastReplyTimeData = '';
264
				lastReplyTime = '';
265
				lastReplyCon = '';
266
			} else {
267
				lastReplyTimeData = response["data"]["createTime"];
268
				lastReplyTime = lastReplyTimeData.substr(0, 4) + "-" + lastReplyTimeData.substr(4, 2) + "-" + lastReplyTimeData.substr(6, 2) + " " + lastReplyTimeData.substr(8, 2) + ":" + lastReplyTimeData.substr(10, 2)
269
				lastReplyCon = response["data"]["tidingsContant"];
270
			}
271
272
		},
273
		error: function(error) {
274
			$.MsgBox.Alert('提示', "最后回复数据失败");
275
		}
276
277
	});
278
279
	return {
280
		"lastReplyTime": lastReplyTime,
281
		"lastReplyCon": lastReplyCon
282
283
	};
284
};
285
286
//我的咨询下拉菜单处理函数
287
function myRequirePullDownMenu() {
288
	//点击下拉菜单
289
	$(".replyOption ul").find("li").click(function() {
290
291
		status = $(this).attr("tip");
292
		timeType = $("#showTimeSort2").attr("tim");
293
		sortType = $("#timeSortId2").val();
294
295
		$("#workContainer2").remove();
296
		$("#wode").append('<div id="workContainer2"></div>')
297
		$(".getReplyPage").remove();
298
		$("#wode").append('<div class="tcdPageCode getReplyPage"></div>');
299
300
		console.log(status + timeType + sortType);
301
302
		getMyData(pageSize, 1, true, status, timeType, sortType);
303
	});
304
	$(".timeOption2 ul").find("li").click(function() {
305
306
		status = $("#showStatus2").attr("tip");
307
		timeType = $(this).attr("tim");
308
		sortType = $("#timeSortId2").val();
309
310
		$("#workContainer2").remove();
311
		$("#wode").append('<div id="workContainer2"></div>')
312
		$(".getReplyPage").remove();
313
		$("#wode").append('<div class="tcdPageCode getReplyPage"></div>');
314
315
		console.log(status + timeType + sortType);
316
317
		getMyData(pageSize, 1, true, status, timeType, sortType);
318
	});
319
	var sortFlag2 = true;
320
	$("#replyArrow").click(function() {
321
322
		if(sortFlag2 == true) {
323
			$(this).find("div").css("background-position", "-20px 1px");
324
			$("#timeSortId2").val("1");
325
			sortFlag2 = false;
326
327
		} else {
328
			$(this).find("div").css("background-position", "0px 1px");
329
			$("#timeSortId2").val("0");
330
331
			sortFlag2 = true;
332
		};
333
334
		status = $("#showStatus2").attr("tip");
335
		timeType = $("#showTimeSort2").attr("tim");
336
		sortType = $("#timeSortId2").val();
337
338
		$("#workContainer2").remove();
339
		$("#wode").append('<div id="workContainer2"></div>')
340
		$(".getReplyPage").remove();
341
		$("#wode").append('<div class="tcdPageCode getReplyPage"></div>');
342
343
		console.log(status + timeType + sortType);
344
		getMyData(pageSize, 1, true, status, timeType, sortType);
345
	});
346
};
347
348
//咨询和回复中点击查看或者回复
349
function clickLookBtn2(sendId, attrParams, consultId, consultStatus, assessStatus, thanksStatus) {
350
	window.location.href = "diloags.html?sendId=" + sendId + "&attrParams=" + attrParams + "&consultId=" + consultId + "&consultStatus=" + consultStatus + "&assessStatus=" + assessStatus + "&thanksStatus=" + thanksStatus;
351
}

+ 2 - 4
js/loginNew.js

@ -7,8 +7,7 @@ $(function() {
7 7
		$(this).addClass("liactive").siblings().removeClass("liactive");
8 8
		$(".loginWays ul").eq($(this).index()).removeClass("displayNone").siblings().addClass("displayNone");
9 9
	})
10
})
11
var oTel=GetQueryString("tel");
10
})
12 11
 if(oTel==1) {
13 12
 	$(".loginWaySort li").eq(2).addClass("liactive").siblings().removeClass("liactive");
14 13
 	$(".loginWays ul").eq(2).removeClass("displayNone").siblings().addClass("displayNone");
@ -299,7 +298,6 @@ function InvitationLogin(_this) {
299 298
			},
300 299
			async: false,
301 300
			success: function(data) {
302
				 console.log(data)
303 301
				if(data.success) {
304 302
					if(data.data != "null" && data.data != null) {
305 303
						if(data.data.auth == true) {
@ -328,4 +326,4 @@ function login(_this, num) {
328 326
	} else if(num == 3) {
329 327
		VerificationLogin(_this);
330 328
	}
331
}
329
}

+ 1 - 1
js/needList.js

@ -176,4 +176,4 @@ $(document).ready(function() {
176 176
		var demand = $(this).attr("demanid");
177 177
		location.href = "needSure.html?demandId=" + demand;
178 178
	})
179
})
179
})

+ 1 - 1
js/workindex.js

@ -420,4 +420,4 @@ $(function() {
420 420
			}
421 421
		});
422 422
	}
423
});
423
});

+ 1 - 1
myDemand.html

@ -74,7 +74,7 @@
74 74
						</div>
75 75
						<div class="labelarea">
76 76
                        	<ul class="labelshow chooseBox clearfix" id="labelshow">
77
					       		<!--<li class="deleteSubject"><em>66666</em><span class="removeNu"><img src="images/move.png"></span></li>
77
					       		<!--<li class="deleteSubject"><em>66666</em><span class="removeNu"><img src="images/move.png"></span></li>
78 78
					       		<li class="deleteSubject"><em>66666</em><span class="removeNu"><img src="images/move.png"></span></li>-->
79 79
					       	</ul>
80 80
                        </div>