Merge branch 'codex/consumer-scenario-step1'

# Conflicts:
#	src/api/studentTrainingAnswer.js
dev-QQq
chenyuan 2 weeks ago
commit 3c81c3764f

@ -1715,3 +1715,25 @@ export function checkCompetitiveEnvironmentAnalysisStepFour(payload) {
}
return request({ url: "/api/student-training-answers/competitive-environment-analysis/step-4/validate", method: "post", data: value, headers: { repeatSubmit: false } });
}
const consumerScenarioJourneyOrder = ["problem-awareness", "information-search", "evaluation-decision", "purchase-conversion", "post-purchase"];
export function checkConsumerScenarioStepOne(payload) {
const stageOrder = Array.isArray(payload?.stageOrder) ? payload.stageOrder : [];
if (isStudentDemo()) return Promise.resolve({ code: 200, data: { valid: stageOrder.length === consumerScenarioJourneyOrder.length && stageOrder.every((item, index) => item === consumerScenarioJourneyOrder[index]), message: "排序校验完成" } });
return request({ url: "/api/student-training-answers/consumer-scenario/step-1/validate", method: "post", data: { stageOrder }, headers: { repeatSubmit: false } });
}
export function checkConsumerScenarioStepTwo(payload) {
const rows = Array.isArray(payload?.rows) ? payload.rows : [];
if (isStudentDemo()) { const valid = rows.length === consumerScenarioJourneyOrder.length && rows.every((row) => consumerScenarioJourneyOrder.includes(row?.stageId) && String(row?.behaviorDescription || "").trim() && String(row?.keyTouchpoints || "").trim() && ["负面", "中性", "正面"].includes(row?.emotionExperience) && String(row?.decisionFactors || "").trim()) && new Set(rows.map((row) => row.stageId)).size === consumerScenarioJourneyOrder.length; return Promise.resolve({ code: 200, data: { valid, message: valid ? "校验通过" : "请完整填写五个阶段的行为、触点、情绪和决策因素" } }); }
return request({ url: "/api/student-training-answers/consumer-scenario/step-2/validate", method: "post", data: { rows }, headers: { repeatSubmit: false } });
}
export function checkConsumerScenarioStepThree(payload) {
const journeyMapUrl = String(payload?.journeyMapUrl || "").trim();
if (isStudentDemo()) return Promise.resolve({ code: 200, data: { valid: Boolean(journeyMapUrl), message: journeyMapUrl ? "用户购买旅程图已上传。" : "请上传用户购买旅程图。" } });
return request({ url: "/api/student-training-answers/consumer-scenario/step-3/validate", method: "post", data: { journeyMapUrl }, headers: { repeatSubmit: false } });
}
export function checkConsumerScenarioStepFour(payload) {
const rows = Array.isArray(payload?.rows) ? payload.rows : [];
if (isStudentDemo()) { const valid = rows.length === consumerScenarioJourneyOrder.length && rows.every((row) => consumerScenarioJourneyOrder.includes(row?.stageId) && String(row?.painPoint || "").trim() && String(row?.optimizationSuggestion || "").trim()) && new Set(rows.map((row) => row.stageId)).size === consumerScenarioJourneyOrder.length; return Promise.resolve({ code: 200, data: { valid, message: valid ? "五个阶段的优化分析填写完整。" : "请完整填写五个阶段的痛点和优化建议。" } }); }
return request({ url: "/api/student-training-answers/consumer-scenario/step-4/validate", method: "post", data: { rows }, headers: { repeatSubmit: false } });
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save