Browse Source

1.咨询:收到回复的数据ajax,
2.点击回复的对话沟通:数据交互,对话内容展示

xiaoai_123 8 years ago
parent
commit
39ef9c9a56

+ 56 - 49
src/main/webapp/consult.html

@ -8,46 +8,35 @@
8 8
    	<div class="workmysrc workmysrc3" id="getConsult" style="display:block;">	
9 9
             <div class="workmenubox clearfix">
10 10
                <form class="workmenufrm floatR">
11
                    <div class="workselectbox floatL">
12
                       <span onclick="hide('downbox')" id="showbox" class="workselectmenu" >全部</span>
13
                        <ul id="downbox" class="workdropdown" style="display:none;"> 
14
                            <li onclick="pick('全部')" class="cur workcurrent">全部</li> 
15
                            <li onclick="pick('进行中')" class="cur">进行中</li> 
16
                            <li onclick="pick('待感谢')" class="cur">待感谢</li> 
17
                            <li onclick="pick('待评价')" class="cur">待评价</li> 
18
                            <li onclick="pick('完成的')" class="cur">完成的</li>
19
                       </ul>
20
                       
21
                       <!-- <select class="workdropdown "  id="consultStatusID">
22
                       		<option class="cur workcurrent" value="0">全部</option>
23
                       		<option class="cur" value="1">进行中</option>
24
                       		<option class="cur" value="2">待感谢</option>
25
                       		<option class="cur" value="3">待评价</option>
26
                       		<option class="cur" value="4">完成的</option>
27
                       </select> -->
28
                       
29
                       
11
                    <div class="workselectbox floatL consultSelect" onclick="showSelect('consultSelect','consultOption','tip')">
12
                       <input type="text" id="consultSelectId" value="0" >
13
                       <span  id="" class="workselectmenu" tip="0">全部</span>
14
                       <div class="consultOption" style="display:none;">
15
	                       <ul id="downbox" class="workdropdown" > 
16
	                            <li class="workcurrent" tip="0">全部</li> 
17
	                            <li class="" tip="1">进行中</li> 
18
	                            <li class="" tip="2">待感谢</li> 
19
	                            <li class="" tip="3">待评价</li> 
20
	                            <li class="" tip="4">完成的</li>
21
	                       </ul>
22
                       </div>
30 23
                       
31 24
                    </div>
32
                    <div class="workselectbox floatL">
33
                        <span onclick="hide('downbox1')" id="showbox1" class="workselectmenu" >按发起时间排序</span>
34
                        <ul id="downbox1" class="workdropdown workdropdown2" style="display:none;"> 
35
                            <li onclick="pick1('按发起时间排序')" class="cur workcurrent">按发起时间排序</li> 
36
                            <li onclick="pick1('按最后回复时间排序')" class="cur">按最后回复时间排序</li> 
37
                            <li onclick="pick1('按完成时间排序')" class="cur">按完成时间排序</li> 
38
                       </ul>
39
                       
40
                       <!-- <select class="workdropdown workdropdown2" id="timeSortId">
41
                       		<option class="cur workcurrent" value="0">按发起时间排序</option>
42
                       		<option class="cur" value="1">按最后回复时间排序</option>
43
                       		<option class="cur" value="2">按完成时间排序</option>
44
                       		
45
                       </select> -->
46
                       
25
                    <div class="workselectbox floatL timeType" onclick="showSelect('timeType','timeOption','tim')">
26
                    	<input type="text" id="timeTypeId" value="0" style="">
27
                        <span  id="" class="workselectmenu" tim="0">按发起时间排序</span>
28
                        <div class="timeOption" style="display:none;">
29
	                        <ul id="downbox1" class="workdropdown workdropdown2" > 
30
	                            <li tim="0" class="cur workcurrent">按发起时间排序</li> 
31
	                            <li tim="1" class="cur">按最后回复时间排序</li> 
32
	                            <li tim="2" class="cur">按完成时间排序</li> 
33
	                       </ul>
34
                        </div>
47 35
                       
48 36
                    </div>
37
                    <input id="timeSortId" type="text" value="0" >
49 38
                    <div class="workselectbox floatL">
50
                        <div class="orderedbtn"><div></div></div> 
39
                        <div class="orderedbtn"><div></div></div>
51 40
                    </div>
52 41
                
53 42
                </form>
@ -69,7 +58,7 @@
69 58
                                </div>
70 59
                                <div class="workhandle">
71 60
                                        <div class="rightopert floatR">
72
	                                        <span class="replybtn">回复/查看</span>
61
	                                        <span class="replybtn" >回复/查看</span>
73 62
	                                        <span class="moreopert">...</span>
