Browse Source

refactor(frontend): 移除首页/我的页意图弹层与旅程卡引用

删除 index-home IntentPicker/JourneyCard模板及4个方法,删除profile-main/ProfileMenu重新选择UI,删除health-main健康问卷入口,删除notification C类跳转,删除emotion-report画像推荐调用

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg 1 month ago
parent
commit
6f9323cdd5

+ 5 - 67
cfc-frontend/components/ProfileMenu.vue

@@ -85,13 +85,6 @@
       </view>
     </view>
 
-    <!-- 重新选择意图提示 -->
-    <view class="intent-reselect-hint" v-if="hasIntent">
-      <text class="intent-reselect-label">当前意图:</text>
-      <text class="intent-reselect-value">{{ intentLabel }}</text>
-      <text class="intent-reselect-link" @click="onReSelect">重新选择 ›</text>
-    </view>
-
     <!-- 设置/重置密码弹窗 -->
     <view class="modal-mask" v-if="showPasswordModal" @click="showPasswordModal = false">
       <view class="modal" @click.stop>
@@ -112,23 +105,15 @@
       </view>
     </view>
 
-    <!-- 重新选择意图弹层 -->
-    <IntentPicker
-      :show="showIntentPicker"
-      @select="handleReSelect"
-      @close="showIntentPicker = false" />
+    
   </view>
 </template>
 
 <script>
