From 3f4763bc0f54d9d39dddce025758e3a290f95438 Mon Sep 17 00:00:00 2001 From: chenyuan Date: Fri, 7 Aug 2026 18:12:37 +0800 Subject: [PATCH] feat: add market opportunity selection step one --- src/api/studentTrainingAnswer.js | 14 +++++ src/router/index.js | 2 +- .../product/market-opportunity-selection.vue | 58 +++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 src/views/product/market-opportunity-selection.vue diff --git a/src/api/studentTrainingAnswer.js b/src/api/studentTrainingAnswer.js index 161310f..8762849 100644 --- a/src/api/studentTrainingAnswer.js +++ b/src/api/studentTrainingAnswer.js @@ -95,6 +95,20 @@ export function checkNewProductSurveyStepOne(items) { }); } +export function checkMarketOpportunitySelectionStepOne(items) { + const expected = { + "search-count": "市场规模", "demand-supply-ratio": "竞争强度", "transaction-amount": "市场规模", "transaction-growth": "市场潜力", + "category-transaction-growth": "市场潜力", "online-products": "竞争强度", "online-merchants": "竞争强度", "organic-traffic-ratio": "运营难度", + }; + if (isStudentDemo()) { + const list = Array.isArray(items) ? items : []; + const incorrect = list.find((item) => expected[item?.id] !== item?.category); + if (list.length !== Object.keys(expected).length || incorrect) return Promise.reject(new Error("指标分类有误,请根据提示重新选择")); + return Promise.resolve({ code: 200, data: { correctCount: Object.keys(expected).length, totalCount: Object.keys(expected).length, allCorrect: true, message: "校验通过" } }); + } + return request({ url: "/api/student-training-answers/market-opportunity-selection/step-1/check", method: "post", data: { items }, headers: { repeatSubmit: false } }); +} + function validateNewProductSurveyStepTwoDemo(form) { const value = form || {}; const images = Array.isArray(value.images) ? value.images : []; diff --git a/src/router/index.js b/src/router/index.js index e0d49b8..1a2dbf7 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -286,7 +286,7 @@ export const dynamicRoutes = [ // 产品定位 { path: "index", - component: () => import("@/views/product/index.vue"), + component: () => import("@/views/product/market-opportunity-selection.vue"), name: "product", meta: { title: "市场机会识别与选品", icon: "产品规划", affix: true, pageKey: "market-opportunity-selection" }, }, diff --git a/src/views/product/market-opportunity-selection.vue b/src/views/product/market-opportunity-selection.vue new file mode 100644 index 0000000..b092468 --- /dev/null +++ b/src/views/product/market-opportunity-selection.vue @@ -0,0 +1,58 @@ + + + + +