|
@ -1,65 +1,65 @@
|
1
|
|
$(document).ready(function(){
|
|
1
|
$(document).ready(function() {
|
2
|
2
|
$(".unlogin").show();
|
3
|
3
|
$(".onlogin").hide();
|
4
|
|
|
|
4
|
|
5
|
5
|
var footerHeight = $("footer").outerHeight(true);
|
6
|
|
$('#container').css("padding-bottom", footerHeight +"px" );
|
|
6
|
$('#container').css("padding-bottom", footerHeight + "px");
|
7
|
7
|
//窗口大小变更事件
|
8
|
8
|
$(window).resize(function() {
|
9
|
|
footerHeight=$("footer").outerHeight(true);
|
10
|
|
$('#container').css("padding-bottom", footerHeight +"px" );
|
|
9
|
footerHeight = $("footer").outerHeight(true);
|
|
10
|
$('#container').css("padding-bottom", footerHeight + "px");
|
11
|
11
|
//console.log(footerHeight)
|
12
|
12
|
});
|
13
|
13
|
//底部企业入驻
|
14
|
14
|
var orgid = $.cookie('orgId');
|
15
|
|
$("#cmpSet2").on("click",function(){
|
16
|
|
if (orgid && orgid != "null" && orgid != null) {
|
17
|
|
location.href="cmp-portal/cmp-workspaces.html"
|
18
|
|
}else{
|
19
|
|
location.href="cmp-portal/cmp-settled-reg.html"
|
|
15
|
$("#cmpSet2").on("click", function() {
|
|
16
|
if(orgid && orgid != "null" && orgid != null) {
|
|
17
|
location.href = "cmp-portal/cmp-workspaces.html"
|
|
18
|
} else {
|
|
19
|
location.href = "cmp-portal/cmp-settled-reg.html"
|
20
|
20
|
}
|
21
|
21
|
})
|
22
|
22
|
|
23
|
23
|
});
|
24
|
24
|
//搜索框跳转页面
|
25
|
|
|
26
|
|
$("#search").on("click", function() {
|
|
25
|
|
|
26
|
$("#search").on("click", function() {
|
|
27
|
var searchContent = $("#searchContent").val();
|
|
28
|
location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
|
|
29
|
});
|
|
30
|
|
|
31
|
//enter绑定时间
|
|
32
|
$("#searchContent").keydown(function(e) {
|
|
33
|
if(e.which == 13) {
|
27
|
34
|
var searchContent = $("#searchContent").val();
|
|
35
|
console.log(searchContent);
|
28
|
36
|
location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
|
29
|
|
});
|
30
|
|
|
31
|
|
//enter绑定时间
|
32
|
|
$("#searchContent").keydown(function(e){
|
33
|
|
if(e.which==13) {
|
34
|
|
var searchContent = $("#searchContent").val();
|
35
|
|
console.log(searchContent);
|
36
|
|
location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
|
37
|
|
}
|
38
|
|
|
39
|
|
})
|
40
|
|
$("#hsearchContent").keydown(function(e){
|
41
|
|
if(e.which==13) {
|
42
|
|
var searchContent = $("#hsearchContent").val();
|
43
|
|
console.log(searchContent);
|
44
|
|
location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
|
45
|
|
}
|
46
|
|
})
|
47
|
|
|
48
|
|
$("#hsearch").on("click", function() {
|
|
37
|
}
|
|
38
|
|
|
39
|
})
|
|
40
|
$("#hsearchContent").keydown(function(e) {
|
|
41
|
if(e.which == 13) {
|
49
|
42
|
var searchContent = $("#hsearchContent").val();
|
|
43
|
console.log(searchContent);
|
50
|
44
|
location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
|
51
|
|
});
|
|
45
|
}
|
|
46
|
})
|
|
47
|
|
|
48
|
$("#hsearch").on("click", function() {
|
|
49
|
var searchContent = $("#hsearchContent").val();
|
|
50
|
location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
|
|
51
|
});
|
52
|
52
|
/*向下滚动时,header背景变半透明*/
|
53
|
53
|
$(document).scroll(function() {
|
54
|
54
|
var top = $(document).scrollTop();
|
55
|
|
|
56
|
|
if (top == 0) {
|
57
|
|
$(".navheader").removeClass("navhdown");
|
|
55
|
|
|
56
|
if(top == 0) {
|
|
57
|
$(".navheader").removeClass("navhdown");
|
58
|
58
|
} else {
|
59
|
|
$(".navheader").addClass("navhdown");
|
|
59
|
$(".navheader").addClass("navhdown");
|
60
|
60
|
}
|
61
|
61
|
|
62
|
|
if (top >= 300) {
|
|
62
|
if(top >= 300) {
|
63
|
63
|
$(".content-left").css({
|
64
|
64
|
"position": "fixed",
|
65
|
65
|
"top": "80px"
|
|
@ -69,40 +69,40 @@ $(document).scroll(function() {
|
69
|
69
|
"position": "static"
|
70
|
70
|
})
|
71
|
71
|
}
|
72
|
|
|
|
72
|
|
73
|
73
|
});
|
74
|
74
|
|
75
|
|
var userid;
|
76
|
|
function exit(){
|
77
|
|
$.cookie('userid', null);
|
78
|
|
$.cookie('userAuth', null);
|
79
|
|
$.cookie('userEmail', null);
|
80
|
|
$.cookie('userMobilePhone', null);
|
81
|
|
$.cookie('userName', null);
|
82
|
|
$.cookie('userType', null);
|
83
|
|
location.href="index.html"
|
84
|
|
}
|
|
75
|
var userid;
|
85
|
76
|
|
|
77
|
function exit() {
|
|
78
|
$.cookie('userid', null);
|
|
79
|
$.cookie('userAuth', null);
|
|
80
|
$.cookie('userEmail', null);
|
|
81
|
$.cookie('userMobilePhone', null);
|
|
82
|
$.cookie('userName', null);
|
|
83
|
$.cookie('userType', null);
|
|
84
|
location.href = "index.html"
|
|
85
|
}
|
86
|
86
|
|
87
|
|
function valUser(){
|
|
87
|
function valUser() {
|
88
|
88
|
var userid = $.cookie('userid');
|
89
|
89
|
var userAuth = $.cookie('userAuth');
|
90
|
|
if(userid == undefined || userid.length==0 || userid == "null" || userAuth == false){
|
91
|
|
location.href="login.html";
|
|
90
|
if(userid == undefined || userid.length == 0 || userid == "null" || userAuth == false) {
|
|
91
|
location.href = "login.html";
|
92
|
92
|
}
|
93
|
93
|
}
|
94
|
94
|
|
95
|
|
function GetQueryString(name) {
|
96
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
97
|
|
var r = window.location.search.substr(1).match(reg);
|
98
|
|
|
99
|
|
var context = "";
|
100
|
|
if (r != null)
|
101
|
|
context = r[2];
|
102
|
|
reg = null;
|
103
|
|
r = null;
|
104
|
|
return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);
|
105
|
|
}
|
|
95
|
function GetQueryString(name) {
|
|
96
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
97
|
var r = window.location.search.substr(1).match(reg);
|
|
98
|
|
|
99
|
var context = "";
|
|
100
|
if(r != null)
|
|
101
|
context = r[2];
|
|
102
|
reg = null;
|
|
103
|
r = null;
|
|
104
|
return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);
|
|
105
|
}
|
106
|
106
|
|
107
|
107
|
/* function GetQueryString(name) {
|
108
|
108
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
@ -115,124 +115,119 @@ function valUser(){
|
115
|
115
|
return context == null || context == "" || context == "undefined" ? "" : context;
|
116
|
116
|
}*/
|
117
|
117
|
|
118
|
|
|
119
|
|
function loginStatus(){
|
|
118
|
function loginStatus() {
|
120
|
119
|
userid = $.cookie('userid');
|
121
|
120
|
userAuth = $.cookie('userAuth');
|
122
|
121
|
authentication = $.cookie('authentication');
|
123
|
|
if(userid && userid != "null" && userid != null){
|
124
|
|
if(userAuth == "false" && authentication == "null"){
|
125
|
|
location.href="loginInviteFirst.html";
|
|
122
|
if(userid && userid != "null" && userid != null) {
|
|
123
|
if(userAuth == "false" && authentication == "null") {
|
|
124
|
location.href = "loginInviteFirst.html";
|
126
|
125
|
}
|
127
|
|
if(userAuth == "true" && authentication == "null"){
|
128
|
|
location.href="fillinfo-select.html";
|
|
126
|
if(userAuth == "true" && authentication == "null") {
|
|
127
|
location.href = "fillinfo-select.html";
|
129
|
128
|
}
|
130
|
|
if(userAuth == "true" && authentication != "null"){
|
|
129
|
if(userAuth == "true" && authentication != "null") {
|
131
|
130
|
$(".onlogin").show();
|
132
|
131
|
$(".unlogin").hide();
|
133
|
|
$(".portrait-p").attr("src","/images/head/"+userid+"_m.jpg");
|
134
|
|
$(".portrait-p").load(function(){//判断图片是否加载,加载不成功默认有默认的图像
|
135
|
|
})
|
136
|
|
.error(function(){
|
137
|
|
$(".portrait-p").attr("src","/images/default-photo.jpg");
|
138
|
|
});
|
|
132
|
$(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
|
|
133
|
$(".portrait-p").load(function() { //判断图片是否加载,加载不成功默认有默认的图像
|
|
134
|
})
|
|
135
|
.error(function() {
|
|
136
|
$(".portrait-p").attr("src", "/images/default-photo.jpg");
|
|
137
|
});
|
139
|
138
|
}
|
140
|
|
}else{
|
|
139
|
} else {
|
141
|
140
|
$(".unlogin").show();
|
142
|
141
|
$(".onlogin").hide();
|
143
|
142
|
}
|
144
|
143
|
}
|
145
|
144
|
|
146
|
145
|
//转换格式
|
147
|
|
function changeTime(dealtime){
|
148
|
|
var s = dealtime;
|
149
|
|
//console.log(s);
|
150
|
|
if(dealtime.length==8){
|
151
|
|
var y = s.substr(0,4);
|
152
|
|
var m = s.substr(4,2);
|
153
|
|
var d = s.substr(6,2);
|
154
|
|
var formatTime = y+"-"+m+"-"+d;
|
|
146
|
function changeTime(dealtime) {
|
|
147
|
var s = dealtime;
|
|
148
|
//console.log(s);
|
|
149
|
if(dealtime.length == 8) {
|
|
150
|
var y = s.substr(0, 4);
|
|
151
|
var m = s.substr(4, 2);
|
|
152
|
var d = s.substr(6, 2);
|
|
153
|
var formatTime = y + "-" + m + "-" + d;
|
155
|
154
|
return formatTime;
|
156
|
|
}
|
157
|
|
else
|
158
|
|
{
|
159
|
|
var y = s.substr(0,4);
|
160
|
|
var m = s.substr(4,2);
|
161
|
|
var d = s.substr(6,2);
|
162
|
|
var h = s.substr(8,2);
|
163
|
|
var minute = s.substr(10,2);
|
164
|
|
var formatTime = y+"-"+m+"-"+d+" "+h+":"+minute;
|
|
155
|
} else {
|
|
156
|
var y = s.substr(0, 4);
|
|
157
|
var m = s.substr(4, 2);
|
|
158
|
var d = s.substr(6, 2);
|
|
159
|
var h = s.substr(8, 2);
|
|
160
|
var minute = s.substr(10, 2);
|
|
161
|
var formatTime = y + "-" + m + "-" + d + " " + h + ":" + minute;
|
165
|
162
|
return formatTime;
|
166
|
|
}
|
167
|
|
|
168
|
163
|
}
|
|
164
|
|
|
165
|
}
|
169
|
166
|
//******过滤特殊字符*******//
|
170
|
|
function replaceStr(s)
|
171
|
|
{
|
|
167
|
function replaceStr(s) {
|
172
|
168
|
var pattern = new RegExp("-");
|
173
|
|
var rs = "";
|
174
|
|
for (var i = 0; i < s.length; i++) {
|
175
|
|
rs = rs+s.substr(i, 1).replace(pattern, '');
|
176
|
|
}
|
177
|
|
return rs;
|
178
|
|
}
|
|
169
|
var rs = "";
|
|
170
|
for(var i = 0; i < s.length; i++) {
|
|
171
|
rs = rs + s.substr(i, 1).replace(pattern, '');
|
|
172
|
}
|
|
173
|
return rs;
|
|
174
|
}
|
179
|
175
|
//**********************//
|
180
|
176
|
|
181
|
177
|
//根据内容的多少获取高度给父级设置高度
|
182
|
|
function limitHeight(){
|
|
178
|
function limitHeight() {
|
183
|
179
|
var Length = $(".limitBox").length;
|
184
|
|
for(var i=0; i<Length;i++){
|
|
180
|
for(var i = 0; i < Length; i++) {
|
185
|
181
|
var limitheight = $(".limitwords").eq(i).height();
|
186
|
182
|
console.log(limitheight);
|
187
|
|
$(".limitBox").eq(i).css("height",limitheight);
|
|
183
|
$(".limitBox").eq(i).css("height", limitheight);
|
188
|
184
|
}
|
189
|
|
|
190
|
|
}
|
191
|
185
|
|
|
186
|
}
|
192
|
187
|
|
193
|
188
|
//根据用户输入的Email跳转到相应的电子邮箱首页
|
194
|
|
var hash={
|
195
|
|
'qq.com': 'http://mail.qq.com',
|
196
|
|
'gmail.com': 'http://mail.google.com',
|
197
|
|
'sina.com': 'http://mail.sina.com.cn',
|
198
|
|
'163.com': 'http://mail.163.com',
|
199
|
|
'126.com': 'http://mail.126.com',
|
200
|
|
'yeah.net': 'http://www.yeah.net/',
|
201
|
|
'sohu.com': 'http://mail.sohu.com/',
|
202
|
|
'tom.com': 'http://mail.tom.com/',
|
203
|
|
'sogou.com': 'http://mail.sogou.com/',
|
204
|
|
'139.com': 'http://mail.10086.cn/',
|
205
|
|
'hotmail.com': 'http://www.hotmail.com',
|
206
|
|
'live.com': 'http://login.live.com/',
|
207
|
|
'live.cn': 'http://login.live.cn/',
|
208
|
|
'live.com.cn': 'http://login.live.com.cn',
|
209
|
|
'189.com': 'http://webmail16.189.cn/webmail/',
|
210
|
|
'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
|
211
|
|
'yahoo.cn': 'http://mail.cn.yahoo.com/',
|
212
|
|
'eyou.com': 'http://www.eyou.com/',
|
213
|
|
'21cn.com': 'http://mail.21cn.com/',
|
214
|
|
'188.com': 'http://www.188.com/',
|
215
|
|
'ustb.edu.cn': 'http://mail.ustb.edu.cn/',
|
216
|
|
'foxmail.coom': 'http://www.foxmail.com'
|
|
189
|
var hash = {
|
|
190
|
'qq.com': 'http://mail.qq.com',
|
|
191
|
'gmail.com': 'http://mail.google.com',
|
|
192
|
'sina.com': 'http://mail.sina.com.cn',
|
|
193
|
'163.com': 'http://mail.163.com',
|
|
194
|
'126.com': 'http://mail.126.com',
|
|
195
|
'yeah.net': 'http://www.yeah.net/',
|
|
196
|
'sohu.com': 'http://mail.sohu.com/',
|
|
197
|
'tom.com': 'http://mail.tom.com/',
|
|
198
|
'sogou.com': 'http://mail.sogou.com/',
|
|
199
|
'139.com': 'http://mail.10086.cn/',
|
|
200
|
'hotmail.com': 'http://www.hotmail.com',
|
|
201
|
'live.com': 'http://login.live.com/',
|
|
202
|
'live.cn': 'http://login.live.cn/',
|
|
203
|
'live.com.cn': 'http://login.live.com.cn',
|
|
204
|
'189.com': 'http://webmail16.189.cn/webmail/',
|
|
205
|
'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
|
|
206
|
'yahoo.cn': 'http://mail.cn.yahoo.com/',
|
|
207
|
'eyou.com': 'http://www.eyou.com/',
|
|
208
|
'21cn.com': 'http://mail.21cn.com/',
|
|
209
|
'188.com': 'http://www.188.com/',
|
|
210
|
'ustb.edu.cn': 'http://mail.ustb.edu.cn/',
|
|
211
|
'foxmail.coom': 'http://www.foxmail.com'
|
217
|
212
|
};
|
218
|
213
|
//轮播滚动函数
|
219
|
|
function Carousel(inde, num,show, childcount, obj, next, prev) {
|
220
|
|
var tapnum=0; //按钮可点击次数
|
221
|
|
if( childcount > num ){
|
222
|
|
next.css("display","block");
|
223
|
|
prev.css("display","none");
|
224
|
|
}else{
|
225
|
|
next.css("display","none");
|
226
|
|
prev.css("display","none");
|
|
214
|
function Carousel(inde, num, show, childcount, obj, next, prev) {
|
|
215
|
var tapnum = 0; //按钮可点击次数
|
|
216
|
if(childcount > num) {
|
|
217
|
next.css("display", "block");
|
|
218
|
prev.css("display", "none");
|
|
219
|
} else {
|
|
220
|
next.css("display", "none");
|
|
221
|
prev.css("display", "none");
|
227
|
222
|
}
|
228
|
|
next.click(function() {
|
229
|
|
if (!obj.is(":animated")) {
|
230
|
|
if (num < childcount) {
|
|
223
|
next.click(function() {
|
|
224
|
if(!obj.is(":animated")) {
|
|
225
|
if(num < childcount) {
|
231
|
226
|
tapnum++;
|
232
|
|
prev.css("display","block");
|
233
|
|
if(tapnum == childcount-show){
|
234
|
|
next.css("display","none");
|
235
|
|
|
|
227
|
prev.css("display", "block");
|
|
228
|
if(tapnum == childcount - show) {
|
|
229
|
next.css("display", "none");
|
|
230
|
|
236
|
231
|
}
|
237
|
232
|
num++;
|
238
|
233
|
obj.animate({
|
|
@ -242,13 +237,13 @@ function Carousel(inde, num,show, childcount, obj, next, prev) {
|
242
|
237
|
}
|
243
|
238
|
});
|
244
|
239
|
prev.click(function() {
|
245
|
|
|
246
|
|
if (!obj.is(":animated")) {
|
247
|
|
if (num > inde) {
|
|
240
|
|
|
241
|
if(!obj.is(":animated")) {
|
|
242
|
if(num > inde) {
|
248
|
243
|
tapnum--;
|
249
|
|
next.css("display","block");
|
250
|
|
if(tapnum == 0){
|
251
|
|
prev.css("display","none");
|
|
244
|
next.css("display", "block");
|
|
245
|
if(tapnum == 0) {
|
|
246
|
prev.css("display", "none");
|
252
|
247
|
}
|
253
|
248
|
num--;
|
254
|
249
|
obj.animate({
|
|
@ -261,33 +256,31 @@ function Carousel(inde, num,show, childcount, obj, next, prev) {
|
261
|
256
|
|
262
|
257
|
//评价字数限制
|
263
|
258
|
//字数限制函数
|
264
|
|
function limitTextCountFn(TextAreaId,countContainerId,count){
|
265
|
|
var curLength=$(TextAreaId).val().length;
|
266
|
|
if(curLength > count){
|
267
|
|
var num=$(TextAreaId).val().substr(0,count);
|
268
|
|
$(TextAreaId).val(num);
|
269
|
|
|
270
|
|
}
|
271
|
|
else {
|
272
|
|
$(countContainerId).text(count - $(TextAreaId).val().length);
|
273
|
|
}
|
|
259
|
function limitTextCountFn(TextAreaId, countContainerId, count) {
|
|
260
|
var curLength = $(TextAreaId).val().length;
|
|
261
|
if(curLength > count) {
|
|
262
|
var num = $(TextAreaId).val().substr(0, count);
|
|
263
|
$(TextAreaId).val(num);
|
|
264
|
|
|
265
|
} else {
|
|
266
|
$(countContainerId).text(count - $(TextAreaId).val().length);
|
|
267
|
}
|
274
|
268
|
};
|
275
|
269
|
|
276
|
270
|
//咨询申请主题字数限制函数
|
277
|
|
function titleLimitFontCountFn(){
|
278
|
|
var curLength= $("#consultTitle").val().length;
|
|
271
|
function titleLimitFontCountFn() {
|
|
272
|
var curLength = $("#consultTitle").val().length;
|
279
|
273
|
|
280
|
|
if(curLength>20){
|
281
|
|
var num = $("#consultTitle").val().substr(0,20);
|
|
274
|
if(curLength > 20) {
|
|
275
|
var num = $("#consultTitle").val().substr(0, 20);
|
282
|
276
|
$("#consultTitle").val(num);
|
283
|
|
}
|
284
|
|
|
|
277
|
}
|
|
278
|
|
285
|
279
|
};
|
286
|
|
|
287
|
280
|
|
288
|
|
function showmenu(){
|
289
|
|
$("#li_show").css("display","block");
|
290
|
|
}
|
|
281
|
function showmenu() {
|
|
282
|
$("#li_show").css("display", "block");
|
|
283
|
}
|
291
|
284
|
|
292
|
285
|
/*选择省份*/
|
293
|
286
|
$(document).on("click", "#Province li a", function() {
|
|
@ -315,127 +308,125 @@ $(document).on("click", "#City li a", function() {
|
315
|
308
|
}
|
316
|
309
|
});
|
317
|
310
|
|
318
|
|
|
319
|
311
|
//咨询 专家信息接口函数
|
320
|
|
function concultProInfo(professorId){
|
321
|
|
$.ajax({
|
322
|
|
url:"/ajax/professor/editBaseInfo/"+professorId,
|
323
|
|
type:"get",
|
324
|
|
data : {"id":professorId},
|
325
|
|
contentType : "application/x-www-form-urlencoded",
|
326
|
|
success:function(response){
|
327
|
|
//console.log(response);
|
328
|
|
var myData = response["data"];
|
329
|
|
|
330
|
|
$("#professorName").html(myData["name"]);
|
331
|
|
if(myData["title"]){
|
332
|
|
$("#professorTitle").html(myData["title"]+' ');
|
333
|
|
}
|
334
|
|
if(myData["department"]){
|
335
|
|
$("#profDepartment").html(myData["department"]+' ');
|
336
|
|
}
|
337
|
|
if(myData["orgName"]){
|
338
|
|
$("#profOrganization").html(myData["orgName"]+' ');
|
339
|
|
}
|
340
|
|
if(myData["address"]){
|
341
|
|
$("#profAdress").html(myData["address"]);
|
342
|
|
}
|
343
|
|
console.log(myData["consultCount"])
|
344
|
|
if(!myData["consultCount"]){
|
345
|
|
$("#starLevel").hide();
|
346
|
|
}
|
347
|
|
$("#byConsultConut").html(myData["consultCount"]);
|
348
|
|
$("#sendConsultBtn").attr("proId",myData["id"]);
|
349
|
|
|
350
|
|
//星级
|
351
|
|
var startConut = parseInt(myData["starLevel"]);
|
352
|
|
if(myData["consultCount"]){
|
353
|
|
if(!startConut){
|
354
|
|
$(".evastarbox2").hide();
|
355
|
|
}
|
356
|
|
}
|
357
|
|
for(var i = 0; i < startConut; i ++){
|
358
|
|
$("#starLevel .evastar2").eq(i).addClass("addStar");
|
359
|
|
}
|
360
|
|
|
361
|
|
//认证
|
362
|
|
var oSty=autho(myData.authType,myData.orgAuth,myData.authStatus);
|
363
|
|
$("#proModifyN").addClass(oSty.sty);
|
364
|
|
$("#proModifyN").attr("title",oSty.title);
|
365
|
|
|
366
|
|
//头像
|
367
|
|
if(myData["hasHeadImage"] == 0){
|
368
|
|
$("#prohead").attr("src","images/default-photo.jpg");
|
369
|
|
}
|
370
|
|
else {
|
371
|
|
$("#prohead").attr("src","images/head/"+myData["id"]+"_l.jpg");
|
|
312
|
function concultProInfo(professorId) {
|
|
313
|
$.ajax({
|
|
314
|
url: "/ajax/professor/editBaseInfo/" + professorId,
|
|
315
|
type: "get",
|
|
316
|
data: {
|
|
317
|
"id": professorId
|
|
318
|
},
|
|
319
|
contentType: "application/x-www-form-urlencoded",
|
|
320
|
success: function(response) {
|
|
321
|
//console.log(response);
|
|
322
|
var myData = response["data"];
|
|
323
|
|
|
324
|
$("#professorName").html(myData["name"]);
|
|
325
|
if(myData["title"]) {
|
|
326
|
$("#professorTitle").html(myData["title"] + ' ');
|
|
327
|
}
|
|
328
|
if(myData["department"]) {
|
|
329
|
$("#profDepartment").html(myData["department"] + ' ');
|
|
330
|
}
|
|
331
|
if(myData["orgName"]) {
|
|
332
|
$("#profOrganization").html(myData["orgName"] + ' ');
|
|
333
|
}
|
|
334
|
if(myData["address"]) {
|
|
335
|
$("#profAdress").html(myData["address"]);
|
|
336
|
}
|
|
337
|
console.log(myData["consultCount"])
|
|
338
|
if(!myData["consultCount"]) {
|
|
339
|
$("#starLevel").hide();
|
|
340
|
}
|
|
341
|
$("#byConsultConut").html(myData["consultCount"]);
|
|
342
|
$("#sendConsultBtn").attr("proId", myData["id"]);
|
|
343
|
|
|
344
|
//星级
|
|
345
|
var startConut = parseInt(myData["starLevel"]);
|
|
346
|
if(myData["consultCount"]) {
|
|
347
|
if(!startConut) {
|
|
348
|
$(".evastarbox2").hide();
|
372
|
349
|
}
|
373
|
|
|
374
|
|
|
375
|
|
},
|
376
|
|
error:function(error){
|
377
|
|
$.MsgBox.Alert("message","请求数据失败");
|
378
|
350
|
}
|
379
|
|
});
|
|
351
|
for(var i = 0; i < startConut; i++) {
|
|
352
|
$("#starLevel .evastar2").eq(i).addClass("addStar");
|
|
353
|
}
|
|
354
|
|
|
355
|
//认证
|
|
356
|
var oSty = autho(myData.authType, myData.orgAuth, myData.authStatus);
|
|
357
|
$("#proModifyN").addClass(oSty.sty);
|
|
358
|
$("#proModifyN").attr("title", oSty.title);
|
|
359
|
|
|
360
|
//头像
|
|
361
|
if(myData["hasHeadImage"] == 0) {
|
|
362
|
$("#prohead").attr("src", "images/default-photo.jpg");
|
|
363
|
} else {
|
|
364
|
$("#prohead").attr("src", "images/head/" + myData["id"] + "_l.jpg");
|
|
365
|
}
|
|
366
|
|
|
367
|
},
|
|
368
|
error: function(error) {
|
|
369
|
$.MsgBox.Alert("message", "请求数据失败");
|
|
370
|
}
|
|
371
|
});
|
380
|
372
|
};
|
381
|
373
|
|
382
|
374
|
//发送咨询
|
383
|
|
function sendConsultHandler(professorId){
|
|
375
|
function sendConsultHandler(professorId) {
|
384
|
376
|
|
385
|
|
var professorId = professorId;
|
386
|
|
var consult_type = $(".clicknow").text();//咨询类型
|
387
|
|
var consult_title = $("#consultTitle").val();//咨询主题
|
388
|
|
var consult_content = $("#consultcontent").val();//咨询内容
|
|
377
|
var professorId = professorId;
|
|
378
|
var consult_type = $(".clicknow").text(); //咨询类型
|
|
379
|
var consult_title = $("#consultTitle").val(); //咨询主题
|
|
380
|
var consult_content = $("#consultcontent").val(); //咨询内容
|
389
|
381
|
var consultStr = {
|
390
|
|
"consultType":consult_type,
|
391
|
|
"consultTitle":consult_title,
|
392
|
|
"consultContant":consult_content,
|
393
|
|
"professorId":professorId,
|
394
|
|
"consultantId":userid
|
|
382
|
"consultType": consult_type,
|
|
383
|
"consultTitle": consult_title,
|
|
384
|
"consultContant": consult_content,
|
|
385
|
"professorId": professorId,
|
|
386
|
"consultantId": userid
|
395
|
387
|
};
|
396
|
|
|
397
|
|
if(consult_type == '' || consult_title == '' || consult_content == ''){
|
398
|
|
$.MsgBox.Alert("消息提醒","请填写完整");
|
|
388
|
|
|
389
|
if(consult_type == '' || consult_title == '' || consult_content == '') {
|
|
390
|
$.MsgBox.Alert("消息提醒", "请填写完整");
|
399
|
391
|
};
|
400
|
|
if(consult_type == ''){
|
401
|
|
$.MsgBox.Alert("消息提醒","请选择联系目的");
|
|
392
|
if(consult_type == '') {
|
|
393
|
$.MsgBox.Alert("消息提醒", "请选择联系目的");
|
402
|
394
|
}
|
403
|
|
if(consult_title == ''){
|
404
|
|
$.MsgBox.Alert("消息提醒","请填写咨询目的");
|
|
395
|
if(consult_title == '') {
|
|
396
|
$.MsgBox.Alert("消息提醒", "请填写咨询目的");
|
405
|
397
|
}
|
406
|
|
if(consult_content == ''){
|
407
|
|
$.MsgBox.Alert("消息提醒","请填写咨询内容");
|
|
398
|
if(consult_content == '') {
|
|
399
|
$.MsgBox.Alert("消息提醒", "请填写咨询内容");
|
408
|
400
|
}
|
409
|
|
|
|
401
|
|
410
|
402
|
if(userid && userid != null && userid != "null" && consult_type != '' &&
|
411
|
|
consult_title != '' && consult_content != ''
|
412
|
|
){
|
413
|
|
|
|
403
|
consult_title != '' && consult_content != ''
|
|
404
|
) {
|
|
405
|
|
414
|
406
|
$.ajax({
|
415
|
|
"url" :"/ajax/consult",
|
416
|
|
"type" : "post",
|
|
407
|
"url": "/ajax/consult",
|
|
408
|
"type": "post",
|
417
|
409
|
//传值:咨询类型、主题、内容、专家id、申请人id
|
418
|
|
"data" : consultStr,
|
419
|
|
"contentType" : "application/x-www-form-urlencoded",
|
420
|
|
"dataType" : "json",
|
421
|
|
"success" : function(response) {
|
|
410
|
"data": consultStr,
|
|
411
|
"contentType": "application/x-www-form-urlencoded",
|
|
412
|
"dataType": "json",
|
|
413
|
"success": function(response) {
|
422
|
414
|
console.log(response);
|
423
|
415
|
},
|
424
|
|
"error":function (){
|
425
|
|
$.MsgBox.Alert("消息提醒","咨询申请失败");
|
|
416
|
"error": function() {
|
|
417
|
$.MsgBox.Alert("消息提醒", "咨询申请失败");
|
426
|
418
|
},
|
427
|
|
|
428
|
|
"complete":function(){
|
|
419
|
|
|
420
|
"complete": function() {
|
429
|
421
|
//$(".consultapply").remove();
|
430
|
422
|
$(".blackcover").remove();
|
431
|
|
$("body").css("position","");
|
432
|
|
$.MsgBox.Alert("消息提醒","咨询申请成功");
|
|
423
|
$("body").css("position", "");
|
|
424
|
$.MsgBox.Alert("消息提醒", "咨询申请成功");
|
433
|
425
|
$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
|
434
|
426
|
},
|
435
|
427
|
});
|
436
|
428
|
}
|
437
|
429
|
|
438
|
|
|
439
|
430
|
};
|
440
|
431
|
|
441
|
432
|
/*标志*/
|
|
@ -467,47 +458,49 @@ function autho() {
|
467
|
458
|
}
|
468
|
459
|
}
|
469
|
460
|
|
470
|
|
|
471
|
461
|
//获取用户类型
|
472
|
462
|
|
473
|
463
|
var ifuser = ifUserType();
|
474
|
|
function ifUserType(pa){
|
|
464
|
|
|
465
|
function ifUserType(pa) {
|
475
|
466
|
if(pa) {
|
476
|
|
var useridtype =pa;
|
477
|
|
}else{
|
478
|
|
var useridtype = $.cookie('userid');
|
|
467
|
var useridtype = pa;
|
|
468
|
} else {
|
|
469
|
var useridtype = $.cookie('userid');
|
479
|
470
|
}
|
480
|
|
var authType2,authentication2;
|
481
|
|
if (useridtype && useridtype != "null" && useridtype != null) {
|
|
471
|
var authType2, authentication2;
|
|
472
|
if(useridtype && useridtype != "null" && useridtype != null) {
|
482
|
473
|
$.ajax({
|
483
|
|
"url" :"/ajax/professor/auth",
|
484
|
|
"type" : "GET",
|
485
|
|
"data" :{"id":useridtype} ,
|
486
|
|
"dataType" : "json",
|
487
|
|
"async":false,
|
488
|
|
"success" : function(data) {
|
489
|
|
if(data.success){
|
|
474
|
"url": "/ajax/professor/auth",
|
|
475
|
"type": "GET",
|
|
476
|
"data": {
|
|
477
|
"id": useridtype
|
|
478
|
},
|
|
479
|
"dataType": "json",
|
|
480
|
"async": false,
|
|
481
|
"success": function(data) {
|
|
482
|
if(data.success) {
|
490
|
483
|
authType2 = data.data.authType;
|
491
|
484
|
authentication2 = data.data.authentication;
|
492
|
485
|
}
|
493
|
486
|
}
|
494
|
487
|
});
|
495
|
488
|
}
|
496
|
|
return{
|
497
|
|
"authType2":authType2,
|
498
|
|
"authentication2":authentication2,
|
499
|
|
}
|
|
489
|
return {
|
|
490
|
"authType2": authType2,
|
|
491
|
"authentication2": authentication2,
|
|
492
|
}
|
500
|
493
|
}
|
501
|
494
|
|
502
|
495
|
//工作台判断用户类型显示用户权限
|
503
|
|
if ($.cookie('userName') && $.cookie('userName') != "null" && $.cookie('userName') != null) {
|
504
|
|
if(ifuser.authType2==0){
|
|
496
|
if($.cookie('userName') && $.cookie('userName') != "null" && $.cookie('userName') != null) {
|
|
497
|
if(ifuser.authType2 == 0) {
|
505
|
498
|
$("#repalyf").addClass("repalyf");
|
506
|
499
|
/*点击未读咨询消息查看*/
|
507
|
500
|
$("#gozixu").on("click", function() {
|
508
|
501
|
window.location.href = "myConsult.html";
|
509
|
502
|
})
|
510
|
|
}else{
|
|
503
|
} else {
|
511
|
504
|
$(".nohide").show();
|
512
|
505
|
/*点击未读咨询消息查看*/
|
513
|
506
|
$("#gozixu").on("click", function() {
|
|
@ -516,44 +509,43 @@ if ($.cookie('userName') && $.cookie('userName') != "null" && $.cookie('userName
|
516
|
509
|
}
|
517
|
510
|
}
|
518
|
511
|
/*多行文本框样式(带有限制数字)模拟focus效果*/
|
519
|
|
$(".msgContbox textarea").focus(function(){
|
520
|
|
$(this).parent().css("border-color","#ff9900");
|
521
|
|
}).blur(function(){
|
522
|
|
$(this).parent().css("border-color","#E5E5E5");
|
|
512
|
$(".msgContbox textarea").focus(function() {
|
|
513
|
$(this).parent().css("border-color", "#ff9900");
|
|
514
|
}).blur(function() {
|
|
515
|
$(this).parent().css("border-color", "#E5E5E5");
|
523
|
516
|
})
|
524
|
517
|
|
525
|
518
|
//时间显示规则
|
526
|
|
function commenTime(startTime){
|
527
|
|
var nowTimg = new Date();
|
528
|
|
var startdate = new Date();
|
529
|
|
startdate.setFullYear(parseInt(startTime.substring(0,4)));
|
530
|
|
startdate.setMonth(parseInt(startTime.substring(4,6))-1);
|
531
|
|
startdate.setDate(parseInt(startTime.substring(6,8)));
|
532
|
|
startdate.setHours(parseInt(startTime.substring(8,10)));
|
533
|
|
startdate.setMinutes(parseInt(startTime.substring(10,12)));
|
534
|
|
startdate.setSeconds(parseInt(startTime.substring(12,14)));
|
535
|
|
var date3=nowTimg.getTime()-startdate.getTime(); //时间差的毫秒数
|
536
|
|
var hours = parseInt((date3 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
537
|
|
var minutes = parseInt((date3 % (1000 * 60 * 60)) / (1000 * 60));
|
538
|
|
if(date3 < 60000){
|
539
|
|
return "刚刚";
|
540
|
|
}else if(date3 >= 60000 && date3 < 3600000){
|
541
|
|
return minutes + "分钟前";
|
542
|
|
}else if(date3 >= 3600000 && date3 < 86400000){
|
543
|
|
return hours + "小时前";
|
544
|
|
}else if(date3 >= 86400000 && date3 < 172800000){
|
545
|
|
return "昨天 " + startTime.substring(8,10) + ":" +startTime.substring(10,12);
|
546
|
|
|
547
|
|
}else if(date3 >= 172800000 && date3 < 31536000000){
|
548
|
|
return startTime.substring(4,6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6,8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8,10) + ":" + startTime.substring(10,12);
|
549
|
|
}
|
550
|
|
else{
|
551
|
|
return startTime.substring(0,4) + "年" + startTime.substring(4,6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6,8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8,10) + ":" + startTime.substring(10,12);
|
552
|
|
}
|
|
519
|
function commenTime(startTime) {
|
|
520
|
var nowTimg = new Date();
|
|
521
|
var startdate = new Date();
|
|
522
|
startdate.setFullYear(parseInt(startTime.substring(0, 4)));
|
|
523
|
startdate.setMonth(parseInt(startTime.substring(4, 6)) - 1);
|
|
524
|
startdate.setDate(parseInt(startTime.substring(6, 8)));
|
|
525
|
startdate.setHours(parseInt(startTime.substring(8, 10)));
|
|
526
|
startdate.setMinutes(parseInt(startTime.substring(10, 12)));
|
|
527
|
startdate.setSeconds(parseInt(startTime.substring(12, 14)));
|
|
528
|
var date3 = nowTimg.getTime() - startdate.getTime(); //时间差的毫秒数
|
|
529
|
var hours = parseInt((date3 % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
|
530
|
var minutes = parseInt((date3 % (1000 * 60 * 60)) / (1000 * 60));
|
|
531
|
if(date3 < 60000) {
|
|
532
|
return "刚刚";
|
|
533
|
} else if(date3 >= 60000 && date3 < 3600000) {
|
|
534
|
return minutes + "分钟前";
|
|
535
|
} else if(date3 >= 3600000 && date3 < 86400000) {
|
|
536
|
return hours + "小时前";
|
|
537
|
} else if(date3 >= 86400000 && date3 < 172800000) {
|
|
538
|
return "昨天 " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12);
|
|
539
|
|
|
540
|
} else if(date3 >= 172800000 && date3 < 31536000000) {
|
|
541
|
return startTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12);
|
|
542
|
} else {
|
|
543
|
return startTime.substring(0, 4) + "年" + startTime.substring(4, 6).replace(/\b(0+)/gi, "") + "月" + startTime.substring(6, 8).replace(/\b(0+)/gi, "") + "日 " + startTime.substring(8, 10) + ":" + startTime.substring(10, 12);
|
|
544
|
}
|
553
|
545
|
}
|
554
|
546
|
/*时间转换*/
|
555
|
547
|
function TimeTr(dealtime) {
|
556
|
|
var myDate = new Date();
|
|
548
|
var myDate = new Date();
|
557
|
549
|
var s = dealtime;
|
558
|
550
|
var y = s.substr(0, 4);
|
559
|
551
|
var m = s.substr(4, 2);
|
|
@ -561,21 +553,21 @@ function TimeTr(dealtime) {
|
561
|
553
|
var h = s.substr(8, 2);
|
562
|
554
|
var minute = s.substr(10, 2);
|
563
|
555
|
var formatTime;
|
564
|
|
if(s.length<=6){
|
|
556
|
if(s.length <= 6) {
|
565
|
557
|
formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月";
|
566
|
|
}else if(s.length>6 && s.length<=8){
|
567
|
|
formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "")+ "日 ";
|
568
|
|
}else{
|
569
|
|
formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "")+ "日 " + h + ":" + minute;
|
570
|
|
if(y != myDate.getFullYear()){
|
571
|
|
formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "")+ "日 " + h + ":" + minute;
|
|
558
|
} else if(s.length > 6 && s.length <= 8) {
|
|
559
|
formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 ";
|
|
560
|
} else {
|
|
561
|
formatTime = m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
|
|
562
|
if(y != myDate.getFullYear()) {
|
|
563
|
formatTime = y + "年" + m.replace(/\b(0+)/gi, "") + "月" + d.replace(/\b(0+)/gi, "") + "日 " + h + ":" + minute;
|
572
|
564
|
}
|
573
|
565
|
}
|
574
|
566
|
return formatTime;
|
575
|
567
|
}
|
576
|
568
|
|
577
|
569
|
/*判断是否收藏资源文章或者是否关注专家*/
|
578
|
|
function ifcollectionAbout(watchObject,num) {
|
|
570
|
function ifcollectionAbout(watchObject, num) {
|
579
|
571
|
$.ajax('/ajax/watch/hasWatch', {
|
580
|
572
|
data: {
|
581
|
573
|
"professorId": userid,
|
|
@ -587,25 +579,25 @@ function ifcollectionAbout(watchObject,num) {
|
587
|
579
|
async: false,
|
588
|
580
|
success: function(data) {
|
589
|
581
|
if(data.success && data.data != null) {
|
590
|
|
if(num=="1"){//已关注专家
|
|
582
|
if(num == "1") { //已关注专家
|
591
|
583
|
$("#attentBtn").addClass("attenedSpan");
|
592
|
584
|
$("#attentBtn").text("已关注");
|
593
|
|
}else{//已收藏资源或文章
|
|
585
|
} else { //已收藏资源或文章
|
594
|
586
|
$("#collectBtn").removeClass("icon-collect");
|
595
|
587
|
$("#collectBtn").addClass("icon-collected");
|
596
|
588
|
}
|
597
|
589
|
} else {
|
598
|
|
if(num=="1"){//关注专家
|
|
590
|
if(num == "1") { //关注专家
|
599
|
591
|
$("#attentBtn").removeClass("attenedSpan");
|
600
|
592
|
$("#attentBtn").text("关注");
|
601
|
|
}else{//收藏资源或文章
|
|
593
|
} else { //收藏资源或文章
|
602
|
594
|
$("#collectBtn").addClass("icon-collect");
|
603
|
595
|
$("#collectBtn").removeClass("icon-collected");
|
604
|
596
|
}
|
605
|
597
|
}
|
606
|
598
|
},
|
607
|
599
|
error: function(data) {
|
608
|
|
$.MsgBox.Alert('提示',"服务器链接超时");
|
|
600
|
$.MsgBox.Alert('提示', "服务器链接超时");
|
609
|
601
|
}
|
610
|
602
|
});
|
611
|
603
|
}
|
|
@ -623,24 +615,24 @@ function collectionAbout(watchObject, num) {
|
623
|
615
|
async: false,
|
624
|
616
|
success: function(data) {
|
625
|
617
|
if(data.success) {
|
626
|
|
if(num=="1"){//关注专家
|
|
618
|
if(num == "1") { //关注专家
|
627
|
619
|
$("#attentBtn").addClass("attenedSpan");
|
628
|
620
|
$("#attentBtn").text("已关注");
|
629
|
|
}else{//收藏资源或文章
|
|
621
|
} else { //收藏资源或文章
|
630
|
622
|
$("#collectBtn").removeClass("icon-collect");
|
631
|
623
|
$("#collectBtn").addClass("icon-collected");
|
632
|
624
|
}
|
633
|
625
|
}
|
634
|
626
|
},
|
635
|
627
|
error: function(data) {
|
636
|
|
$.MsgBox.Alert('提示',"服务器链接超时");
|
|
628
|
$.MsgBox.Alert('提示', "服务器链接超时");
|
637
|
629
|
}
|
638
|
630
|
});
|
639
|
631
|
}
|
640
|
632
|
/*取消收藏资源、文章或者取消关注专家*/
|
641
|
633
|
function cancelCollectionAbout(watchObject, num) {
|
642
|
634
|
$.ajax({
|
643
|
|
url:'/ajax/watch/delete',
|
|
635
|
url: '/ajax/watch/delete',
|
644
|
636
|
data: {
|
645
|
637
|
professorId: userid,
|
646
|
638
|
watchObject: watchObject
|
|
@ -652,29 +644,49 @@ function cancelCollectionAbout(watchObject, num) {
|
652
|
644
|
success: function(data) {
|
653
|
645
|
console.log(data.success)
|
654
|
646
|
if(data.success) {
|
655
|
|
if(num=="1"){//关注专家
|
|
647
|
if(num == "1") { //关注专家
|
656
|
648
|
$("#attentBtn").removeClass("attenedSpan");
|
657
|
649
|
$("#attentBtn").text("关注");
|
658
|
|
}else{//收藏资源或文章
|
|
650
|
} else { //收藏资源或文章
|
659
|
651
|
$("#collectBtn").addClass("icon-collect");
|
660
|
652
|
$("#collectBtn").removeClass("icon-collected");
|
661
|
653
|
}
|
662
|
|
|
|
654
|
|
663
|
655
|
}
|
664
|
656
|
},
|
665
|
|
error:function(data) {
|
666
|
|
$.MsgBox.Alert('提示',"服务器链接超时");
|
|
657
|
error: function(data) {
|
|
658
|
$.MsgBox.Alert('提示', "服务器链接超时");
|
667
|
659
|
}
|
668
|
660
|
});
|
669
|
661
|
}
|
670
|
662
|
//企业规模
|
671
|
|
var orgSizeShow ={'1':'50人以内','2':'50-100人','3':'100-200人','4':'200-500人','5':'500-1000人','6':'1000人以上'}
|
|
663
|
var orgSizeShow = {
|
|
664
|
'1': '50人以内',
|
|
665
|
'2': '50-100人',
|
|
666
|
'3': '100-200人',
|
|
667
|
'4': '200-500人',
|
|
668
|
'5': '500-1000人',
|
|
669
|
'6': '1000人以上'
|
|
670
|
}
|
672
|
671
|
//企业类型
|
673
|
|
var orgTypeShow={"2":"上市企业","3":"国有企业","4":"合资企业","5":"私人企业","6":"外资企业","7":"初创企业"}
|
|
672
|
var orgTypeShow = {
|
|
673
|
"2": "上市企业",
|
|
674
|
"3": "国有企业",
|
|
675
|
"4": "合资企业",
|
|
676
|
"5": "私人企业",
|
|
677
|
"6": "外资企业",
|
|
678
|
"7": "初创企业"
|
|
679
|
}
|
674
|
680
|
//学位
|
675
|
|
var eduDegree={"1":"博士","2":"硕士","3":"学士","4":"大专","5":"其他"}
|
|
681
|
var eduDegree = {
|
|
682
|
"1": "博士",
|
|
683
|
"2": "硕士",
|
|
684
|
"3": "学士",
|
|
685
|
"4": "大专",
|
|
686
|
"5": "其他"
|
|
687
|
}
|
676
|
688
|
|
677
|
|
function hotKey(sel,fontSizeNum,keyNum) {
|
|
689
|
function hotKey(sel, num) {
|
678
|
690
|
|
679
|
691
|
$(sel).bind({
|
680
|
692
|
paste: function(e) {
|
|
@ -766,6 +778,8 @@ function hotKey(sel,fontSizeNum,keyNum) {
|
766
|
778
|
$(".keydrop").on("click", "li", function() {
|
767
|
779
|
var oValue = $(this).text();
|
768
|
780
|
var oJudge = $(this).parents(".col-w-12").siblings().find("ul.ulspace li");
|
|
781
|
var addNum = $(this).parents(".keydrop").siblings("input").attr("data-num");
|
|
782
|
|
769
|
783
|
for(var i = 0; i < oJudge.length; i++) {
|
770
|
784
|
if(oValue == oJudge[i].innerText) {
|
771
|
785
|
$.MsgBox.Alert('提示', '添加内容不能重复');
|
|
@ -775,22 +789,28 @@ function hotKey(sel,fontSizeNum,keyNum) {
|
775
|
789
|
$(this).parents(".col-w-12").siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
|
776
|
790
|
$(this).parents(".keydrop").siblings("input").val("");
|
777
|
791
|
$(this).parents(".keydrop").siblings("button").hide();
|
778
|
|
if(oJudge.length == keyNum-1) {
|
|
792
|
if(oJudge.length == addNum - 1) {
|
779
|
793
|
$(this).parents(".keydrop").siblings("input").val("");
|
780
|
794
|
$(this).parents(".col-w-12").hide();
|
781
|
795
|
}
|
782
|
796
|
$(this).parent("ul").html("")
|
783
|
797
|
})
|
|
798
|
if(num == 1) {
|
|
799
|
return;
|
|
800
|
}
|
784
|
801
|
/*添加*/
|
785
|
802
|
$("button:contains('添加')").click(function() {
|
786
|
803
|
var oValue = $(this).siblings("input").val().trim();
|
787
|
804
|
var oJudge = $(this).parent().siblings().find("ul.ulspace li");
|
|
805
|
var addContent = $(this).siblings("input").attr("data-pro");
|
|
806
|
var addNum = $(this).siblings("input").attr("data-num");
|
|
807
|
var addfontSizeNum = $(this).siblings("input").attr("data-fontSizeN");
|
788
|
808
|
if(!oValue) {
|
789
|
809
|
$.MsgBox.Alert('提示', '请先填写内容');
|
790
|
810
|
return;
|
791
|
811
|
}
|
792
|
|
if(oValue.length > fontSizeNum) {
|
793
|
|
$.MsgBox.Alert('提示', '添加内容不能超过'+fontSizeNum+'个字');
|
|
812
|
if(oValue.length > addfontSizeNum) {
|
|
813
|
$.MsgBox.Alert('提示', addContent);
|
794
|
814
|
return;
|
795
|
815
|
}
|
796
|
816
|
for(var i = 0; i < oJudge.length; i++) {
|
|
@ -802,10 +822,9 @@ function hotKey(sel,fontSizeNum,keyNum) {
|
802
|
822
|
$(this).parent().siblings().find("ul.ulspace").append('<li>' + oValue + '<div class="closeThis"></div></li>');
|
803
|
823
|
$(this).hide();
|
804
|
824
|
$(this).siblings("input").val("");
|
805
|
|
if(oJudge.length == keyNum-1) {
|
|
825
|
if(oJudge.length == addNum - 1) {
|
806
|
826
|
$(this).val("").parents(".col-w-12").hide();
|
807
|
827
|
}
|
808
|
828
|
$(this).siblings(".keydrop").find("ul").html("");
|
809
|
829
|
})
|
810
|
|
}
|
811
|
|
|
|
830
|
}
|