-import { setPassword, verifyPassword, updateMemberVisibility, getFamilyMemberList, vendorStatus, ensureFamily, getUserIntent, chooseUserIntent } from '../utils/api.js'
-import IntentPicker from './intent-picker.vue'
+import { setPassword, verifyPassword, updateMemberVisibility, getFamilyMemberList, vendorStatus, ensureFamily } from '../utils/api.js'
 
 export default {
   name: 'ProfileMenu',
-  components: {
-    IntentPicker
-  },
   props: {
     role: {
       type: String,
@@ -148,9 +133,7 @@ export default {
       confirmPassword: '',
       showToFamily: 1,
       isVendor: false,
-      hasIntent: false,
-      intentLabel: '',
-      showIntentPicker: false
+      
     }
   },
   onShow() {
@@ -158,8 +141,7 @@ export default {
     this.hasPassword = !!uni.getStorageSync('passwordSet')
     this.loadShowToFamily()
     this.checkVendorStatus()
-    this.loadUserIntent()
-  },
+    },
   methods: {
     async loadShowToFamily() {
       try {
@@ -316,51 +298,7 @@ export default {
         this.isVendor = false
       }
     },
-    loadUserIntent() {
-      var self = this
-      getUserIntent().then(function(res) {
-        var intent = res && res.data
-        if (intent && intent.intentType) {
-          self.hasIntent = true
-          self.intentLabel = self.intentText(intent.intentType)
-        } else {
-          self.hasIntent = false
-          self.intentLabel = ''
-        }
-      }).catch(function() {
-        self.hasIntent = false
-      })
-    },
-    intentText(type) {
-      if (type === 'A') return '随便看看'
-      if (type === 'B') return '问卷'
-      if (type === 'C') return '解决问题'
-      return ''
-    },
-    onReSelect() {
-      this.showIntentPicker = true
-    },
-    handleReSelect(payload) {
-      var self = this
-      this.showIntentPicker = false
-      uni.showLoading({ title: '保存中...', mask: true })
-      var data = { intentType: payload.intentType }
-      if (payload.intentType === 'C' && payload.problemDomainCode) {
-        data.problemDomainCode = payload.problemDomainCode
-      }
-      chooseUserIntent(data).then(function(res) {
-        uni.hideLoading()
-        if (res && (res.code === 0 || res.code === 200)) {
-          self.loadUserIntent()
-          uni.showToast({ title: '已更新你的选择', icon: 'none' })
-        } else {
-          uni.showToast({ title: res.message || '保存失败', icon: 'none' })
-        }
-      }).catch(function() {
-        uni.hideLoading()
-        uni.showToast({ title: '保存失败,请重试', icon: 'none' })
-      })
-    }
+    
   }
 }
 </script>

+ 2 - 14
cfc-frontend/pages/health-main/index.vue

@@ -47,19 +47,7 @@
           <text class="self-test-arrow">›</text>
         </view>
       </view>
-      <!-- 健康问卷入口 -->
-      <view class="ai-q-entry" @click="goAiQuestionnaire">
-        <view class="ai-q-head">
-          <text class="ai-q-icon">🤖</text>
-          <view class="ai-q-info">
-            <text class="q-title">健康问卷</text>
-            <text class="ai-q-sub">智能问答,生成您的健康画像</text>
-          </view>
-          <text class="ai-q-arrow">›</text>
-        </view>
-          <text class="demo-chart-name">🟠 身体七维</text>
-          <text class="demo-chart-tag">示例</text>
-        </view>
+      
         <RadarChart :dimensions="demoBodyDims" :scores="demoBodyScores" fillColor="#FF8C42" childName="示例" width="560" height="460" />
         <view class="demo-chart-title-row">
           <text class="demo-chart-name">🧠 认知雷达</text>
@@ -514,7 +502,7 @@ export default {
       return status === 'resolved' ? 'resolved' : 'pending'
     },
     goSelfTest: function() { uni.navigateTo({ url: '/pages/health/survey-questionnaire?dim=all' }) },
-    goAiQuestionnaire: function() { uni.navigateTo({ url: '/pages/health/ai-questionnaire' }) },
+    
     goPlanSummary: function() {
       var url = '/pages/health/health-plan-summary'
       if (this.selectedMemberId) url += '?memberId=' + this.selectedMemberId

+ 8 - 100
cfc-frontend/pages/index-home/index.vue

@@ -44,14 +44,9 @@
     </view>
   </view>
 
-  <!-- 首次选择意图弹层 — 改版v1 -->
-  <IntentPicker
-    :show="showIntentPicker"
-    @select="handleIntentSelect"
-    @close="handleIntentClose" />
-
   <!-- 登录态 — 直接内嵌,保持底签可见 -->
   <view v-if="currentRole" class="logged-in-container">
+<<<<<<< Updated upstream
     <!-- ① 了解区 — 自测大卡(首屏,引导"从了解开始") -->
     <view class="self-test-card" @click="goSelfTest">
       <view class="self-test-head">
@@ -65,6 +60,9 @@
     </view>
 
     <!-- ② 发现区 — 能量沙盘 — Canvas 五行星图(未测评时显示引导卡) -->
+=======
+    <!-- 能量沙盘 — Canvas 五行星图(未测评时显示引导卡) -->
+>>>>>>> Stashed changes
     <GateLock v-if="sandboxLocked && sandboxLockGate" :gate="sandboxLockGate" />
     <WuxingSandbox
       v-else-if="sandboxData"
@@ -84,12 +82,6 @@
         @click="goToUploadReport" />
     </view>
 
-    <!-- ③ 行动区 — 旅程状态卡 — 改版v1 需求驱动(A类·随便看看 不展示旅程卡) -->
-    <JourneyCard
-      v-if="userIntent && userIntent.intentType !== 'A'"
-      :intent="userIntent"
-      @action="handleJourneyAction" />
-
     <!-- ③ 行动区 — 今日任务 -->
     <DailyTaskCard />
 
@@ -360,9 +352,7 @@ import ArticleBookshelf from '../../components/ArticleBookshelf.vue'
 import FamilyChallengeCard from '../../components/FamilyChallengeCard.vue'
 import DailyTaskCard from '../../components/daily-task-card.vue'
 import ReportUploadCard from '../../components/report-upload-card.vue'
-import IntentPicker from '../../components/intent-picker.vue'
-import JourneyCard from '../../components/journey-card.vue'
-import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getFamilyMemberList, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getNotificationList, getUserIntent, chooseUserIntent } from '../../utils/api.js'
+import { acceptParentInvite, productList, getActivityList, getFeaturedArticles, getFamilyEnergySandbox, getFamilyMemberList, getChildren, getChallengeList, switchToFamilyMember, getMyMembership, updateChallengeProgress, respondChallenge, getTodayTasks, completeTask as completeTaskApi, getTodayParentTasks, completeParentTask as completeParentTaskApi, getTaskHistory, getNotices, getNotificationList } from '../../utils/api.js'
 import nav from '../../utils/nav.js'
 import config from '@/config.js'
 import { parseDate } from '../../utils/format.js'
@@ -377,8 +367,7 @@ export default {
     FamilyChallengeCard,
     DailyTaskCard,
     ReportUploadCard,
-    IntentPicker,
-    JourneyCard
+    
   },
   data() {
     // 从 storage 预取登录态/角色,确保首次渲染即正确(WeChat 渲染层/逻辑层分离架构下 onLoad 执行前已渲染)
@@ -443,10 +432,7 @@ export default {
       isLifetime: false,
       membershipDays: 0,
 
-      // 改版v1 用户意图/旅程
-      userIntent: null,
-      showIntentPicker: false,
-      intentPickerDismissed: false
+      
     }
   },
   computed: {
@@ -902,7 +888,6 @@ export default {
         this.loadLoggedInData()
       }
       this.checkMemberStatus()
-      this.checkUserIntent()
       this._watchPageReady()
     },
     _watchPageReady() {
@@ -1099,84 +1084,7 @@ export default {
       return config.API_BASE_URL + path
     },
 
-    // ===== 改版v1 用户意图/旅程 =====
-    checkUserIntent: function() {
-      var self = this
-      var role = uni.getStorageSync('currentRole') || uni.getStorageSync('role') || ''
-      // teacher 角色不弹意图选择
-      if (role === 'teacher') return
-      getUserIntent().then(function(res) {
-        var intent = res && res.data
-        if (intent) {
-          self.userIntent = intent
-        } else {
-          // 无意图且未跳过,弹选择层
-          if (!self.intentPickerDismissed) {
-            self.intentPickerDismissed = true
-            self.showIntentPicker = true
-          }
-        }
-      }).catch(function() {
-        // 静默:接口异常时不弹
-      })
-    },
-    handleIntentSelect: function(payload) {
-      var self = this
-      self.showIntentPicker = false
-      uni.showLoading({ title: '处理中...', mask: true })
-      var data = { intentType: payload.intentType }
-      if (payload.intentType === 'C' && payload.problemDomainCode) {
-        data.problemDomainCode = payload.problemDomainCode
-      }
-      chooseUserIntent(data).then(function(res) {
-        uni.hideLoading()
-        if (res && (res.code === 0 || res.code === 200)) {
-          // 选择成功后刷新意图
-          getUserIntent().then(function(r) {
-            self.userIntent = r && r.data
-          }).catch(function() {})
-          // B类:进入问卷,问卷完成后回调更新画像
-          if (payload.intentType === 'B') {
-            uni.navigateTo({ url: '/pages/health/ai-questionnaire' })
-          } else if (payload.intentType === 'C') {
-            uni.navigateTo({
-              url: '/pages/problem/flow-intro?code=' + (payload.problemDomainCode || '')
-            })
-          }
-        } else {
-          uni.showToast({ title: res.message || '选择失败', icon: 'none' })
-        }
-      }).catch(function() {
-        uni.hideLoading()
-        uni.showToast({ title: '选择失败,请重试', icon: 'none' })
-      })
-    },
-    handleIntentClose: function() {
-      this.showIntentPicker = false
-    },
-    handleJourneyAction: function(payload) {
-      var action = payload && payload.action
-      var code = payload && payload.code
-      if (action === 'flow-intro') {
-        uni.navigateTo({ url: '/pages/problem/flow-intro?code=' + (code || '') })
-      } else if (action === 'survey') {
-        uni.navigateTo({ url: '/pages/problem/survey?code=' + (code || '') })
-      } else if (action === 'package') {
-        uni.navigateTo({ url: '/pages/problem/package-match?code=' + (code || '') })
-      } else if (action === 'logistics') {
-        uni.navigateTo({ url: '/pages/problem/logistics?code=' + (code || '') })
-      } else if (action === 'report') {
-        uni.navigateTo({ url: '/pages/problem/plan-confirm?code=' + (code || '') })
-      } else if (action === 'plan-confirm') {
-        uni.navigateTo({ url: '/pages/problem/plan-confirm?code=' + (code || '') })
-      } else if (action === 'tasks') {
-        uni.navigateTo({ url: '/pages/tasks/tasks' })
-      } else if (action === 'purchase') {
-        uni.navigateTo({ url: '/pages/assessment/purchase' })
-      } else if (action === 'recommend') {
-        uni.navigateTo({ url: '/pages/problem/domain-list' })
-      }
-    }
+    
 
   }
 }

+ 2 - 13
cfc-frontend/pages/mind-detail/emotion-report.vue

@@ -99,7 +99,7 @@
 </template>
 
 <script>
-import { getEmiReport, getProfileRecommend } from '../../utils/api.js'
+import { getEmiReport } from '../../utils/api.js'
 
 export default {
   components: { },
@@ -138,20 +138,9 @@ export default {
         }
       }).catch(function() {}).finally(function() {
         self.loading = false
-        self.loadRecommendations()
       })
     },