74 63
	                                        <ul class="moreopertbtn">
75 64
	                                          	<li>投诉</li>
@ -244,11 +233,11 @@
244 233
</div>
245 234
<!--  咨询 // -->
246 235

247
<script type="text/javascript" src="js/consultFlat.js"></script>
248 236

249
<script>
237
<!-- <script type="text/javascript" src="js/consultFlat.js"></script> -->
238
<script type="text/javascript">
250 239
	/*对话列表和对话框的切换*/
251
	$(".workconitem").on("click",".replybtn",function(){
240
	 $(".workconitem").on("click",".replybtn",function(){
252 241
		$.ajax({
253 242
			"url":"diloags.html",
254 243
			"dataType":"html",
@ -256,11 +245,32 @@
256 245
				//console.log(data);
257 246
							
258 247
			$(".workcon").html(result);
248
			
249
			//调取页面成功后,根据咨询id ajax
250
			$.ajax({
251
				"url"  : "/ajax/consult",
252
				"type" : "get",
253
				//传值:
254
				"data" : "",
255
				"contentType" : "application/x-www-form-urlencoded",
256
				"success" : function(response) {
257
					console.log(response);
258
				},
259
				"complete":function(){
260
					
261
				},
262
				"beforeSend":function(){console.log(this.data)},
263
				"dataType" : "json"
264
				
265
			});
266
			
267

259 268
			}
260 269
	
261
		})
262
	
263
	})
270
		});
271
		
272

273
	}) 
