From 0c63009c88b5b2cf16cbe28e5d4b8e970ec79199 Mon Sep 17 00:00:00 2001 From: chenyuan Date: Tue, 11 Aug 2026 18:36:15 +0800 Subject: [PATCH 1/4] feat: add consumer behavior hypotheses --- src/api/studentTrainingAnswer.js | 17 ++ src/views/demand/consumer-behavior.vue | 235 ++++++++++++++++++++++--- 2 files changed, 227 insertions(+), 25 deletions(-) diff --git a/src/api/studentTrainingAnswer.js b/src/api/studentTrainingAnswer.js index 4be51d4..f36edbc 100644 --- a/src/api/studentTrainingAnswer.js +++ b/src/api/studentTrainingAnswer.js @@ -335,3 +335,20 @@ export function checkProductDevelopmentFactorsStepFour(payload) { } return request({ url: "/api/student-training-answers/product-development-factors/step-4/validate", method: "post", data: payload, headers: { repeatSubmit: false } }); } + +export function checkConsumerBehaviorStepOne(payload) { + const hypotheses = Array.isArray(payload?.hypotheses) ? payload.hypotheses : []; + if (isStudentDemo()) { + const incomplete = hypotheses.find((item) => ["targetGroup", "keyFinding", "coreHypothesis"].some((field) => !String(item?.[field] || "").trim())); + if (!hypotheses.length || incomplete) { + return Promise.reject(new Error("请完整填写目标人群、实训8关键发现和问卷核心假设")); + } + return Promise.resolve({ code: 200, data: { valid: true, message: "校验通过" } }); + } + return request({ + url: "/api/student-training-answers/consumer-behavior/step-1/validate", + method: "post", + data: { hypotheses }, + headers: { repeatSubmit: false }, + }); +} diff --git a/src/views/demand/consumer-behavior.vue b/src/views/demand/consumer-behavior.vue index d406f80..f43c55a 100644 --- a/src/views/demand/consumer-behavior.vue +++ b/src/views/demand/consumer-behavior.vue @@ -58,32 +58,35 @@
-
-

- 借助AI,生成智能产品购买决策因素调研问卷,提示词参考:设计问卷,用于分析用户购买智能产品的决策因素。问卷完成后复制到下述编辑框,并上传问卷pdf文档。 +

+

+ 基于实训 8 的用户画像结论,明确本次问卷调查的目标人群与核心假设,填写下表。

- - - 上传问卷 - -
-
- - {{ form.questionnaireFileName }} +
+ 增加一行 + 删除一行 +
+ 查看实训8
-
- 示例: -
+
+ + + + + + + + + + + +
目标人群实训8关键发现本次问卷需验证的核心假设