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
				<!--分享操作栏-->
78
				<!--分享操作栏-->
79
				<div class="share-nav">
79
				<div class="share-nav">
80
					<div class="clearfix">		
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
							<div class="headblock floatL" style="width:40px"><img id="proHead" class="headimg headRadius" src="../images/default-photo.jpg" width="100%"></div>
82
							<div class="headblock floatL" style="width:40px"><img id="proHead" class="headimg headRadius" src="../images/default-photo.jpg" width="100%"></div>
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>
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
						</a>
84
						</a>

+ 24 - 3
js/articalInfo.js

43
					$("#articleName").text($info.articleTitle);
43
					$("#articleName").text($info.articleTitle);
44
					$("#nameS,#proName").text($profesor.name);
44
					$("#nameS,#proName").text($profesor.name);
45
					$("#orgName").text($profesor.orgName);
45
					$("#orgName").text($profesor.orgName);
46
					$("#lineId").attr("href","information-brow.html?professorId="+$profesor.id);
46
					if($profesor.title) {
47
					if($profesor.title) {
47
						if($profesor.office) {
48
						if($profesor.office) {
48
							$("#title").text($profesor.title + " , ");
49
							$("#title").text($profesor.title + " , ");
60
						$("#address").text($profesor.address);
61
						$("#address").text($profesor.address);
61
					}
62
					}
62
					if($profesor.hasHeadImage) {
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
					if($info.subject) {
66
					if($info.subject) {
66
						industryShow($info.subject, "subjectList");
67
						industryShow($info.subject, "subjectList");
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
	function article() {
286
	function article() {
267
		$.ajax({
287
		$.ajax({
268
			url:"/ajax/leaveWord",
288
			url:"/ajax/leaveWord",
295
		var valueLength = document.getElementsByTagName("textarea")[0].value;
315
		var valueLength = document.getElementsByTagName("textarea")[0].value;
296
		var length = trim(valueLength);
316
		var length = trim(valueLength);
297
		if(length) {
317
		if(length) {
298
			document.getElementById("meSend").classList.add("colorAdd");
318
			$("#meSend").addClass("colorAdd");
299
			document.getElementById("meSend").style.background="#ff9900";		
319
			document.getElementById("meSend").style.background="#ff9900";		
300
		} else {
320
		} else {
301
			document.getElementById("meSend").classList.remove("colorAdd");
321
			$("#meSend").removeClass("colorAdd");
302
			document.getElementById("meSend").style.background="#dadada";
322
			document.getElementById("meSend").style.background="#dadada";
303
		}
323
		}
304
	});
324
	});
308
	proInfoMain();
328
	proInfoMain();
309
	proArticle();
329
	proArticle();
310
	message();
330
	message();
331
	userInformation();
311
})
332
})