|
@@ -99,13 +99,27 @@ function initPageClick() {
|
|
|
var hasExpClass = $(this).parent().hasClass('work-exp');
|
|
|
var hasEduClass = $(this).parent().hasClass('education-require');
|
|
|
if (hasExpClass) {
|
|
|
- condition.workExperience = $(this).attr('data-value');
|
|
|
- $(this).addClass("textActive").siblings("span").removeClass("textActive");
|
|
|
+ var hasActive = $(this).hasClass('textActive');
|
|
|
+ if (hasActive) {
|
|
|
+ $(this).removeClass('textActive');
|
|
|
+ condition.workExperience = '';
|
|
|
+ } else {
|
|
|
+ $(this).addClass('textActive');
|
|
|
+ condition.workExperience = $(this).attr('data-value');
|
|
|
+ }
|
|
|
+ // $(this).addClass("textActive").siblings("span").removeClass("textActive");
|
|
|
getRecruitList();
|
|
|
}
|
|
|
if (hasEduClass) {
|
|
|
- condition.education = $(this).attr('data-value');
|
|
|
- $(this).addClass("textActive").siblings("span").removeClass("textActive");
|
|
|
+ var hasActive = $(this).hasClass('textActive');
|
|
|
+ if (hasActive) {
|
|
|
+ $(this).removeClass('textActive');
|
|
|
+ condition.education = '';
|
|
|
+ } else {
|
|
|
+ $(this).addClass('textActive');
|
|
|
+ condition.education = $(this).attr('data-value');
|
|
|
+ }
|
|
|
+ // $(this).addClass("textActive").siblings("span").removeClass("textActive");
|
|
|
getRecruitList();
|
|
|
}
|
|
|
})
|
|
@@ -168,6 +182,8 @@ function getRecruitList() {
|
|
|
success: function (json) {
|
|
|
const data = json.data;
|
|
|
console.log(data)
|
|
|
+ var el = $('.list-container');
|
|
|
+ el.empty();
|
|
|
if (json.result && data && data.length > 0) {
|
|
|
var html = '';
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
@@ -178,21 +194,21 @@ function getRecruitList() {
|
|
|
'<span class="zp-name">' + obj.workName + '</span>' +
|
|
|
'<span class="zp-time">' + obj.createTime.split(' ')[0] + '发布</span>' +
|
|
|
'</div>' +
|
|
|
- '<div class="right">' + obj.minSalary + '-' + obj.maxSalary + '</div>' +
|
|
|
+ '<div class="right">' + numberToChar(obj.minSalary) + ( obj.maxSalary ? '-' + numberToChar(obj.maxSalary) : '+' ) + '</div>' +
|
|
|
'</div>' +
|
|
|
'<p class="zp-enterprise">' + obj.orgName + '</p>' +
|
|
|
'<div class="zp-second">' +
|
|
|
'<span class="zprs">' +
|
|
|
'招聘人数:' + obj.recruitNum + '人丨' +
|
|
|
- '工作经验:' + obj.workExp + ' 丨 ' +
|
|
|
- '学历:' + obj.edu + ' 丨' +
|
|
|
+ '工作经验:' + (obj.workExp ? obj.workExp : '不限') + ' 丨 ' +
|
|
|
+ '学历:' + (obj.edu ? obj.edu : '不限') + ' 丨' +
|
|
|
'地点:' + (obj.address ? obj.address : '暂无') +
|
|
|
'</span>' +
|
|
|
'<div class="zp-detail" data-id="' + obj.id + '">查看详情</div>' +
|
|
|
'</div>' +
|
|
|
'</div>'
|
|
|
}
|
|
|
- $('.list-container').empty().append(html);
|
|
|
+ el.append(html);
|
|
|
}
|
|
|
|
|
|
if (!json.result) {
|
|
@@ -201,3 +217,10 @@ function getRecruitList() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 整数工资转换为K
|
|
|
+ */
|
|
|
+function numberToChar(num) {
|
|
|
+ return (num / 1000) + 'k';
|
|
|
+}
|