-    loadRecommendations: function() {
-      var self = this
-      var memberId = self.memberId || uni.getStorageSync('currentChildId')
-      if (!memberId) return
-      self.recLoading = true
-      getProfileRecommend({ memberId: memberId, types: ['article', 'activity'], limit: 5 }).then(function(res) {
-        if (res.code === 200 && res.data && res.data.recommendations) {
-          self.recommendations = res.data.recommendations
-        }
-      }).catch(function() {}).finally(function() { self.recLoading = false })
-    },
+    
     getScoreLevel: function(score) {
       if (score >= 85) return 'excellent'
       if (score >= 70) return 'good'

+ 1 - 5
cfc-frontend/pages/notification/index.vue

@@ -97,11 +97,7 @@ export default {
       // 导航
       var refType = item.ref_type || item.refType || ''
       var refId = item.ref_id || item.refId
-      if (refType === 'report' || refType === 'plan') {
-        uni.navigateTo({ url: '/pages/problem/plan-confirm' })
-      } else if (refType === 'package' || refType === 'logistics') {
-        uni.navigateTo({ url: '/pages/problem/logistics' })
-      } else if (refType === 'task') {
+      if (refType === 'task') {
         uni.navigateTo({ url: '/pages/tasks/tasks' })
       }
     }

+ 5 - 58
cfc-frontend/pages/profile-main/profile.vue

@@ -230,38 +230,23 @@
         </view>
       </view>
 
-      <!-- 当前意图 + 重新选择 -->
-      <view class="intent-section" v-if="userIntent && userIntent.intentType">
-        <view class="intent-info">
-          <text class="intent-label">当前选择</text>
-          <text class="intent-value">{{ intentLabel }}</text>
-        </view>
-        <view class="intent-reselect" @click="showIntentPicker = true">
-          <text class="intent-reselect-text">重新选择</text>
-        </view>
-      </view>
-    </template>
+      </template>
     <FloatingAvatar />
-    <IntentPicker
-      :show="showIntentPicker"
-      @select="handleReSelect"
-      @close="showIntentPicker = false" />
   </view>
 </template>
 
 <script>
 import FloatingAvatar from '../../components/AIFloatingAvatar.vue'
-import IntentPicker from '../../components/intent-picker.vue'
 import {
   getChildren, getFamilyMemberList,
   getTodayTasksByCategory, getChallengeList, getMyMembership,
   verifyPassword, getPointsBalance, getUserInfo,
   cartCount, getOrderCounts, getReferralSummary,
-  getProfileStats, getUserIntent, chooseUserIntent
+  getProfileStats
 } from '../../utils/api.js'
 
 export default {
-  components: { FloatingAvatar, IntentPicker },
+  components: { FloatingAvatar },
   data() {
     return {
       nickname: '',
@@ -291,22 +276,13 @@ export default {
       // 待办
       pendingTasks: 0,
       profileProgress: 0,
-      // 用户意图(A/B/C)
-      userIntent: null,
-      showIntentPicker: false
+      
     }
   },
   computed: {
     isLoggedIn() {
       return !!uni.getStorageSync('token')
     },
-    intentLabel() {
-      var type = this.userIntent && this.userIntent.intentType
-      if (type === 'A') return '随便看看'
-      if (type === 'B') return '问卷'
-      if (type === 'C') return '解决问题'
-      return ''
-    },
     roleLabel() {
       var map = { parent: '家长', child: '孩子', teacher: '规划师' }
       return map[this.role] || '用户'
@@ -338,7 +314,6 @@ export default {
     this.isSwitchedChild = uni.getStorageSync('isSwitchedChild') || false
     this.nickname = (uni.getStorageSync('userInfo') || {}).nickname || ''
     this.loadAllData()
-    this.loadUserIntent()
   },
   methods: {
     loadAllData() {
@@ -455,35 +430,7 @@ export default {
         }
       }).catch(function() {})
     },
-    loadUserIntent() {
-      var self = this
-      getUserIntent().then(function(res) {
-        self.userIntent = res && res.data ? res.data : null
-      }).catch(function() {
-        self.userIntent = null
-      })
-    },
-    handleReSelect(payload) {
-      var self = this
-      this.showIntentPicker = false
-      uni.showLoading({ title: '保存中...', mask: true })
-      var data = { intentType: payload.intentType }
-      if (payload.intentType === 'C' && payload.problemDomainCode) {
-        data.problemDomainCode = payload.problemDomainCode
-      }
-      chooseUserIntent(data).then(function(res) {
-        uni.hideLoading()
-        if (res && (res.code === 0 || res.code === 200)) {
-          self.loadUserIntent()
-          uni.showToast({ title: '已更新你的选择', icon: 'none' })
-        } else {
-          uni.showToast({ title: res.message || '保存失败', icon: 'none' })
-        }
-      }).catch(function() {
-        uni.hideLoading()
-        uni.showToast({ title: '保存失败,请重试', icon: 'none' })
-      })
-    },
+    
     goLogin: function() {
       uni.navigateTo({ url: '/pages/login/login' })
     },