Browse Source

留言框旁图像和登录者头像一致,点击专家信息进入专家页,发表留言

jack 8 years ago
parent
commit
57a4fc36a0
2 changed files with 25 additions and 4 deletions
  1. 1 1
      articalInfo.html
  2. 24 3
      js/articalInfo.js

+ 1 - 1
articalInfo.html

@ -78,7 +78,7 @@
78 78
				<!--分享操作栏-->
79 79
				<div class="share-nav">
80 80
					<div class="clearfix">		
81
						<a class="proinfor floatL" href="information-brow.html" style="display:block;width:64%;">
81
						<a class="proinfor floatL" style="display:block;width:64%;" id="lineId">
82 82
							<div class="headblock floatL" style="width:40px"><img id="proHead" class="headimg headRadius" src="../images/default-photo.jpg" width="100%"></div>
83 83
							<div class="listtit2 floatL"><span style="margin-right:10px;color: #ff9900;" id="proName"></span><span id="proTitle"></span><span id="proOffice"></span><span id="proOrg"></span><span id="proAddress"></span></div>
84 84
						</a>

+ 24 - 3
js/articalInfo.js

@ -43,6 +43,7 @@ $(document).ready(function() {
43 43
					$("#articleName").text($info.articleTitle);
44 44
					$("#nameS,#proName").text($profesor.name);
45 45
					$("#orgName").text($profesor.orgName);
46
					$("#lineId").attr("href","information-brow.html?professorId="+$profesor.id);
46 47
					if($profesor.title) {
47 48
						if($profesor.office) {
48 49
							$("#title").text($profesor.title + " , ");
@ -60,7 +61,7 @@ $(document).ready(function() {
60 61
						$("#address").text($profesor.address);
61 62
					}
62 63
					if($profesor.hasHeadImage) {
63
						$("#headImg,#limg,#proHead").attr("src", "/images/head/" + $info.professorId + "_l.jpg")
64
						$("#headImg,#proHead").attr("src", "/images/head/" + $info.professorId + "_l.jpg")
64 65
					}
65 66
					if($info.subject) {
66 67
						industryShow($info.subject, "subjectList");
@ -263,6 +264,25 @@ $(document).ready(function() {
263 264
			}
264 265
		});
265 266
	}
267
	function userInformation(){
268
		$.ajax({
269
			url: "/ajax/professor/editBaseInfo/"+userid,
270
			dataType: 'json', //数据格式类型
271
			type: 'GET', //http请求类型
272
			timeout: 10000, //超时设置
273
			success: function(data) {
274
				console.log(data);
275
				if(data.success && data.data) {
276
					if(data.data.hasHeadImage==1){
277
					$("#limg").attr("src","/images/head/" + data.data.id + "_l.jpg")
278
					}
279
				}
280
			},
281
			error: function(XMLHttpRequest) {
282
				console.log(XMLHttpRequest)
283
			}
284
		});
285
	}
266 286
	function article() {
267 287
		$.ajax({
268 288
			url:"/ajax/leaveWord",
@ -295,10 +315,10 @@ $(document).ready(function() {
295 315
		var valueLength = document.getElementsByTagName("textarea")[0].value;
296 316
		var length = trim(valueLength);
297 317
		if(length) {
298
			document.getElementById("meSend").classList.add("colorAdd");
318
			$("#meSend").addClass("colorAdd");
299 319
			document.getElementById("meSend").style.background="#ff9900";		
300 320
		} else {
301
			document.getElementById("meSend").classList.remove("colorAdd");
321
			$("#meSend").removeClass("colorAdd");
302 322
			document.getElementById("meSend").style.background="#dadada";
303 323
		}
304 324
	});
@ -308,4 +328,5 @@ $(document).ready(function() {
308 328
	proInfoMain();
309 329
	proArticle();
310 330
	message();
331
	userInformation();
311 332
})