|
@@ -984,6 +984,16 @@ import { apiBaseUrl } from '@/common/config.js';
|
|
|
const fields = ['start_date', 'end_date', 'school_name', 'major', 'degree'];
|
|
|
return fields.some(field => this.safeEducationFieldsConfig[field]?.visible !== false);
|
|
|
},
|
|
|
+ // 判断是否显示家庭成员步骤
|
|
|
+ shouldShowFamilyStep() {
|
|
|
+ // 如果没有配置数据,默认显示
|
|
|
+ if (Object.keys(this.safeFamilyFieldsConfig).length === 0) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ // 检查所有家庭成员字段是否都被隐藏
|
|
|
+ const fields = ['relation', 'name', 'workplace', 'position', 'phone'];
|
|
|
+ return fields.some(field => this.safeFamilyFieldsConfig[field]?.visible !== false);
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
// 输入时限制小数位数
|
|
@@ -1817,29 +1827,35 @@ import { apiBaseUrl } from '@/common/config.js';
|
|
|
prevStep() {
|
|
|
const prevIndex = this.currentStepIndex - 1;
|
|
|
if (prevIndex >= 0) {
|
|
|
- // 如果上一步是专业技能步骤且不需要显示
|
|
|
- if (this.steps[prevIndex].id === 6 && !this.shouldShowSkillsStep) {
|
|
|
- // 检查上上步是否是教育经历步骤
|
|
|
- const skipIndex = prevIndex - 1;
|
|
|
- if (skipIndex >= 0) {
|
|
|
- // 如果上上步是教育经历步骤且也不需要显示,则继续跳过
|
|
|
- if (this.steps[skipIndex].id === 5 && !this.shouldShowEducationStep) {
|
|
|
- const skipIndex2 = skipIndex - 1;
|
|
|
- if (skipIndex2 >= 0) {
|
|
|
- this.currentStep = this.steps[skipIndex2].id;
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.currentStep = this.steps[skipIndex].id;
|
|
|
- }
|
|
|
+ let targetIndex = prevIndex;
|
|
|
+
|
|
|
+ // 检查上一步是否需要跳过
|
|
|
+ while (targetIndex >= 0) {
|
|
|
+ const stepId = this.steps[targetIndex].id;
|
|
|
+
|
|
|
+ // 如果是专业技能步骤且不需要显示,则跳过
|
|
|
+ if (stepId === 6 && !this.shouldShowSkillsStep) {
|
|
|
+ targetIndex--;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 如果是教育经历步骤且不需要显示,则跳过
|
|
|
+ if (stepId === 5 && !this.shouldShowEducationStep) {
|
|
|
+ targetIndex--;
|
|
|
+ continue;
|
|
|
}
|
|
|
- } else if (this.steps[prevIndex].id === 5 && !this.shouldShowEducationStep) {
|
|
|
- // 如果上一步是教育经历步骤且不需要显示,则跳过
|
|
|
- const skipIndex = prevIndex - 1;
|
|
|
- if (skipIndex >= 0) {
|
|
|
- this.currentStep = this.steps[skipIndex].id;
|
|
|
+ // 如果是家庭成员步骤且不需要显示,则跳过
|
|
|
+ if (stepId === 3 && !this.shouldShowFamilyStep) {
|
|
|
+ targetIndex--;
|
|
|
+ continue;
|
|
|
}
|
|
|
- } else {
|
|
|
- this.currentStep = this.steps[prevIndex].id;
|
|
|
+
|
|
|
+ // 找到有效步骤,跳出循环
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果找到有效步骤,跳转到该步骤
|
|
|
+ if (targetIndex >= 0) {
|
|
|
+ this.currentStep = this.steps[targetIndex].id;
|
|
|
}
|
|
|
|
|
|
// 滚动到页面顶部
|
|
@@ -1863,30 +1879,37 @@ import { apiBaseUrl } from '@/common/config.js';
|
|
|
|
|
|
const nextIndex = this.currentStepIndex + 1;
|
|
|
if (nextIndex < this.steps.length) {
|
|
|
- // 如果下一步是教育经历步骤(currentStep === 5),且不需要显示,则跳过
|
|
|
- if (this.steps[nextIndex].id === 5 && !this.shouldShowEducationStep) {
|
|
|
- // 跳到下下一步
|
|
|
- const skipIndex = nextIndex + 1;
|
|
|
- if (skipIndex < this.steps.length) {
|
|
|
- // 如果下下步是专业技能步骤且也不需要显示,则继续跳过
|
|
|
- if (this.steps[skipIndex].id === 6 && !this.shouldShowSkillsStep) {
|
|
|
- const skipIndex2 = skipIndex + 1;
|
|
|
- if (skipIndex2 < this.steps.length) {
|
|
|
- this.currentStep = this.steps[skipIndex2].id;
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.currentStep = this.steps[skipIndex].id;
|
|
|
- }
|
|
|
+ let targetIndex = nextIndex;
|
|
|
+
|
|
|
+ // 检查下一步是否需要跳过
|
|
|
+ while (targetIndex < this.steps.length) {
|
|
|
+ const stepId = this.steps[targetIndex].id;
|
|
|
+
|
|
|
+ // 如果是家庭成员步骤且不需要显示,则跳过
|
|
|
+ if (stepId === 3 && !this.shouldShowFamilyStep) {
|
|
|
+ targetIndex++;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ // 如果是教育经历步骤且不需要显示,则跳过
|
|
|
+ if (stepId === 5 && !this.shouldShowEducationStep) {
|
|
|
+ targetIndex++;
|
|
|
+ continue;
|
|
|
}
|
|
|
- } else if (this.steps[nextIndex].id === 6 && !this.shouldShowSkillsStep) {
|
|
|
- // 跳到下下一步
|
|
|
- const skipIndex = nextIndex + 1;
|
|
|
- if (skipIndex < this.steps.length) {
|
|
|
- this.currentStep = this.steps[skipIndex].id;
|
|
|
+ // 如果是专业技能步骤且不需要显示,则跳过
|
|
|
+ if (stepId === 6 && !this.shouldShowSkillsStep) {
|
|
|
+ targetIndex++;
|
|
|
+ continue;
|
|
|
}
|
|
|
- } else {
|
|
|
- this.currentStep = this.steps[nextIndex].id;
|
|
|
+
|
|
|
+ // 找到有效步骤,跳出循环
|
|
|
+ break;
|
|
|
}
|
|
|
+
|
|
|
+ // 如果找到有效步骤,跳转到该步骤
|
|
|
+ if (targetIndex < this.steps.length) {
|
|
|
+ this.currentStep = this.steps[targetIndex].id;
|
|
|
+ }
|
|
|
+
|
|
|
// 滚动到页面顶部
|
|
|
uni.pageScrollTo({
|
|
|
scrollTop: 0,
|