jack 7 vuotta sitten
vanhempi
commit
92e8c9b091
2 muutettua tiedostoa jossa 34 lisäystä ja 4 poistoa
  1. 1 1
      js/articalShow2.js
  2. 33 3
      js/common.js

+ 1 - 1
js/articalShow2.js

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

+ 33 - 3
js/common.js

@ -131,9 +131,7 @@ function loginStatus() {
131 131
		if(userAuth == "true" && authentication == "null") {
132 132
			location.href = "fillinfo-select.html";
133 133
		}
134
		alert(1);
135 134
		if(userAuth == "true" && authentication != "null") {
136
			alert(2)
137 135
			$(".onlogin").show();
138 136
			$(".unlogin").hide();
139 137
			$(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
@ -155,7 +153,39 @@ function loginStatus() {
155 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 189
function unReadedCount(id){//查询指定用户的未读消息数量
160 190
	$.ajax({
161 191
		type:"get",