Quellcode durchsuchen

feat: 健康教练欢迎语个性化与我的管家入口

iwt vor 3 Wochen
Ursprung
Commit
db83318d22
2 geänderte Dateien mit 43 neuen und 3 gelöschten Zeilen
  1. 1 1
      cfc-frontend/pages/ai/chat.vue
  2. 42 2
      cfc-frontend/pages/membership/index.vue

+ 1 - 1
cfc-frontend/pages/ai/chat.vue

@@ -38,7 +38,7 @@
       <view class="message-list-inner">
         <view class="welcome-card" v-if="messages.length === 0 && !sending">
           <view class="welcome-icon">{{ mascotIcon || (isNutrition ? '🥗' : (isHealthCoach ? '💡' : '🤖')) }}</view>
-          <text class="welcome-title">{{ isNutrition ? '你好!我是营养助手' : (isHealthCoach ? '你好!我是健康教练' : (isButler ? '你好!我是健康管家' : ('你好!我是' + (mascotName || '家庭助手')))) }}</text>
+          <text class="welcome-title">{{ isNutrition ? '你好!我是营养助手' : (isHealthCoach ? ('你好!我是' + (mascotName || '健康教练')) : (isButler ? '你好!我是健康管家' : ('你好!我是' + (mascotName || '家庭助手')))) }}</text>
           <text class="welcome-desc">{{ welcomeSubtitle }}</text>
           <view class="welcome-suggestions">
             <view class="welcome-suggestion" v-if="!isNutrition && !isHealthCoach" @click="quickQuestion('小明最近任务完成怎么样?')">

+ 42 - 2
cfc-frontend/pages/membership/index.vue

@@ -45,6 +45,16 @@
         </view>
       </view>
 
+      <!-- 我的管家入口 -->
+      <view class="butler-entry" @click="goButlerSelect">
+        <view class="butler-entry-icon">🤵</view>
+        <view class="butler-entry-main">
+          <text class="butler-entry-title">{{ butlerEntryTitle }}</text>
+          <text class="butler-entry-sub">{{ butlerEntrySub }}</text>
+        </view>
+        <text class="butler-entry-arrow">›</text>
+      </view>
+
       <!-- 权益对比表 -->
       <view class="compare-section">
         <text class="section-title">权益对比</text>
@@ -68,7 +78,7 @@
 </template>
 
 <script>
-import { getMyMembership } from '../../utils/api.js'
+import { getMyMembership, getMyButler } from '../../utils/api.js'
 import { parseDate } from '../../utils/format.js'
 
 export default {
@@ -86,11 +96,22 @@ export default {
         { name: '专属活动', free: '部分参与', family: '全部参与', premium: '优先参与' },
         { name: '成长报告', free: '月度', family: '每周+深度', premium: '每日+深度+专家解读' },
         { name: '任务配额', free: '每日5个', family: '不限量', premium: '不限量+优先审核' }
-      ]
+      ],
+      myButlerInfo: null,
+      isL2Active: false
+    }
+  },
+  computed: {
+    butlerEntryTitle() {
+      return this.myButlerInfo ? ('我的管家 · ' + this.myButlerInfo.nickname) : '我的管家'
+    },
+    butlerEntrySub() {
+      return this.myButlerInfo ? '点击查看或更换' : '久久一生会员可自助选择专属管家'
     }
   },
   onShow() {
     this.loadData()
+    this.loadButlerEntry()
   },
   methods: {
     loadData() {
@@ -113,6 +134,17 @@ export default {
     goBenefits() {
       uni.navigateTo({ url: '/pages/membership/benefits' })
     },
+    goButlerSelect() {
+      uni.navigateTo({ url: '/pages/butler/select' })
+    },
+    loadButlerEntry() {
+      var that = this
+      getMyButler().then(function (res) {
+        if (res && res.code === 200 && res.data) {
+          that.myButlerInfo = res.data
+        }
+      }).catch(function () {})
+    },
     formatDate(date) {
       if (!date) return ''
       var d = parseDate(date)
@@ -340,4 +372,12 @@ export default {
   color: #F97316;
   font-weight: bold;
 }
+
+/* ===== 我的管家入口 ===== */
+.butler-entry { display: flex; align-items: center; background: #fff; border-radius: 16rpx; padding: 28rpx; margin: 20rpx 0; }
+.butler-entry-icon { font-size: 48rpx; margin-right: 20rpx; }
+.butler-entry-main { flex: 1; display: flex; flex-direction: column; }
+.butler-entry-title { font-size: 30rpx; font-weight: bold; color: #333; }
+.butler-entry-sub { font-size: 24rpx; color: #999; margin-top: 6rpx; }
+.butler-entry-arrow { font-size: 40rpx; color: #ccc; }
 </style>