浏览代码

修改【搜索-资源】列表 和 【我的关注-资源】列表,专家的所在机构都没有显示问题

xuchunyang 8 年之前
父节点
当前提交
50cbe4110b
共有 3 个文件被更改,包括 48 次插入29 次删除
  1. 10 10
      app/js/attentions2.js
  2. 12 4
      app/js/index.js
  3. 26 15
      app/js/searchhome.js

+ 10 - 10
app/js/attentions2.js

@ -140,20 +140,20 @@ function datalistEach(datalistd) {
140 140
       
141 141
		/*获取头像*/
142 142
		if(item.resource.images.length) {
143
			var img = baseUrl + "/images/resource/" + item.resource.resourceId + ".jpg";
143
			var img = baseUrl + "/images/resource/" + item.resource.resourceId + "_s.jpg";
144 144
		} else {
145 145
			var img = "../images/default-resource.jpg";
146 146
		}
147 147
		
148 148
		/*判断用户是否认证*/
149 149
		var icont = '';
150
		if(item.resource.professor.authType) {
150
		if(item.resource.editProfessor.authType) {
151 151
			icont='<em class="mui-icon iconfont icon-vip authicon-cu"> </em>';
152 152
		} else {
153
			if(item.resource.professor.authStatus) {
154
				if(item.resource.professor.authentication == 1) {
153
			if(item.resource.editProfessor.authStatus) {
154
				if(item.resource.editProfessor.authentication == 1) {
155 155
					icont='<em class="mui-icon iconfont icon-renzheng authicon-mana"></em>';
156
				} else if(item.resource.professor.authentication == 2) {
156
				} else if(item.resource.editProfessor.authentication == 2) {
157 157
					icont='<em class="mui-icon iconfont icon-renzheng authicon-staff"></em>';
158 158
				} else {
159 159
					icont='<em class="mui-icon iconfont icon-renzheng authicon-stu"></em>';
@ -161,10 +161,10 @@ function datalistEach(datalistd) {
161 161
			}
162 162
		}
163 163

164
		var title = item.resource.professor.title || "";
165
		var office = item.resource.professor.office || "";
166
		var orgName = item.resource.professor.orgName || "";
167
		var address = item.resource.professor.address || "";
164
		var title = item.resource.editProfessor.title || "";
165
		var office = item.resource.editProfessor.office || "";
166
		var orgName = item.resource.editProfessor.orgName || "";
167
		var address = item.resource.editProfessor.address || "";
168 168

169 169
		if(title != "") {
170 170
			title = title + " , ";
@ -187,7 +187,7 @@ function datalistEach(datalistd) {
187 187
			'<div class="mui-media-body">' +
188 188
			'<span class="listtit">' + item.resource.resourceName + '</span>' +
189 189
			'<p class="mui-ellipsis listtit2">' + item.resource.supportedServices + '</p>' +
190
			'<span class="listtit">' + item.resource.professor.name + icont + '</span>' +
190
			'<span class="listtit">' + item.resource.editProfessor.name + icont + '</span>' +
191 191
			'<p class="listtit3"><span>' + title + '</span><span>' + office + '</span><span>' + orgName + '</span><span>' + address + '</span></p>' +
192 192
			'</div></a></li>';
193 193
		table.appendChild(li, table.firstChild);

+ 12 - 4
app/js/index.js

@ -171,18 +171,26 @@ function datalistEach(datalist) {
171 171

172 172
		/*获取研究方向信息*/
173 173
		var researchAreas = item.researchAreas;
174
		var rlist = ''
174
		var rlist = '';
175 175
		for(var n = 0; n < researchAreas.length; n++) {
176 176
			//console.log(researchAreas[n].caption);
177
			rlist = '<span>' + researchAreas[n].caption + '</span>';
177
			rlist += '<span>' + researchAreas[n].caption 
178
			if(n < researchAreas.length-1){
179
				rlist += " , "	
180
			}
181
			rlist += '</span>';
178 182
		}
179 183

180 184
		/*获取资源信息*/
181 185
		var resources = item.resources;
182
		var zlist = ''
186
		var zlist = '';
183 187
		for(var m = 0; m < resources.length; m++) {
184 188
			//console.log(resources[m].caption);
185
			zlist = '<span>' + resources[m].resourceName + '</span>';
189
			zlist += '<span>' + resources[m].resourceName 
190
			if(m < resources.length-1){
191
				zlist += " , "	
192
			}
193
			zlist += '</span>';
186 194
		}
187 195

188 196
		var title = item.title || "";

+ 26 - 15
app/js/searchhome.js

@ -424,18 +424,29 @@ function datalistEach(datalist) {
424 424
				}
425 425
			}
426 426
		}
427
		
427 428
		/*获取研究方向信息*/
428 429
		var researchAreas = item.researchAreas;
429
		var rlist = ''
430
		var rlist = '';
430 431
		for(var n = 0; n < researchAreas.length; n++) {
431
			rlist = '<span>' + researchAreas[n].caption + '</span>';
432
			//console.log(researchAreas[n].caption);
433
			rlist += '<span>' + researchAreas[n].caption 
434
			if(n < researchAreas.length-1){
435
				rlist += " , "	
436
			}
437
			rlist += '</span>';
432 438
		}
433 439

434 440
		/*获取资源信息*/
435 441
		var resources = item.resources;
436
		var zlist = ''
442
		var zlist = '';
437 443
		for(var m = 0; m < resources.length; m++) {
438
			zlist = '<span>' + resources[m].resourceName + '</span>';
444
			//console.log(resources[m].caption);
445
			zlist += '<span>' + resources[m].resourceName 
446
			if(m < resources.length-1){
447
				zlist += " , "	
448
			}
449
			zlist += '</span>';
439 450
		}
440 451
		
441 452
		//var title;
@ -481,20 +492,20 @@ function resourcesEach(datalist) {
481 492

482 493
		/*获取头像*/
483 494
		if(item.images.length) {
484
			var img = baseUrl + "/images/resource/" + item.resourceId + ".jpg";
495
			var img = baseUrl + "/images/resource/" + item.resourceId + "_s.jpg";
485 496
		} else {
486 497
			var img = "../images/default-resource.jpg";
487 498
		}
488 499

489 500
		/*判断用户是否认证*/
490 501
		var icon = '';		
491
		if(item.professor.authType) {			
502
		if(item.editProfessor.authType) {			
492 503
			icon='<em class="mui-icon iconfont icon-vip authicon-cu"> </em>';
493 504
		} else {
494
			if(item.professor.authStatus) {
495
				if(item.professor.authentication == 1) {					
505
			if(item.editProfessor.authStatus) {
506
				if(item.editProfessor.authentication == 1) {					
496 507
					icon='<em class="mui-icon iconfont icon-renzheng authicon-mana"></em>';
497
				} else if(item.professor.authentication == 2) {					
508
				} else if(item.editProfessor.authentication == 2) {					
498 509
					icon='<em class="mui-icon iconfont icon-renzheng authicon-staff"></em>';
499 510
				} else {
500 511
					icon='<em class="mui-icon iconfont icon-renzheng authicon-stu"></em>';
@ -502,11 +513,11 @@ function resourcesEach(datalist) {
502 513
			}
503 514
		}
504 515

505
		var title = item.professor.title || "";
506
		var office = item.professor.office || "";
507
		var orgName = item.professor.orgName || "";
508
		var address = item.professor.address || "";
509

516
		var title = item.editProfessor.title || "";
517
		var office = item.editProfessor.office || "";
518
		var orgName = item.editProfessor.orgName || "";
519
		var address = item.editProfessor.address || "";
520
        
510 521
		if(title != "") {
511 522
			title = title + " , ";
512 523
		}
@ -527,7 +538,7 @@ function resourcesEach(datalist) {
527 538
			'<div class="mui-media-body">' +
528 539
			'<span class="listtit">' + item.resourceName + '</span>' +
529 540
			'<p class="mui-ellipsis listtit2">' + item.supportedServices + '</p>' +
530
			'<span class="listtit">' + item.professor.name + icon + '</span>' +
541
			'<span class="listtit">' + item.editProfessor.name + icon + '</span>' +
531 542
			'<p class="listtit3"><span>' + title + '</span><span>' + office + '</span><span>' + orgName + '</span><span>' + address + '</span></p>' +
532 543
			'</div></a></li>';
533 544