diff --git a/src/api/studentTrainingAnswer.js b/src/api/studentTrainingAnswer.js index 422d013..a8a0c3c 100644 --- a/src/api/studentTrainingAnswer.js +++ b/src/api/studentTrainingAnswer.js @@ -423,3 +423,91 @@ export function checkConsumerBehaviorStepFour(payload) { headers: { repeatSubmit: false }, }); } + +export function checkProductValuePositioningStepOne(payload) { + const rows = Array.isArray(payload?.rows) ? payload.rows : []; + const types = ["核心痛点1", "核心痛点2", "核心痛点3", "弱需求", "伪需求"]; + if (isStudentDemo()) { + const valid = rows.length === types.length && rows.every((row, index) => row?.id === index + 1 + && row?.type === types[index] + && Boolean(String(row?.description || "").trim()) + && Boolean(String(row?.scene || "").trim())); + return Promise.resolve({ + code: 200, + data: { + valid, + message: valid ? "核心痛点分类填写完整。" : "请完成 3 个核心痛点、弱需求和伪需求的描述与场景。", + }, + }); + } + return request({ + url: "/api/student-training-answers/product-value-positioning/step-1/validate", + method: "post", + data: { rows }, + headers: { repeatSubmit: false }, + }); +} + +export function checkProductValuePositioningStepTwo(payload) { + const customerProfile = payload?.customerProfile || {}; + const valueMap = payload?.valueMap || {}; + if (isStudentDemo()) { + const requiredValues = [ + customerProfile.jobs, customerProfile.pains, customerProfile.gains, + valueMap.products, valueMap.painRelievers, valueMap.gainCreators, + payload?.canvasUrl, + ]; + const valid = requiredValues.every((item) => Boolean(String(item || "").trim())); + return Promise.resolve({ + code: 200, + data: { + valid, + message: valid ? "价值主张画布填写完整。" : "请完整填写用户档案、产品价值地图并上传产品价值主张画布。", + }, + }); + } + return request({ + url: "/api/student-training-answers/product-value-positioning/step-2/validate", + method: "post", + data: payload, + headers: { repeatSubmit: false }, + }); +} + +export function checkProductValuePositioningStepThree(payload) { + const statements = Array.isArray(payload?.statements) ? payload.statements : []; + const requiredFields = ["targetUser", "productName", "productCategory", "coreValue", "differentiationReason"]; + if (isStudentDemo()) { + const valid = statements.length === 2 && statements.every((statement, index) => statement?.id === index + 1 + && requiredFields.every((field) => Boolean(String(statement?.[field] || "").trim()))); + return Promise.resolve({ + code: 200, + data: { valid, message: valid ? "两版定位陈述填写完整。" : "请完整填写两个产品价值定位陈述版本。" }, + }); + } + return request({ + url: "/api/student-training-answers/product-value-positioning/step-3/validate", + method: "post", + data: { statements }, + headers: { repeatSubmit: false }, + }); +} + +export function checkProductValuePositioningStepFour(payload) { + const sectionKeys = ["marketInsights", "marketOverview", "userAnalysis", "competitorAnalysis", "productRequirements"]; + if (isStudentDemo()) { + const valid = sectionKeys.every((key) => Array.isArray(payload?.[key]) && payload[key].length > 0 + && payload[key].every((row) => Boolean(String(row?.content || "").trim()))) + && Boolean(String(payload?.productPositioning || "").trim()); + return Promise.resolve({ + code: 200, + data: { valid, message: valid ? "MRD 文档填写完整。" : "请完整填写 MRD 的五组分析内容和产品定位。" }, + }); + } + return request({ + url: "/api/student-training-answers/product-value-positioning/step-4/validate", + method: "post", + data: payload, + headers: { repeatSubmit: false }, + }); +} diff --git a/src/views/product/differentiation.vue b/src/views/product/differentiation.vue index 1d5e0d7..910ef3b 100644 --- a/src/views/product/differentiation.vue +++ b/src/views/product/differentiation.vue @@ -48,20 +48,31 @@

{{ activeStepName }}

-
-