Browse Source

fix(health): 修复选择规划师页调用available-guides缺少packageId报错

teacher-service.vue 误用 getAvailableGuides(packageId) 接口(传空对象导致
packageId 缺失报错,且返回字段 guideId/nickname 与页面模板 id/name 不匹配)。
改用后端已有的 /api/health-plan/available-teachers 接口,返回 id/name/isBound
等字段,与页面模板完全匹配。api.js 新增 getAvailableTeachers(familyId) 封装。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Sisyphus 2 months ago
parent
commit
42a1846613
2 changed files with 7 additions and 2 deletions
  1. 2 2
      cfc-frontend/pages/health/teacher-service.vue
  2. 5 0
      cfc-frontend/utils/api.js

+ 2 - 2
cfc-frontend/pages/health/teacher-service.vue

@@ -83,7 +83,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { getAvailableGuides, getGuidePackage } from '../../utils/api'
+import { getAvailableTeachers } from '../../utils/api'
 
 
 export default {
 export default {
   data: function() {
   data: function() {
@@ -121,7 +121,7 @@ export default {
     loadGuides: function() {
     loadGuides: function() {
       var self = this
       var self = this
       self.loading = true
       self.loading = true
-      getAvailableGuides({}).then(function(res) {
+      getAvailableTeachers(self.familyId).then(function(res) {
         self.loading = false
         self.loading = false
         if (res && res.code === 200 && res.data) {
         if (res && res.code === 200 && res.data) {
           var list = res.data instanceof Array ? res.data : []
           var list = res.data instanceof Array ? res.data : []

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

@@ -987,6 +987,11 @@ export const getAvailableGuides = (packageId) => {
   return request('/api/package/available-guides', 'POST', { packageId })
   return request('/api/package/available-guides', 'POST', { packageId })
 }
 }
 
 
+// 获取健康方案可选的规划师列表(无需 packageId,返回 id/name/isBound 等字段)
+export const getAvailableTeachers = (familyId) => {
+  return request('/api/health-plan/available-teachers', 'POST', { familyId })
+}
+
 
 
 // 获取订单状态
 // 获取订单状态
 export const getOrderStatus = (orderNo) => {
 export const getOrderStatus = (orderNo) => {