Selaa lähdekoodia

feat(frontend): 方案确认改调生成任务接口 (P0)

- plan-confirm.vue:确认方案时调用 /api/problem-package/confirm(生成任务+推进stage6),替代仅推进stage
- api.js:新增 confirmProblemPlan 封装

Ultraworked with [Sisyphus](https://github.com/OhMyOpenCode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
E2E Test Bot 1 kuukausi sitten
vanhempi
sitoutus
38595fda73
2 muutettua tiedostoa jossa 6 lisäystä ja 3 poistoa
  1. 4 3
      cfc-frontend/pages/problem/plan-confirm.vue
  2. 2 0
      cfc-frontend/utils/api.js

+ 4 - 3
cfc-frontend/pages/problem/plan-confirm.vue

@@ -42,7 +42,7 @@
 
 <script>
 import { getUserIntent } from '../../utils/api.js'
-import { updateUserIntentStage } from '../../utils/api.js'
+import { confirmProblemPlan } from '../../utils/api.js'
 
 export default {
   data() {
@@ -100,10 +100,11 @@ export default {
     confirmPlan() {
       var self = this
       uni.showLoading({ title: '处理中...', mask: true })
-      updateUserIntentStage(6).then(function(res) {
+      // 方案确认:后端生成方案任务(memberOnly=1)并推进旅程 stage=6
+      confirmProblemPlan('').then(function(res) {
         uni.hideLoading()
         if (res && (res.code === 0 || res.code === 200)) {
-          uni.showToast({ title: '方案已确认', icon: 'success' })
+          uni.showToast({ title: '方案已确认,任务已生成', icon: 'success' })
           setTimeout(function() {
             uni.navigateTo({ url: '/pages/tasks/tasks' })
           }, 500)

+ 2 - 0
cfc-frontend/utils/api.js

@@ -2708,6 +2708,8 @@ export const readNotification = (data) => request('/api/notification/read', 'POS
 export const submitProblemSurvey = (data) => request('/api/problem-survey/submit', 'POST', data)
 // 套餐详情
 export const getProblemPackageDetail = (packageId) => request('/api/problem-package/detail', 'POST', { packageId })
+// 方案确认(生成方案任务 + 推进旅程 stage=6,packageId 可省略)
+export const confirmProblemPlan = (packageId) => request('/api/problem-package/confirm', 'POST', packageId ? { packageId } : {})
 // 物流
 export const updateLogistics = (data) => request('/api/logistics/update', 'POST', data)
 export const getMyLogistics = () => request('/api/logistics/my', 'POST', {})