Browse Source

资源和需求判断是否登陆跳转消息列表

luyanan 7 years ago
parent
commit
fc4fbd19fc
3 changed files with 60 additions and 37 deletions
  1. 33 28
      js/demandShow.js
  2. 26 8
      js/resourceShow.js
  3. 1 1
      resourceShow.html

+ 33 - 28
js/demandShow.js

@ -64,7 +64,15 @@ $(document).ready(function() {
64 64
//		})
65 65
//		
66 66
//	})
67
	
67
	$(".showStatus").on('click',".meSendBack",function(){
68
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
69
			location.href="tidings.html?id="+consuId
70
		} else {
71
			quickLog();
72
			operatTab();
73
			closeLog();
74
		}
75
	});
68 76
	$("#expertli").on("click","li",function(){
69 77
		var dataId=$(this).attr("data-id");
70 78
		location.href="userInforShow.html?professorId="+dataId;
@ -122,9 +130,6 @@ $(document).ready(function() {
122 130
					consuId = $da.creator;
123 131
					demandTitle = $da.title;
124 132
					demandContent = $da.descp;
125
					$(".meSendBack").on("click",function(){
126
						location.href="tidings.html?id="+consuId;
127
					})
128 133
				}
129 134
			},
130 135
			'error': function() {
@ -231,30 +236,30 @@ $(document).ready(function() {
231 236
		
232 237
	}
233 238
	
234
	function createConsult() {
235
		$.ajax({
236
			url: "/ajax/consult",
237
			type: "POST",
238
			timeout: 10000,
239
			data: {
240
				"consultType": "其他咨询",
241
				"consultTitle": demandTitle,
242
				"consultContant": demandContent,
243
				"professorId": userid,
244
				"consultantId": consuId,
245
				"demandId": demandId
246
			},
247
			success: function(data) {
248
				if(data.success) {
249
					console.log(data)
250
					location.href="diloags.html?sendId="+userid+"&attrParams=professorId&consultId="+data.data+"&consultStatus=0&assessStatus=0&thanksStatus=0"	
251
				}
252
			},
253
			error: function() {
254

255
			}
256
		})
257
	}
239
//	function createConsult() {
240
//		$.ajax({
241
//			url: "/ajax/consult",
242
//			type: "POST",
243
//			timeout: 10000,
244
//			data: {
245
//				"consultType": "其他咨询",
246
//				"consultTitle": demandTitle,
247
//				"consultContant": demandContent,
248
//				"professorId": userid,
249
//				"consultantId": consuId,
250
//				"demandId": demandId
251
//			},
252
//			success: function(data) {
253
//				if(data.success) {
254
//					console.log(data)
255
//					location.href="diloags.html?sendId="+userid+"&attrParams=professorId&consultId="+data.data+"&consultStatus=0&assessStatus=0&thanksStatus=0"	
256
//				}
257
//			},
258
//			error: function() {
259
//
260
//			}
261
//		})
262
//	}
258 263
	
259 264
	//纠错反馈
260 265
	$(".correctSubmit").on("click",function(){

+ 26 - 8
js/resourceShow.js

@ -410,10 +410,25 @@ $(document).ready(function() {
410 410
		location.href = "resourceShow.html?resourceId=" + $(this).attr("data-id");
411 411
	})
412 412
	/*点击咨询*/
413
	$("#consultin").on("click", function() {
414
		location.href="tidings.html?id="+professorId;
413
	$("#consultin").on('click', function(){
414
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
415
			location.href="tidings.html?id="+professorId
416
		} else {
417
			quickLog();
418
			operatTab();
419
			closeLog();
420
		}
421
	});
422
	$("#expertli").on("click",".addbtn",function() {
423
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
424
			var id=$(this).attr("data-id");
425
			location.href="tidings.html?id="+id;
426
		} else {
427
			quickLog();
428
			operatTab();
429
			closeLog();
430
		}
415 431
	});
416
	
417 432
//	$("#consultin").on("click", function() {
418 433
//		clickResouceConsultHandler();
419 434
//	});
@ -526,7 +541,13 @@ $(document).ready(function() {
526 541
			success: function(data, textState) {
527 542
				console.log(data)
528 543
				if(data.success) {
529
					unauthUser(data.data);
544
					if(data.data.length>0){
545
						$("#expertli").parents(".currentBlock").removeClass("displayNone");
546
						unauthUser(data.data);
547
					}else{
548
						$("#expertli").parents(".currentBlock").addClass("displayNone");
549
					}
550
					
530 551
				}
531 552
			},
532 553
			error: function(XMLHttpRequest, textStats, errorThrown) {
@ -568,10 +589,7 @@ $(document).ready(function() {
568 589
		}
569 590
		$("#expertli").html(osting);
570 591
	}
571
	$("#expertli").on("click",".addbtn",function() {
572
		var id=$(this).attr("data-id");
573
		location.href="tidings.html?id="+id;
574
	});
592
	
575 593
	//纠错反馈
576 594
	$(".correctSubmit").on("click",function(){
577 595
		var cntCon=$(this).siblings(".correctCon").val();

+ 1 - 1
resourceShow.html

@ -155,7 +155,7 @@
155 155
					<div class="goSpan">
156 156
						<span class="attenSpan">关注</span>
157 157
					</div>
158
					<div class="form-item otherBlock currentBlock">
158
					<div class="form-item otherBlock currentBlock displayNone">
159 159
						<div class="aboutTit">联系人</div>
160 160
						<div class="form-result addexpertRe" style="margin-top:0">
161 161
							<ul class="addexpert" id="expertli">