Просмотр исходного кода

资源详细信息
存在undefind问题解决

luyanan лет назад: 8
Родитель
Сommit
66ff67c826
3 измененных файлов с 55 добавлено и 5 удалено
  1. 1 0
      src/main/webapp/css/index.css
  2. 1 1
      src/main/webapp/js/sciresource.js
  3. 53 4
      src/main/webapp/js/search.js

+ 1 - 0
src/main/webapp/css/index.css

@ -99,6 +99,7 @@ input{ outline:none;}
99 99
.science{font-size:14px; }
100 100
.industry{font-size:16px; }
101 101
/*资源简介*/
102
.remess{ cursor:pointer;}
102 103
.resourcephoto{width:132px;height:132px; border-radius:4px;border:1px #f0f0f0 solid;margin:40px 20px;float:left;overflow:hidden; }
103 104
.resouname{font-size:24px; color:#000;}
104 105
.belongname{ font-size:20px; }

+ 1 - 1
src/main/webapp/js/sciresource.js

@ -203,7 +203,7 @@ $(function(){
203 203
						{
204 204
							var add='<div class="maintab"><div class="lefttab fl"><table class="resoubrief"><tr><td><div class="resoimgbox"><img class="resourceImg" width="100%" height="100%" src=""></div></td>'
205 205
							add+='</tr><tr><td><ul><li>'+data.data[i].resourceName+'</li><li>'+data.data[i].supportedServices+'</li> '               
206
							add+='<li class="li1">'+data.data[i].subject+'</li>'                   
206
							/*add+='<li class="li1">'+data.data[i].subject+'</li>' */                  
207 207
							add+='</ul></td></tr><tr>'                
208 208
							add+='<td><span class="managebtn resoumag"">资源管理</span></td></tr></table></div>'                 
209 209
							add+='<div class="righttab fr"><table width="100%" class="worktab tablecon">'

+ 53 - 4
src/main/webapp/js/search.js

@ -139,10 +139,21 @@ $(function(){
139 139
 							for(var i=0;i<$da.length;i++)
140 140
 							{
141 141
 								var add='<div class="item">'
142
 			                    add+='<a class="resourcephoto" href=""><img src="" class="resourceImg" width="100%" height="100%"></a>'
143
 			                    add+='<div class="synopsis">'
144
 			                    add+='<div><a class="resouname" href="">'+$da[i].resourceName+'</a></div>'
145
 			                    add+='<div class="belongname">'+$da[i].professor.name+'<img class="modicon" src="images/rz.png" width="28"></div>'
142
 			                    add+='<a class="resourcephoto" ><img src="" class="resourceImg remess" width="100%" height="100%" resourceId='+$da[i].resourceId+'></a>'
143
 			                    add+='<div class="synopsis">' 			                  
144
 			                     add+='<div><a class="resouname" href="">'+$da[i].resourceName+'</a></div>'
145
 			                     if($da[i].professor.name){
146
 			                    	 add+='<div class="belongname">'+$da[i].professor.name+'<img class="modicon" src="images/rz.png" width="28" ></div>'  
147
 			                    		  } 			                   
148
 			                   if($da[i].professor.title==undefined){
149
 			                	  $da[i].professor.title="";
150
 			                   }
151
 			                  if($da[i].professor.department==undefined){
152
 			                	 $da[i].professor.department="";
153
 			                   }
154
 			                 if($da[i].professor.orgName==undefined){
155
 			                	$da[i].professor.orgName="";
156
			                   }
146 157
 			                    add+='<div class="positionbox">'+$da[i].professor.title+$da[i].professor.department+$da[i].professor.orgName+'</div>'
147 158
 			                    if($da[i].subject)
148 159
 			                    {
@ -351,6 +362,41 @@ $(function(){
351 362
			$(".aboutpro").append('<div class="tcdPageCode"></div>');
352 363
			getData(key,subject,industry,pageSize,1,true,address);
353 364
});
365
	 //查询资源详细信息
366
	 $('.about').on("click",'.remess',function(){
367
			var resourceID=$(this).attr("resourceId");
368
			console.log(resourceID);
369
			ResourceMessage();
370
			$.ajax({		
371
				"url":"/ajax/resource/"+resourceID,
372
				"type":"get",
373
				"async": true,
374
				"success":function(info){
375
					if(info.success)
376
						{
377
						console.log(info);
378
						$("#resourceName").text(info.data.resourceName);
379
						$("#supportedServices").text(info.data.supportedServices);
380
						$("#hopePayMethod").text(info.data.hopePayMethod) ;
381
						$("#cooperationNotes").text(info.data.cooperationNotes) ;
382
						$("#subject").text(info.data.subject);
383
						$("#industry").text(info.data.industry);
384
						$("#descp").text(info.data.descp);
385
						$("#professor").text(info.data.professor.name);
386
						$(".resouImage").attr("src","/images/resource/"+resourceID+".jpg");
387
						$(".resouImage").load(function(){})
388
							.error(function(){
389
								$(this).attr("src","/images/default-resource.jpg");
390
							});
391
						}
392
						else
393
						{
394
							$.MsgBox.Alert('message',"系统异常!");
395
						}
396
				},
397
				"error":function(){$.MsgBox.Alert('message','failed')}
398
			});  
399
		})
354 400
	 //资源申请
355 401
	 function getIdentity(professorId){		
356 402
			$.ajax({	
@ -382,6 +428,9 @@ $(function(){
382 428
		} 	
383 429
	 $('.aboutpro').on("click",'.appl',function(){		
384 430
			ResourceApply();//调用资源申请HTML创建函数
431
			$(".limitBox").removeClass("limitBox");
432
	        $(".limitwords").removeClass("limitwords");
433
	        $(".limitwordbox").removeClass("limitwordbox");
385 434
			//获取当前时间并且格式化时间
386 435
			var myDate = new Date();
387 436
			var nowYear = myDate.getFullYear();