264 274
	$(".workconitem").on("click",".worksitcon",function(){
265 275
		$.ajax({
266 276
			"url":"diloags.html",
@ -283,7 +293,7 @@
283 293

284 294

285 295
	/*筛选条件选中之后的状态*/
286
	$(".workdropdown li").click(function(){
296
	/* $(".workdropdown li").click(function(){
287 297
		var index = $(this).index();	
288 298
		$(this).addClass("workcurrent").siblings().removeClass("workcurrent");	
289 299
	});
@ -301,12 +311,9 @@
301 311
	function pick1(v) {
302 312
		$('#showbox1').text(v);
303 313
		hide('downbox1');
304
	}
314
	} */
305 315

306
	/*排列顺序(正序、倒序)*/
307
	$(".orderedbtn").click(function(){
308
		$(this).find("div").css("background-position","-20px 1px");	
309
	})
316
	
310 317

311 318
	/*咨询菜单点击切换*/
312 319
	    /* $(".worksamlltit3").click(function(){
@ -318,4 +325,4 @@
318 325

319 326

320 327

321
</script>
328
</script>

+ 6 - 7
src/main/webapp/diloags.html

@ -4,15 +4,15 @@
4 4
	<div class="consultdialog">
5 5
    	<div class="dialoghead">
6 6
        	<div class="backupbtn"></div>
7
            <div class="dheadtit">与<span class="dialogpro">程学群</span>对话中</div>
7
            <div class="dheadtit">与<span class="dialogpro" id="dial_consultName">程学群</span>对话中</div>
8 8
        </div>
9 9
        <div class="dialogcontain">
10 10
        	<div class="dialoginfo">
11
                <div><span class="dialogtit">咨询主题:</span><span>XXXXXXXXXXXXXXXXXXXXXX</span></div>
12
                <div><span class="dialogtit">咨询类型:</span><span>技术咨询</span></div>
13
                <div class="dialogsurebtn" onclick="ConsultComment();"><span>点击确认完成咨询</span></div>
11
                <div><span class="dialogtit">咨询主题:</span><span id="dial_consultTitle">XXXXXXXXXXXXXXXXXXXXXX</span></div>
12
                <div><span class="dialogtit">咨询类型:</span><span id="dial_consultType">技术咨询</span></div>
13
                <div class="dialogsurebtn"><span id="dial_confirmFinishConsult">点击确认完成咨询</span></div>
14 14
            </div>
15
            <div class="dialogstatus"><em></em><span>进行中</span></div>
15
            <div class="dialogstatus"><em></em><span id="dil_consultStatus">进行中</span></div>
16 16
        </div>
17 17
        
18 18
        <div class="dialogbody clearfix">
@ -139,8 +139,7 @@
139 139
   <!-- <div class="scrollBar" style="right: 0px;"><div class="bar" style="top: 0%; height: 62.5%;"></div></div>-->
140 140
</div>
141 141

142

143

142
<script type="text/javascript"src="js/dialogs.js"></script>
144 143

145 144

146 145
<script>

+ 396 - 30
src/main/webapp/js/consultFlat.js

@ -3,37 +3,404 @@
3 3
 */
4 4

5 5
$(document).ready(function(){
6
	//咨询状态:状态值(type=0、1、2、3、4)(默认全部信息、发起时间倒叙)
6
	
7
	$(".workmenu").on("click","#consultbtn",function(){
8
			$.ajax({
9
				"url":"consult.html",
10
				"dataType":"html",
11
				"success":function(result){
12
					$(".workcon").html(result);
13

14
					//判断有无咨询接口 传值:登陆人id
15
					var userid = $.cookie("userid");
16
					/*$.ajax({
17
						"url"  : "",//判断有无咨询接口
18
						"type" : "get",
19
						//传值:登陆人id/咨询状态值/时间类型值/排序值;
20
						"data" :userid,
21
						"dataType" : "json",
22
						"contentType" : "application/x-www-form-urlencoded",
23
						"beforeSend":function(){
24
//							console.log(this.data)
25
						},
26
						"success" : function(response) {
27
							console.log(response);
28
						},
29
						"complete":function(){
30
							
31
						},
32
						"error" : function(response) {
33
//							console.log(response);
34
//							$.MsgBox.Alert("消息","系统异常!");
35
						}
36
					});*/
37
					
38

39
					//模拟判断咨询接口,有显示,没有不显示
40
					var getConsultflag = 1;//是否有咨询标记
41
				    if(getConsultflag == 0){
42
				        $(".worksamlltit3:first").hide();
43
				        $(".workmysrc3:first").hide();
44
				        $(".workmysrc3:last").fadeIn();
45
				    }else {
46
	 
47
				        $(".worksamlltit3:first").addClass("active").show();
48
				        $(".workmysrc3:first").show(); 
49
				          
50
				        //On Click Event 收到咨询和收到回复tab效果 
51
				        $(".worksamlltit3").click(function() {
52
				            $(".worksamlltit3").removeClass("worksamlltitnow");
53
				            $(this).addClass("worksamlltitnow");
54
				            
55
				            $(".workmysrc3").hide();
56
				            
57
				            var activeTab = $(this).attr("href");
58

59
				            $(activeTab).fadeIn();
60
				            return false;
61
				        });
62
				        
63
				    };
64
					
65
				    /*排列顺序(正序、倒序)*/	
66
				    var sortFlag = true;//正倒排序标记
67
					$(".orderedbtn").click(function(){
68
						if(sortFlag == true){
69
							$(this).find("div").css("background-position","-20px 1px");	
70
							$("#timeSortId").val("1");
71
							
72
							sortFlag =false;
73
							
74
						}else{
75
							$(this).find("div").css("background-position","0px 1px");	
76
							$("#timeSortId").val("0");
77
							
78
							sortFlag=true;
79
						}
80
						
81
					})
82
				    
83
				    
84
				    var timeType,sortType,consultStatus,consultId;
85
					
86
					consultStatus = $("#consultSelectId").val();//咨询状态值
87
					timeType = $("#timeTypeId").val();//时间类型值
88
					sortType = $("#timeSortId").val();//排序值;
89
//					console.log(consultStatus,timeType,sortType+"res333");
90
					
91
					//默认传值:
92
					var consultInfo = {
93
							"consultStatus":consultStatus,
94
							"timeType":timeType,
95
							"sortType":sortType,
96
							"userid":userid
97
					};
98
					console.log("默认值:"+consultInfo.consultStatus + consultInfo.timeType + consultInfo.sortType +  consultInfo.userid);
99
					
100
					
101
					consultId = "FAE072AE84DA44EC8C70198D519F4E42"; //模拟咨询接口
102
					
103
					//收到咨询信息接口
104
					function consultStatusFn(){
105
						//改变后,要传的值
106
						consultStatus = $("#consultSelectId").val();//咨询状态值
107
						timeType = $("#timeTypeId").val();//时间类型值
108
						sortType = $("#timeSortId").val();//排序值;
109
//						console.log(consultStatus,timeType,sortType+"res333");
110
						
111
						//要传的值:
112
						consultInfo = {
113
								"consultStatus":consultStatus,
114
								"timeType":timeType,
115
								"sortType":sortType,
116
								"userid":userid
117
						};
118
						
119
						
120
						console.log("ajax中的值:"+ consultInfo.consultStatus + consultInfo.timeType + consultInfo.sortType +  consultInfo.userid);
121
						if(userid && userid != null && userid != "null"){
122
							$.ajax({
123
								"url"  : "/ajax/consult",
124
								"type" : "get",
125
								//传值:登陆人id/咨询状态值/时间类型值/排序值;
126
								"data" : consultInfo,
127
								"contentType" : "application/x-www-form-urlencoded",
128
								"success" : function(response) {
129
									console.log(response);
130
									if(consultId == "FAE072AE84DA44EC8C70198D519F4E42"){
131
										//数据渲染
132
										var trStr = 
133
												"<tr>" +
134
													"<td width='14%' class='messagebox'>" +
135
														"<a class='workhead workitimg' href='information.html'>" +
136
															"<img src='images/default-photo.jpg' width='100%' height='100%'>" +
137
														"</a>" +
138
														"<span class='msgprompt'>1</span>" +
139
													"</td>" +
140
													"<td style='position:relative;' width='86%'>" +
141
														"<div class='workinfor worksitcon'>" +
142
															"<h4>" +
143
																"<a href='' class='named' id='nameS'>1111111111111程学群</a>" +
144
																"<img class='modifyicon' src='images/rz.png' width='30'>" +
145
															"</h4>" +
146
															"<h6>" +
147
																"<span>职称</span>,<span>职位</span>,<span>新材料技术研究院</span>,<span>北京科技大学</span>&nbsp;|&nbsp;<span>北京</span>" +
148
															"</h6>" +
149
															"<h6>" +
150
																"<span>咨询主题:<em>XXXXXXXXXXXXX</em></span>&nbsp;&nbsp;&nbsp;&nbsp;<span>咨询类型:<em>技术咨询</em></span>&nbsp;&nbsp;&nbsp;&nbsp;<span>咨询发起时间:<em>2016-10-09 10:00</em></span>" +
151
															"</h6>" +
152
															"<p>最后回复<span class='lasttime'> ( 2016-10-10 14:20 ) </span>" +
153
															"</p>" +
154
															"<p class='rebackcon'>" +
155
															"</p>" +
156
														"</div>" +
157
														"<div class='workhandle'>" +
158
															"<div class='rightopert floatR'>" +
159
																"<span class='replybtn'>回复/查看</span>" +
160
																"<span class='moreopert'>...</span>" +
161
																"<ul class='moreopertbtn'>" +
162
																	"<li>投诉</li>" +
163
																"</ul>" +
164
															"</div>" +
165
															"<div class='leftstate floatR'>" +
166
																"<span class='coultstate;'><i>进行中</i><em></em></span>" +
167
															"</div>" +
168
														"</div>" +
169
													"</td>" +
170
												"</tr>";
171
										
172
										
173
										//收到咨询点击回复====根据咨询id,ajax
174
										$(consultId).click(function(){
175
											
176
											//首先调取dialog.html页面
177
											$.ajax({
178
												"url":"diloags.html",
179
												"dataType":"html",
180
												"success":function(){
181
													$(".workcon").html(result);
182
												},
183
												"error":function(){
184
													$.MsgBox.Alert("消息","调取对话失败!");
185
												},
186
												"complete":function(){
187
													
188
												}
189
											});
190
											
191
											$.ajax({
192
												"url"  : "",//收到咨询点击回复: 收到咨询问题基本信息接口
193
												"type" : "get",
194
												//传值:咨询id;
195
												"data" :consultId,
196
												"dataType" : "json",
197
												"contentType" : "application/x-www-form-urlencoded",
198
												"beforeSend":function(){
199
//													console.log(this.data);
200
												},
201
												"success" : function(response) {
202
													console.log(response);
203
													//回复对话数据
204
													$("#dial_consultName").text(response[""]); //与 程学群 对话中
205
													$("#dial_consultTitle").text(response[""]);//咨询主题
206
													$("#dial_consultType").text(response[""]);//咨询类型
207
													$("#dil_consultStatus").text(response[""])//对话进行状态
208
													//如果进行中
209
													var dil_consultStatus = $("#dil_consultStatus").text(); //对话进行状态
210
													if(dil_consultStatus == "进行中"){
211
														$(".dialogsurebtn").css("display","block");//finishBtn
212
														$(".dialogfoot").css("display","block");//底部输入框
213
													}else{
214
														//如果已完成/待评价/待感谢=====================//评价div(未完成!!!!!!!!!)
215
														
216
														$(".dialogsurebtn").css("display","none");//finishBtn
217
														$(".dialogfoot").css("display","none");//底部输入框
218
														
219
													}
220
													
221
													
222
												},
223
												"complete":function(){
224
													
225
												},
226
												"error" : function(response) {
227
													console.log(response);
228
													console.log("回复失败!");
229
													$.MsgBox.Alert("消息","回复失败!");
230
													
231
												},
232
												
233
												
234
											});
235
											
236
											
237
										});
238
										
239
										
240
									}
241
									
242
									
243
								},
244
								"complete":function(){
245
									
246
								},
247
								"error":function(){
248
									console.log("筛选失败!");
249
									$.MsgBox.Alert("消息","筛选失败!");
250
								},
251
								
252
								"beforeSend":function(){},
253
								"dataType" : "json"
254
							});
255
						}
256
						
257
					};
258
					
259
					//绑定咨询状态事件
260
					$(".consultOption ul").bind("click", "li",consultStatusFn);
261
					
262
					//绑定咨询状态事件
263
					$(".timeOption ul").bind("click", "li",consultStatusFn);
264
					
265
					$(".orderedbtn").bind("click", "li",consultStatusFn);
266
					
267
					//点击确然完成咨询
268
					function finishConsultFn (){
269
						alert("finish");
270
					}
271
					$(".dialogsurebtn").bind("click","#dial_confirmFinishConsult",finishConsultFn)
272
					
273
					
274
					
275

276
				
277
				},//成功调取consult.html结束
278
				
279
				//调取consult.html失败,处理函数
280
				"error":function(){
281
					$.MsgBox.Alert("消息","调取咨询失败!");
282
				}
283
			
284
			});
285
			
286
			
287
		})
288
	
289
})
290

291

292

293

294

295

296

297

298

299

300

301

302

303

304

305

306

307

308

309

310

311

312

313

314
	//咨询状态:状态值(type=0、1、2、3、4)(默认全部信息、发起时间 倒叙)
7 315
	//全部/进行中/待付款/待评价/完成的 
316
	//下拉菜单函数
317
	//obj1:要显示的select对象id,obj2:下拉菜单容器,attr要获取的属性值;
318
	//userid:登陆然id
319
	//consultStatus:咨询状态,全部0,进行中1,待感谢2,待评价3,完成的4
320
	//timeType:时间状态,发起时间0,最后回复时间1,完成时间2
321
	//sortType:排序:倒叙0,正序1
322
	//consultId:咨询id
323
	/*var timeType,sortType,userid,consultStatus,consultId;
324
	var sortFlag = true;//正倒排序标记
325
	
326
	userid = $.cookie("userid");
327
	consultStatus = $("#consultSelectId").val();//咨询状态值
328
	timeType = $("#timeTypeId").val();//时间类型值
329
	sortType = $("#timeSortId").val();//排序值;
330
	
331
	  function showSelect(obj1,obj2,attr){
332
	    $("."+ obj2).css("display","block"); 
333
	    $(obj2).slideDown();
334

335
	    $("."+ obj2).find("li").click(function(){
336
	    	$("."+ obj2).slideUp();
337
	    	
338
		      $("."+ obj1).find("span").text($(this).text());
339
		      $("."+ obj1).find("input").val($(this).attr(attr));
340
		      
341
		      	consultStatus = $("#consultSelectId").val();//咨询状态值
342
		
343
				timeType = $("#timeTypeId").val();//时间类型值
344
				
345
				sortType = $("#timeSortId").val();//排序值;
346

347
				console.log(consultStatus,timeType,sortType+"res");
348
	      
349
	    });
350
	  };
351
	  
352
	  排列顺序(正序、倒序)	
353
		$(".orderedbtn").click(function(){
354
			if(sortFlag == true){
355
				$(this).find("div").css("background-position","-20px 1px");	
356
				$("#timeSortId").val("0");
357
				sortFlag =false;
358
				
359
			}else{
360
				$(this).find("div").css("background-position","0px 1px");	
361
				$("#timeSortId").val("1");
362
				sortFlag=true;
363
			}
364
			
365
		})
366
		
367
		
368
	var consulrInfo = {
369
			"consultStatus":consultStatus,
370
			"timeType":timeType,
371
			"sortType":sortType,
372
			"userid":userid
373
	};
374
	var consulrInfoStr = JSON.stringify(consulrInfo);
375
	console.log(consulrInfoStr);
376
	//选择咨询状态函数
377
	function consultStatusFn(){
378
		console.log(consulrInfoStr);
379
		if(userid && userid != null && userid != "null"){
380
			$.ajax({
381
				"url"  : "/ajax/consult",
382
				"type" : "get",
383
				//传值:登陆人id/咨询状态值/时间类型值/排序值;
384
				"data" : consulrInfo,
385
				"contentType" : "application/x-www-form-urlencoded",
386
				"success" : function(response) {
387
					console.log(response);
388
				},
389
				"complete":function(){
390
					
391
				},
392
				"beforeSend":function(){console.log(this.data)},
393
				"dataType" : "json"
394
			});
395
		}
396
		
397
		
398
	};
399
	
400
	//绑定咨询状态事件
401
	
402
	$(".consultOption ul").bind("click", "li",consultStatusFn);*/
8 403
	
9
	var consultStateCon =  $("#showbox").text();
10
	var consultState;
11
//	if(consultStateCon == "全部"){
12
//		consultState = 0; 
13
//	};
14
//	if(consultStateCon == "进行中"){
15
//		consultState = 1; 
16
//	};
17
//	if(consultStateCon == "待感谢"){
18
//		consultState = 2; 
19
//	};
20
//	if(consultStateCon == "待评价"){
21
//		consultState = 3; 
22
//	};
23
//	if(consultStateCon == "完成的"){
24
//		consultState = 4; 
25
//	};
26
	
27
	var consultStatusVal;
28
	var timeSortVal;
29
	$("#consultStatusId").bind("change",function(){ 
30
		consultStatusVal = $(this).val();
31
	    console.log(consultStatusVal);
32
	  }); 
33
	$("#timeSortId").bind("change",function(){ 
34
		timeSortVal = $(this).val();
35
	    console.log(timeSortVal);
36
	  });
37 404
	
38 405
	
39 406
	
@ -48,4 +415,3 @@ $(document).ready(function(){
48 415
	
49 416
	
50 417
	
51
})

+ 117 - 0
src/main/webapp/js/dialogs.js

@ -0,0 +1,117 @@
1
/**
2
 * 
3
 */
4
$(document).ready(function(){
5
	
6
	//沟通内容显示ajax
7
	var userid = $.cookie("userid");//内容发送人id 登陆人id
8
	
9
	/*$.ajax({
10
		"url"  : "",//沟通内容显示 接口
11
		"type" : "get",
12
		//传值:咨询id;
13
		"data" :consultId,//咨询问题id
14
		"dataType" : "json",
15
		"contentType" : "application/x-www-form-urlencoded",
16
		"beforeSend":function(){
17
//			console.log(this.data);
18
		},
19
		"success": function(response){
20
			console.log(response);
21
			
22
			//咨询沟通id : tidings_id
23
			//1.根据时间排序
24
			//2.只要是我的在左边,
25
			//3.其他的在右边
26
//			if(tidings_id != "" && tidings_id != null && tidings_id != undefined){
27
				
28
				var leftContent = 
29
								"<div class="dialogleftitem">
30
            	<div class="dilmod">
31
                	<div class="diluser floatL">
32
                    	<a href="" target="_blank" class="userface">
33
                        	<img src="images/default-photo.jpg" width="100%" height="100%">
34
                        </a>
35
                    </div>
36
                    <div class="dilinfobox dilinfobox_l floatL">
37
                    	<div class="dilarrow dilarrow_l"></div>
38
                        <div class="dilarrow dilarrow_l_bor"></div>
39
                    	<div class="delinfocon clearfix">
40
                            <div class="delinfomain floatL">
41
                            	<div class="cont">
42
                            		<p>800009jhujgkkkkkkkkkkkkkhhghhu</p>
43
                                </div>
44
                            </div>
45
                        </div>
46
                    	
47
                    </div>
48
                </div>
49
            </div>"
50
				
51
				
52
				
53
//			}
54
			//内容发送人id(登陆人id)
55
//			else if(userid != "" && userid != null && userid != undefined){
56
				var rightContent = 
57
								"<div class="dialogrightitem">
58
            	<div class="dilmod">
59
                	<div class="diluser floatR">
60
                    	<a href="" target="_blank" class="userface">
61
                        	<img src="images/default-photo.jpg" width="100%" height="100%">
62
                        </a>
63
                    </div>
64
                    <div class="dilinfobox dilinfobox_r floatR">
65
                    	<div class="delinfocon clearfix">
66
                        	<div class="dilarrow dilarrow_r"></div>
67
                            <div class="dilarrow dilarrow_r_bor"></div>
68
                            <div class="delinfomain floatR">
69
                            	<div class="cont">
70
                            		<p>我们国内钾肥i哦警方i哦济公活佛极度恐慌赶快回家就看不见哦go客观艰苦地方购房抵of更何况vjklvkbnklvjohgjioghfhhjgifojgoifo房价高iof囧估计哦大家哦i估计哦大家佛8恢复俄日哦i后开盘科幻片里发公告00009jhujgkkkkkkkkkkkkkhhghhu</p>
71
                                </div>
72
                            </div>
73
                        </div>
74
                    	
75
                    </div>
76
                </div>
77
            </div>";
78
				
79
				
80
				
81
//			}
82
			
83
			
84
		},
85
		"error": function(response){
86
			console.log(response);
87
			$.MsgBox.Alert("消息","获取对话信息失败!");
88
		},
89
		"complete": function(response){
90
			console.log(response);
91
		}
92
		
93
	});*/
94
	
95
	
96
	//点击发送,发送信息接口
97
	
98
	
99
	
100
	
101
	
102
	
103
	
104
	
105
	
106
	//点击确然完成咨询
107
	function finishConsultFn(){
108
		ConsultComment();
109
		alert("finish");
110
	}
111
	$(".dialogsurebtn").bind("click","#dial_confirmFinishConsult",finishConsultFn);
112
	
113
	
114
	
115
	
116
})
117


+ 69 - 24
src/main/webapp/js/information.brow.js

@ -453,52 +453,74 @@ $(".subsidebar").click(function(){
453 453
		"error":function(){$.MsgBox.Alert('message','failddd')}
454 454
		})	
455 455
	}
456

456
//资源申请入口
457 457
	$('.introduction').on("click",'.applicant',function(){
458 458
		ResourceApply();//调用资源申请HTML创建函数
459
		
459
		//时间插件
460
		$( "#datepicker" ).datepicker({ "dateFormat":" yy-mm-dd"});
460 461
		//console.log(name);
461 462
		$(".timelo").css("display","none");
462 463
		$(".namecon").text(name);
463 464
		$(".applysure").hide();
464 465
		$(".btnboxup").hide();
465 466
		var index1=$(this).parent().parent().parent().index();
467
		var resName=$('.presou').eq(index1).text();
466 468
		//console.log(index1);
467 469
		var m=console.log();
468 470
		var resourceID=$(this).attr("resourceId");
469 471
		//console.log(resourceID);
470
		$(".log").text($('.presou').eq(index1).text());
472
		//
473
		$(".log").text(resName);
471 474
		
472 475
		getIdentity(userid);
473 476
		
474
		$("#del").on("click",function()
477
		$("#deliver").on("click",function()
475 478
				{	
476 479
					var $data = {};
477 480
					$data.demandId = userid;
478 481
					$data.resourceId=resourceID;
479 482
					$data.detailDemand=$(".detail").val();
480
					$data.deliverTime=$(".dealTime").val();
483
					//去除时间里面的-  和字符串前后的空格
484
					$data.deliverTime=replaceStr($.trim($(".dealTime").val()));
485
				    //alert(replaceStr($.trim($(".dealTime").val())));
486
				    //alert(replaceStr($.trim($(".dealTime").val())).length);
487
					
481 488
					$data.operationStatus=1;
482 489
					$data.applysquare=$("select option:selected").val();	
483 490
					//console.log($data.applysquare);
491
					
492
					
484 493
					$.ajax({
485 494
						"url" : "/ajax/operation",
486 495
						"type" : "POST",
487 496
						"success" : function(rdata) {
488 497
							if (rdata.success) {
498
								$.MsgBox.Alert('message','资源"'+ resName +'"申请发送成功!');
499
								$(".blackcover").remove();
500
								$("body").css("overflow","auto");
489 501
								//location.reload(true);
490 502
							} else {
491
								alert("jjj");
503
								$.MsgBox.Alert('message','资源"'+ resName +'"申请发送失败,请重新申请!');
492 504
							}
493 505
						},
494 506
						"data" :  $data,
495
						"beforeSend":function(){console.log(this.data)},
507
						"beforeSend":function(){/*console.log(this.data)*/},
496 508
						"contentType" :  "application/x-www-form-urlencoded",
497 509
						dataType : "json"
498 510
					});
499 511
			});
500 512
	});
501
	
513
//******过滤特殊字符*******//
514
	function replaceStr(s) 
515
	{ 
516
		var pattern = new RegExp("-");
517
		var rs = ""; 
518
		for (var i = 0; i < s.length; i++) { 
519
			rs = rs+s.substr(i, 1).replace(pattern, ''); 
520
		} 
521
		return rs; 
522
	} 	
523
//**********************//	
502 524
	
503 525
	//=====================================
504 526
	//事件封装
@ -569,39 +591,62 @@ $(".subsidebar").click(function(){
569 591
	
570 592
	//点击咨询
571 593
	consultBtn.on('click',consultHandler);	
572
	
594
	var consultId;
573 595
	//发送咨询申请处理函数
574 596
	function sendConsultHandler(){
575 597
		var consult_type = $(".clicknow").text();//咨询类型
576 598
		var consult_title = $("#consultTitle").val();//咨询主题
577 599
		var consult_content = $("#consultContent").val();//咨询内容
578
		var consult = {
579
				consultType:consult_type,
580
				consultTitle:consult_title,
581
				consultContent:consult_content,
582
				professorId:professorId,
583
				userid:userid
600
		var consultStr = {
601
				"consultType":consult_type,
602
				"consultTitle":consult_title,
603
				"consultContant":consult_content,
604
				"professorId":professorId,
605
				"consultantId":userid
584 606
		};
585
		var consultStr = JSON.stringify(consult);
586
		console.log(consultStr);
587 607
		
588
		if(consult_type == '' || consult_title == '' || consult_content == ''){
608
		/*if(consult_type == '' || consult_title == '' || consult_content == ''){
589 609
			$.MsgBox.Alert("message","请填写完整");
590
		};
610
		};*/
611
		if(consult_type == ''){
612
			$.MsgBox.Alert("消息","请选择联系目的");
613
		}
614
		if(consult_title == ''){
615
			$.MsgBox.Alert("消息","请填写咨询目的");
616
		}
617
		if(consult_content == ''){
618
			$.MsgBox.Alert("消息","请填写咨询内容");
619
		}
591 620
		
592
		if(userid && userid != null && userid != "null"){
621
		if(userid && userid != null && userid != "null" && consult_type != '' &&
622
				consult_title != '' && consult_content != ''
623
		){
624
			
593 625
			$.ajax({
594 626
				"url" :"/ajax/consult",
595 627
				"type" : "post",
596 628
				//传值:咨询类型、主题、内容、专家id、申请人id
597
				"data" : {"consult":consultStr},
629
				"data" : consultStr,				
598 630
				"contentType" : "application/x-www-form-urlencoded",
631
				"beforeSend":function(){console.log(this.data)},
632
				"dataType" : "json",
599 633
				"success" : function(response) {
600
					console.log(response);
634
					
635
					
636
					consultId = response.data;//咨询id
637
					
638
					
601 639
				},
640
				"error":function (){
641
					$.MsgBox.Alert("消息","咨询申请失败");
642
				},
643
				
602 644
				"complete":function(){
603
					
604
				}
645
					//$(".consultapply").remove();
646
					$(".blackcover").remove();
647
					$("body").css("overflow-y","auto");
648
					$.MsgBox.Alert("消息","咨询申请成功");
649
				},
605 650
			});
606 651
		}
607 652


+ 2 - 2
src/main/webapp/js/workspace.js

@ -25,7 +25,7 @@
25 25
	
26 26

27 27
	
28
	$(".workmenu").on("click","#consultbtn",function(){
28
	/*$(".workmenu").on("click","#consultbtn",function(){
29 29
		
30 30
		$.ajax({
31 31
			"url":"consult.html",
@ -66,7 +66,7 @@
66 66
		
67 67
		})
68 68
		
69
	})
69
	})*/
70 70
	
71 71
	
72 72
	$(".workmenu").on("click","#sciprojectbtn",function(){

+ 28 - 1
src/main/webapp/workspaces.html

@ -93,18 +93,45 @@
93 93
	</div>
94 94
	<div class="footer-btm">本站由 阿里云 提供计算与安全服务 Copyright © 2016~2017 科袖 | 京ICP备12345678号 | 京ICP证123456号 | 京公网安备11010800011111号 | 网站联盟安全认证</div>
95 95
</div>
96
<script type="text/javascript">
97
	//下拉菜单
98
	function showSelect(obj1,obj2,attr){
99
	    $("."+ obj2).css("display","block"); 
100
	    $(obj2).slideDown();
101

102
	    $("."+ obj2).find("li").click(function(){
103
	    	$("."+ obj2).slideUp();
104
	    	
105
		      $("."+ obj1).find("span").text($(this).text());
106
		      $("."+ obj1).find("input").val($(this).attr(attr));
107
		      
108
		      	consultStatus = $("#consultSelectId").val();//咨询状态值
109
		
110
				timeType = $("#timeTypeId").val();//时间类型值
111
				
112
				sortType = $("#timeSortId").val();//排序值;
113

114
	      
115
	    });
116
	  };
117

118
</script>
119

120

96 121
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
97 122
<script type="text/javascript" src="js/common.js"></script>
98 123
<script type="text/javascript" src="js/jquery.HeadP.js"> </script>
99 124
<script type="text/javascript" src="js/jquery.Jcrop.js"> </script>
100 125
<script type="text/javascript" src="js/basic.js"> </script>
101 126
<script type="text/javascript" src="/js/ajaxfileupload.js"></script>
102

127
<script src="js/jquery.page.js"></script>
103 128
<script type="text/javascript"src="js/jquery.cookie.js"></script>
104 129
<script type="text/javascript"src="js/jquery.similar.msgbox.js"></script>
105 130
<script type="text/javascript" src="js/index.js"></script>
106 131
<script type="text/javascript" src="js/popup.js"></script>
107 132
<script type="text/javascript" src="js/workspace.js"></script>
133
<script type="text/javascript" src="js/consultFlat.js"></script>
134
<!-- <script type="text/javascript"src="js/dialogs.js"></script> -->
108 135

109 136
</body>
110 137
</html>