jack 7 年之前
父节点
当前提交
92e8c9b091
共有 2 个文件被更改,包括 34 次插入4 次删除
  1. 1 1
      js/articalShow2.js
  2. 33 3
      js/common.js

+ 1 - 1
js/articalShow2.js

6
var experarray = [];
6
var experarray = [];
7
var createTime,orderKey;
7
var createTime,orderKey;
8
$(function() {
8
$(function() {
9
	loginStatus();//判断个人是否登录
9
	loginYesOrNo();//判断个人是否登录
10
	articleshow();
10
	articleshow();
11
	relevantExperts();
11
	relevantExperts();
12
	relevantResources(); 
12
	relevantResources(); 

+ 33 - 3
js/common.js

131
		if(userAuth == "true" && authentication == "null") {
131
		if(userAuth == "true" && authentication == "null") {
132
			location.href = "fillinfo-select.html";
132
			location.href = "fillinfo-select.html";
133
		}
133
		}
134
		alert(1);
135
		if(userAuth == "true" && authentication != "null") {
134
		if(userAuth == "true" && authentication != "null") {
136
			alert(2)
137
			$(".onlogin").show();
135
			$(".onlogin").show();
138
			$(".unlogin").hide();
136
			$(".unlogin").hide();
139
			$(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
137
			$(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
155
		$(".onlogin").hide();
153
		$(".onlogin").hide();
156
	}
154
	}
157
}
155
}
158
156
function loginYesOrNo() {
157
	userid = $.cookie('userid');
158
	userAuth = $.cookie('userAuth');
159
	authentication = $.cookie('authentication');
160
	if(userid && userid != "null" && userid != null) {
161
		if(userAuth == "false" && authentication == "null") {
162
			location.href = "/loginInviteFirst.html";
163
		}
164
		if(userAuth == "true" && authentication == "null") {
165
			location.href = "/fillinfo-select.html";
166
		}
167
		if(userAuth == "true" && authentication != "null") {
168
			$(".onlogin").show();
169
			$(".unlogin").hide();
170
			$(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
171
			$(".portrait-p").load(function() { //判断图片是否加载,加载不成功默认有默认的图像									
172
				})
173
				.error(function() {
174
					$(".portrait-p").attr("src", "/images/default-photo.jpg");
175
				});
176
			unReadedCount(userid);
177
		}
178
		$(".portrait-p").on("click",function(){
179
			location.href="/userInforShow.html?professorId="+userid;
180
		})
181
		$(".onlogin").on("click",".goMyInf",function(){
182
			$(this).attr("href","/userInforShow.html?professorId="+userid)
183
		})
184
	} else {
185
		$(".unlogin").show();
186
		$(".onlogin").hide();
187
	}
188
}
159
function unReadedCount(id){//查询指定用户的未读消息数量
189
function unReadedCount(id){//查询指定用户的未读消息数量
160
	$.ajax({
190
	$.ajax({
161
		type:"get",
191
		type:"get",