Просмотр исходного кода

feat: 主题系统页面集成 — 16页改用themeClass + ThemeToggle组件重设计

Ultraworked with Sisyphus

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
liaoxg 5 месяцев назад
Родитель
Сommit
18f07bce38

+ 31 - 23
client/components/ThemeToggle.vue

@@ -1,17 +1,17 @@
 <template>
 <template>
- <view class="theme-switcher">
- <text
- class="theme-btn"
- :class="{ active: isDark }"
- @click="setDark"
- >深色</text>
- <text
- class="theme-btn"
- :class="{ active: !isDark }"
- @click="setLight"
- >浅色</text>
- </view>
- </template>
+  <view class="theme-switcher" :class="{ 'is-dark': isDark }">
+    <text
+      class="theme-btn theme-btn--dark"
+      :class="{ active: isDark }"
+      @click="setDark"
+    >🌙</text>
+    <text
+      class="theme-btn theme-btn--light"
+      :class="{ active: !isDark }"
+      @click="setLight"
+    >☀️</text>
+  </view>
+</template>
 
 
  <script setup>
  <script setup>
  import { computed } from 'vue'
  import { computed } from 'vue'
@@ -35,23 +35,31 @@
  display: inline-flex;
  display: inline-flex;
  align-items: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.12);
- border-radius: 8px;
- padding: 2px;
+ border: 1px solid rgba(255, 255, 255, 0.2);
+ border-radius: 999px;
+ padding: 3px;
  gap: 2px;
  gap: 2px;
  }
  }
 
 
  .theme-btn {
  .theme-btn {
- font-size: 12px;
- padding: 4px 12px;
- border-radius: 6px;
- color: rgba(255, 255, 255, 0.7);
- transition: all 0.2s ease;
- line-height: 1.4;
+ font-size: 16px;
+ padding: 6px 10px;
+ border-radius: 999px;
+ cursor: pointer;
+ transition: all 0.25s ease;
+ line-height: 1;
+ opacity: 0.5;
+ filter: grayscale(0.6);
  }
  }
 
 
  .theme-btn.active {
  .theme-btn.active {
+ opacity: 1;
+ filter: grayscale(0);
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.95);
- color: #1A1A2E;
- font-weight: 600;
+ box-shadow: 0 2px 8px rgba(0,0,0,0.15);
+ }
+
+ .theme-switcher.is-dark .theme-btn.active {
+ background: rgba(255, 255, 255, 1);
  }
  }
  </style>
  </style>

+ 3 - 1
client/pages/admin/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-admin">
+  <view class="page-admin" :class="themeClass">
     <!-- ===== Login Screen ===== -->
     <!-- ===== Login Screen ===== -->
     <view v-if="!authenticated" class="login-screen">
     <view v-if="!authenticated" class="login-screen">
       <view class="login-card">
       <view class="login-card">
@@ -323,6 +323,8 @@
 import { ref, reactive, computed, onMounted } from 'vue'
 import { ref, reactive, computed, onMounted } from 'vue'
 import { onPullDownRefresh } from '@dcloudio/uni-app'
 import { onPullDownRefresh } from '@dcloudio/uni-app'
 import { adminApi } from '@/utils/api'
 import { adminApi } from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+const { themeClass } = useTheme()
 
 
 // ─── Auth State ───
 // ─── Auth State ───
 const authenticated = ref(!!uni.getStorageSync('adminToken'))
 const authenticated = ref(!!uni.getStorageSync('adminToken'))

+ 15 - 13
client/pages/analysis/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-analysis">
+  <view class="page-analysis" :class="themeClass">
     <!-- ========== Section 1: My Analysis Records ========== -->
     <!-- ========== Section 1: My Analysis Records ========== -->
     <view class="section">
     <view class="section">
       <view class="section__header">
       <view class="section__header">
@@ -90,6 +90,9 @@ import { computed } from 'vue'
 import { onShow } from '@dcloudio/uni-app'
 import { onShow } from '@dcloudio/uni-app'
 import { useUserStore } from '@/stores/user'
 import { useUserStore } from '@/stores/user'
 import { useChartStore } from '@/stores/chart'
 import { useChartStore } from '@/stores/chart'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const userStore = useUserStore()
 const userStore = useUserStore()
 const chartStore = useChartStore()
 const chartStore = useChartStore()
@@ -142,15 +145,14 @@ function goSubscribe() {
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
-// Brand colors from style-guide.md
-$blue-dark: #1E3A5F;     // = var(--color-brand), literal for darken() compat
-$gold: var(--color-gold);
-$gold-light: #F8F0D8;
-$warm-white: #F8F6F1;    // = var(--color-bg) light theme, literal for darken() compat
+$warm-white: var(--color-bg);
 $white: var(--color-bg-card);
 $white: var(--color-bg-card);
-$text-primary: #1F2937;
-$text-secondary: #6B7280;
-$text-muted: #9CA3AF;
+$text-primary: var(--color-text-primary);
+$text-secondary: var(--color-text-secondary);
+$text-muted: var(--color-text-tertiary);
+$blue-dark: var(--color-brand);
+$gold: var(--color-gold);
+$gold-light: var(--color-gold-light);
 $border-light: var(--color-border);
 $border-light: var(--color-border);
 $shadow-card: var(--shadow-card);
 $shadow-card: var(--shadow-card);
 
 
@@ -218,7 +220,7 @@ $shadow-card: var(--shadow-card);
   transition: background 0.15s;
   transition: background 0.15s;
 
 
   &:active {
   &:active {
-    background: darken($warm-white, 2%);
+    background: var(--color-bg-card-hover);
   }
   }
 }
 }
 
 
@@ -247,8 +249,8 @@ $shadow-card: var(--shadow-card);
 
 
 .tag-status {
 .tag-status {
   display: inline-block;
   display: inline-block;
-  background: #D1FAE5;
-  color: #059669;
+  background: var(--color-success-bg);
+  color: var(--color-success);
   font-size: 11px;
   font-size: 11px;
   padding: 2px 8px;
   padding: 2px 8px;
   border-radius: 10px;
   border-radius: 10px;
@@ -344,7 +346,7 @@ $shadow-card: var(--shadow-card);
 
 
 // ========== Upsell Banner ==========
 // ========== Upsell Banner ==========
 .upsell-banner {
 .upsell-banner {
-  background: linear-gradient(135deg, $blue-dark, darken($blue-dark, 4%));
+  background: linear-gradient(135deg, var(--color-brand), #132944);
   border-radius: 16px;
   border-radius: 16px;
   padding: 20px;
   padding: 20px;
   margin-top: 8px;
   margin-top: 8px;

+ 4 - 1
client/pages/commission/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-commission">
+  <view class="page-commission" :class="themeClass">
     <!-- Loading -->
     <!-- Loading -->
     <view v-if="loading" class="loading-state">
     <view v-if="loading" class="loading-state">
       <text class="loading-text">加载中...</text>
       <text class="loading-text">加载中...</text>
@@ -168,6 +168,9 @@ import { ref, computed, onMounted } from 'vue'
 import { onPullDownRefresh } from '@dcloudio/uni-app'
 import { onPullDownRefresh } from '@dcloudio/uni-app'
 import { useUserStore } from '@/stores/user'
 import { useUserStore } from '@/stores/user'
 import { commissionApi } from '@/utils/api'
 import { commissionApi } from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const userStore = useUserStore()
 const userStore = useUserStore()
 const commissions = ref([])
 const commissions = ref([])

+ 4 - 1
client/pages/login/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-login">
+  <view class="page-login" :class="themeClass">
     <view class="login-card">
     <view class="login-card">
       <view class="logo-area">
       <view class="logo-area">
         <text class="logo-icon">🔮</text>
         <text class="logo-icon">🔮</text>
@@ -65,6 +65,9 @@ import { ref } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { onLoad } from '@dcloudio/uni-app'
 import { useUserStore } from '@/stores/user'
 import { useUserStore } from '@/stores/user'
 import { profileApi } from '@/utils/api'
 import { profileApi } from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const userStore = useUserStore()
 const userStore = useUserStore()
 
 

+ 49 - 32
client/pages/profile/edit.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-edit">
+  <view class="page-edit" :class="themeClass">
     <view class="header">
     <view class="header">
       <text class="title">编辑资料</text>
       <text class="title">编辑资料</text>
     </view>
     </view>
@@ -89,6 +89,9 @@
 import { ref, reactive, onMounted } from 'vue'
 import { ref, reactive, onMounted } from 'vue'
 import { useUserStore } from '@/stores/user'
 import { useUserStore } from '@/stores/user'
 import { profileApi } from '@/utils/api'
 import { profileApi } from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const userStore = useUserStore()
 const userStore = useUserStore()
 const submitting = ref(false)
 const submitting = ref(false)
@@ -194,9 +197,17 @@ async function handleSubmit() {
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
+$text-primary: var(--color-text-primary);
+$text-secondary: var(--color-text-secondary);
+$text-muted: var(--color-text-tertiary);
+$input-bg: var(--color-bg-input);
+$border-color: var(--color-border);
+$brand: var(--color-brand);
+$form-bg: var(--color-bg-secondary);
+
 .page-edit {
 .page-edit {
   min-height: 100vh;
   min-height: 100vh;
-  background: linear-gradient(180deg, #F8F9FF 0%, #EEF2FF 100%);
+  background: var(--color-bg);
   padding: 20px 24px 40px;
   padding: 20px 24px 40px;
 }
 }
 .header {
 .header {
@@ -206,14 +217,14 @@ async function handleSubmit() {
 .title {
 .title {
   font-size: 20px;
   font-size: 20px;
   font-weight: 700;
   font-weight: 700;
-  color: #1F2937;
+  color: $text-primary;
   display: block;
   display: block;
 }
 }
 .form {
 .form {
-  background: #fff;
+  background: $form-bg;
   border-radius: 16px;
   border-radius: 16px;
   padding: 24px 20px;
   padding: 24px 20px;
-  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
+  box-shadow: var(--shadow-card);
 }
 }
 .form-item {
 .form-item {
   margin-bottom: 20px;
   margin-bottom: 20px;
@@ -221,30 +232,30 @@ async function handleSubmit() {
 .label {
 .label {
   font-size: 14px;
   font-size: 14px;
   font-weight: 600;
   font-weight: 600;
-  color: #374151;
+  color: $text-primary;
   display: block;
   display: block;
   margin-bottom: 8px;
   margin-bottom: 8px;
 }
 }
 .input {
 .input {
   width: 100%;
   width: 100%;
   height: 44px;
   height: 44px;
-  border: 1px solid #E5E7EB;
+  border: 1px solid $border-color;
   border-radius: 10px;
   border-radius: 10px;
   padding: 0 14px;
   padding: 0 14px;
   font-size: 15px;
   font-size: 15px;
-  color: #1F2937;
-  background: #F9FAFB;
+  color: $text-primary;
+  background: $input-bg;
   box-sizing: border-box;
   box-sizing: border-box;
 }
 }
 .textarea {
 .textarea {
   width: 100%;
   width: 100%;
   height: 88px;
   height: 88px;
-  border: 1px solid #E5E7EB;
+  border: 1px solid $border-color;
   border-radius: 10px;
   border-radius: 10px;
   padding: 10px 14px;
   padding: 10px 14px;
   font-size: 15px;
   font-size: 15px;
-  color: #1F2937;
-  background: #F9FAFB;
+  color: $text-primary;
+  background: $input-bg;
   box-sizing: border-box;
   box-sizing: border-box;
   resize: none;
   resize: none;
 }
 }
@@ -252,7 +263,7 @@ async function handleSubmit() {
   display: block;
   display: block;
   text-align: right;
   text-align: right;
   font-size: 12px;
   font-size: 12px;
-  color: #9CA3AF;
+  color: $text-muted;
   margin-top: 4px;
   margin-top: 4px;
 }
 }
 
 
@@ -267,11 +278,11 @@ async function handleSubmit() {
   width: 80px;
   width: 80px;
   height: 80px;
   height: 80px;
   border-radius: 50%;
   border-radius: 50%;
-  border: 3px solid #E5E7EB;
+  border: 3px solid $border-color;
 }
 }
 .avatar-hint {
 .avatar-hint {
   font-size: 12px;
   font-size: 12px;
-  color: #9CA3AF;
+  color: $text-muted;
   margin-top: 6px;
   margin-top: 6px;
 }
 }
 
 
@@ -283,19 +294,19 @@ async function handleSubmit() {
 .radio {
 .radio {
   flex: 1;
   flex: 1;
   height: 44px;
   height: 44px;
-  border: 1px solid #E5E7EB;
+  border: 1px solid $border-color;
   border-radius: 10px;
   border-radius: 10px;
   display: flex;
   display: flex;
   align-items: center;
   align-items: center;
   justify-content: center;
   justify-content: center;
   font-size: 15px;
   font-size: 15px;
-  color: #6B7280;
-  background: #F9FAFB;
+  color: $text-secondary;
+  background: $input-bg;
 }
 }
 .radio.active {
 .radio.active {
-  border-color: #4A148C;
-  color: #4A148C;
-  background: #F3EEFF;
+  border-color: $brand;
+  color: var(--color-gold);
+  background: var(--color-gold-bg);
 }
 }
 
 
 /* Picker */
 /* Picker */
@@ -307,16 +318,16 @@ async function handleSubmit() {
   width: 100%;
   width: 100%;
   height: 44px;
   height: 44px;
   line-height: 44px;
   line-height: 44px;
-  border: 1px solid #E5E7EB;
+  border: 1px solid $border-color;
   border-radius: 10px;
   border-radius: 10px;
   padding: 0 14px;
   padding: 0 14px;
   font-size: 15px;
   font-size: 15px;
-  color: #1F2937;
-  background: #F9FAFB;
+  color: $text-primary;
+  background: $input-bg;
   box-sizing: border-box;
   box-sizing: border-box;
 }
 }
 .picker-text.muted {
 .picker-text.muted {
-  color: #9CA3AF;
+  color: $text-muted;
 }
 }
 
 
 /* Tags */
 /* Tags */
@@ -329,29 +340,35 @@ async function handleSubmit() {
   padding: 6px 16px;
   padding: 6px 16px;
   border-radius: 20px;
   border-radius: 20px;
   font-size: 13px;
   font-size: 13px;
-  color: #6B7280;
-  background: #F3F4F6;
+  color: $text-secondary;
+  background: var(--color-bg-tag);
   border: 1px solid transparent;
   border: 1px solid transparent;
 }
 }
 .tag-item.active {
 .tag-item.active {
-  color: #4A148C;
-  background: #F3EEFF;
-  border-color: #4A148C;
+  color: var(--color-gold);
+  background: var(--color-gold-bg);
+  border-color: var(--color-gold);
 }
 }
 
 
 /* Submit */
 /* Submit */
 .submit-btn {
 .submit-btn {
   width: 100%;
   width: 100%;
   height: 48px;
   height: 48px;
-  background: linear-gradient(135deg, #4A148C, #7B2DC8);
-  color: #fff;
+  background: var(--color-gold);
+  color: var(--color-btn-gold-text);
   border: none;
   border: none;
   border-radius: 12px;
   border-radius: 12px;
   font-size: 17px;
   font-size: 17px;
   font-weight: 600;
   font-weight: 600;
   margin-top: 8px;
   margin-top: 8px;
+  cursor: pointer;
+}
+.submit-btn:active {
+  transform: scale(0.97);
+  opacity: 0.9;
 }
 }
 .submit-btn[disabled] {
 .submit-btn[disabled] {
   opacity: 0.5;
   opacity: 0.5;
+  pointer-events: none;
 }
 }
 </style>
 </style>

+ 541 - 89
client/pages/profile/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-profile">
+  <view class="page-profile" :class="themeClass">
     <!-- ========== Merged Region 1+2: User Card + Membership ========== -->
     <!-- ========== Merged Region 1+2: User Card + Membership ========== -->
     <view class="user-card">
     <view class="user-card">
       <!-- Login prompt for unauthenticated users -->
       <!-- Login prompt for unauthenticated users -->
@@ -18,20 +18,23 @@
             <image :src="userStore.avatarUrl || '/static/default-avatar.png'" mode="aspectFill" />
             <image :src="userStore.avatarUrl || '/static/default-avatar.png'" mode="aspectFill" />
           </view>
           </view>
           <view class="user-card__info">
           <view class="user-card__info">
-            <text class="user-card__nickname">{{ userStore.nickname }}</text>
-
-            <!-- Role tag -->
-            <view
-              class="user-card__tag"
-              :class="{
-                'user-card__tag--practitioner': userStore.vipType === 'practitioner',
-                'user-card__tag--annual': userStore.vipType === 'annual',
-                'user-card__tag--normal': !userStore.vipType
-              }"
-            >
-              <text v-if="!userStore.vipType">普通用户</text>
-              <text v-else-if="userStore.vipType === 'annual'">C端会员</text>
-              <text v-else>能量师 🌟</text>
+            <view class="user-card__name-row">
+              <text class="user-card__nickname">{{ userStore.nickname }}</text>
+
+              <!-- Role tag -->
+              <view
+                class="user-card__tag"
+                :class="{
+                  'user-card__tag--practitioner': userStore.vipType === 'practitioner',
+                  'user-card__tag--annual': userStore.vipType === 'annual',
+                  'user-card__tag--super': userStore.vipType === 'super_annual',
+                  'user-card__tag--normal': !userStore.vipType
+                }"
+              >
+                <text v-if="!userStore.vipType">普通用户</text>
+                <text v-else-if="userStore.vipType === 'annual'">C端会员</text>
+                <text v-else>能量师 🌟</text>
+              </view>
             </view>
             </view>
 
 
             <!-- Social summary (optional) -->
             <!-- Social summary (optional) -->
@@ -39,12 +42,12 @@
               {{ userStore.city || '' }}{{ userStore.city && userStore.bio ? ' · ' : '' }}{{ userStore.bio || '' }}
               {{ userStore.city || '' }}{{ userStore.city && userStore.bio ? ' · ' : '' }}{{ userStore.bio || '' }}
             </text>
             </text>
           </view>
           </view>
-<text class="user-card__arrow">›</text>
-
- <!-- Theme switcher inside user card -->
- <view class="user-card__theme">
- <ThemeToggle />
- </view>
+<view class="user-card__header-right">
+      <view class="theme-toggle-btn" @click.stop="themeStore.toggle">
+        <text class="theme-toggle-text">{{ themeStore.theme === 'dark' ? '亮' : '暗' }}</text>
+      </view>
+      <text class="user-card__arrow">›</text>
+    </view>
   </view>
   </view>
   </view>
   </view>
 
 
@@ -172,22 +175,10 @@
 
 
  <!-- ========== Region 3: Feature Menu ========== -->
  <!-- ========== Region 3: Feature Menu ========== -->
 
 
-    <!-- Group 1: My Services -->
-    <view class="menu-section">
+    <!-- Group 1: My Services (practitioner workbench only) -->
+    <view v-if="userStore.vipType === 'practitioner' && userStore.isVip" class="menu-section">
       <view class="menu-section__header">我的服务</view>
       <view class="menu-section__header">我的服务</view>
 
 
-      <!-- Analysis history (all logged-in) -->
-      <view v-if="userStore.isLoggedIn" class="menu-item" @click="goRecords">
-        <text class="menu-item__label">📋 我的分析</text>
-        <text class="menu-item__arrow">›</text>
-      </view>
-
-      <!-- Distribution panel (paid users only) -->
-      <view v-if="userStore.isLoggedIn && userStore.isVip" class="menu-item" @click="goCommission">
-        <text class="menu-item__label">💰 我的推广</text>
-        <text class="menu-item__arrow">›</text>
-      </view>
-
       <!-- Practitioner workbench (practitioners only) — EPIC 9 -->
       <!-- Practitioner workbench (practitioners only) — EPIC 9 -->
       <view v-if="userStore.vipType === 'practitioner' && userStore.isVip" class="menu-item" @click="goWorkbench">
       <view v-if="userStore.vipType === 'practitioner' && userStore.isVip" class="menu-item" @click="goWorkbench">
         <text class="menu-item__label">🔧 工作台</text>
         <text class="menu-item__label">🔧 工作台</text>
@@ -196,6 +187,104 @@
       </view>
       </view>
     </view>
     </view>
 
 
+    <!-- ===== Promotion Center (paid users only) ===== -->
+    <template v-if="userStore.isLoggedIn && userStore.isVip">
+      <!-- 收益 -->
+      <view class="promo-section earnings-section">
+        <view class="promo-section__header">
+          <text class="promo-section__title">💰 我的收益</text>
+        </view>
+        <view class="earnings-grid">
+          <view class="earn-item">
+            <text class="earn-label">累计收益</text>
+            <text class="earn-value accent">¥{{ formatCommissionMoney(stats.totalEarnings) }}</text>
+          </view>
+          <view class="earn-item">
+            <text class="earn-label">可提现余额</text>
+            <text class="earn-value">¥{{ formatCommissionMoney(stats.availableBalance) }}</text>
+          </view>
+          <view class="earn-item">
+            <text class="earn-label">本月收益</text>
+            <text class="earn-value">¥{{ formatCommissionMoney(stats.monthEarnings) }}</text>
+          </view>
+          <view class="earn-item">
+            <text class="earn-label">今日预估</text>
+            <text class="earn-value">¥{{ formatCommissionMoney(stats.todayEstimate) }}</text>
+          </view>
+        </view>
+        <view v-if="l1Total > 0 || l2Total > 0" class="earnings-breakdown">
+          <view class="breakdown-row">
+            <text class="breakdown-label">一级推广佣金</text>
+            <text class="breakdown-value">¥{{ formatCommissionMoney(l1Total) }}</text>
+          </view>
+          <view class="breakdown-row">
+            <text class="breakdown-label">二级推广佣金</text>
+            <text class="breakdown-value">¥{{ formatCommissionMoney(l2Total) }}</text>
+          </view>
+        </view>
+      </view>
+
+      <!-- 团队 -->
+      <view class="promo-section">
+        <view class="promo-section__header">
+          <text class="promo-section__title">👥 我的团队</text>
+          <text v-if="team.length > 0" class="promo-section__sub" @click="showTeamDetail">查看全部 →</text>
+        </view>
+        <view class="team-grid">
+          <view class="team-stat">
+            <text class="stat-num">{{ stats.directInvites }}</text>
+            <text class="stat-label">直接下级</text>
+          </view>
+          <view class="team-stat">
+            <text class="stat-num">{{ stats.indirectInvites }}</text>
+            <text class="stat-label">间接下级</text>
+          </view>
+          <view class="team-stat">
+            <text class="stat-num">{{ stats.convertedCount }}</text>
+            <text class="stat-label">下级升级</text>
+          </view>
+          <view class="team-stat">
+            <text class="stat-num">{{ stats.totalCommissions }}</text>
+            <text class="stat-label">佣金笔数</text>
+          </view>
+        </view>
+        <view v-if="team.length > 0" class="team-preview">
+          <view v-for="(m, idx) in team.slice(0, 5)" :key="idx" class="member-row">
+            <image class="member-avatar" :src="m.avatarUrl || '/static/default-avatar.png'" mode="aspectFill" />
+            <view class="member-info">
+              <text class="member-name">{{ m.nickname || '微信用户' }}</text>
+              <text class="member-date">{{ formatDate(m.createdAt) }} 加入</text>
+            </view>
+            <text v-if="m.isVip" class="member-vip">VIP</text>
+          </view>
+        </view>
+        <view v-else class="promo-empty">
+          <text class="promo-empty-text">暂无推广成员</text>
+        </view>
+      </view>
+
+      <!-- 佣金明细 -->
+      <view class="promo-section">
+        <view class="promo-section__header">
+          <text class="promo-section__title">📋 佣金明细</text>
+        </view>
+        <view v-if="commissions.length === 0" class="promo-empty">
+          <text class="promo-empty-text">暂无佣金记录</text>
+        </view>
+        <view v-for="(c, idx) in commissions" :key="idx" class="commission-row">
+          <view class="comm-left">
+            <text class="comm-amount">+¥{{ (c.amount / 100).toFixed(2) }}</text>
+            <text class="comm-level">{{ c.level === 1 ? '一级推广' : '二级推广' }}</text>
+            <text v-if="c.remark" class="comm-remark">{{ c.remark }}</text>
+          </view>
+          <view class="comm-right">
+            <text class="comm-status" :class="'status-' + c.status">{{ commissionStatusText(c.status) }}</text>
+            <text class="comm-date">{{ formatDate(c.createdAt) }}</text>
+          </view>
+        </view>
+      </view>
+    </template>
+
     <!-- Group 2: Promotion Tools (paid users only) -->
     <!-- Group 2: Promotion Tools (paid users only) -->
     <view v-if="userStore.isLoggedIn && userStore.isVip && userStore.referralCode" class="menu-section">
     <view v-if="userStore.isLoggedIn && userStore.isVip && userStore.referralCode" class="menu-section">
       <view class="menu-section__header">推广工具</view>
       <view class="menu-section__header">推广工具</view>
@@ -242,21 +331,39 @@
 </template>
 </template>
 
 
 <script setup>
 <script setup>
- import { computed, getCurrentInstance } from 'vue'
- import { onShow } from '@dcloudio/uni-app'
- import { useUserStore } from '@/stores/user'
- import { useThemeStore } from '@/stores/theme'
- import { profileApi } from '@/utils/api'
-
- const userStore = useUserStore()
- const themeStore = useThemeStore()
+  import { ref, computed, getCurrentInstance } from 'vue'
+  import { onShow } from '@dcloudio/uni-app'
+  import { useUserStore } from '@/stores/user'
+  import { useThemeStore } from '@/stores/theme'
+  import { useTheme } from '@/composables/useThemeStyle'
+  import { profileApi, commissionApi } from '@/utils/api'
+
+  const userStore = useUserStore()
+  const themeStore = useThemeStore()
+  const { themeClass } = useTheme()
+
+  // Commission reactive data
+  const commissions = ref([])
+  const team = ref([])
+  const stats = ref({
+    totalEarnings: 0,
+    availableBalance: 0,
+    todayEstimate: 0,
+    monthEarnings: 0,
+    directInvites: 0,
+    indirectInvites: 0,
+    convertedCount: 0,
+    totalCommissions: 0
+  })
 
 
- // Initialize theme on page show
- onShow(() => {
- themeStore.init()
- })
+  const l1Total = computed(() =>
+    commissions.value.filter(c => c.level === 1 && c.status === 'settled').reduce((s, c) => s + (c.amount || 0), 0)
+  )
+  const l2Total = computed(() =>
+    commissions.value.filter(c => c.level === 2 && c.status === 'settled').reduce((s, c) => s + (c.amount || 0), 0)
+  )
 
 
-// US-4.3: Renewal reminder if expiry within 7 days
+// US-4.3: Renewal reminder if expiry within 7 days
 const isExpiringSoon = computed(() => {
 const isExpiringSoon = computed(() => {
   if (!userStore.vipEndTime) return false
   if (!userStore.vipEndTime) return false
   const expiry = new Date(userStore.vipEndTime)
   const expiry = new Date(userStore.vipEndTime)
@@ -277,10 +384,12 @@ function formatDate(dateStr) {
 }
 }
 
 
 onShow(() => {
 onShow(() => {
+  themeStore.init()
   if (userStore.isLoggedIn) {
   if (userStore.isLoggedIn) {
     userStore.fetchProfile()
     userStore.fetchProfile()
     userStore.fetchQuota()
     userStore.fetchQuota()
     userStore.fetchCommissionSummary()
     userStore.fetchCommissionSummary()
+    fetchCommissionData()
   }
   }
 })
 })
 
 
@@ -313,16 +422,36 @@ function goSuperMember() {
   uni.navigateTo({ url: '/pages/payment/index?product=super_member' })
   uni.navigateTo({ url: '/pages/payment/index?product=super_member' })
 }
 }
 
 
-function goRecords() {
-  uni.switchTab({ url: '/pages/records/index' })
+function formatCommissionMoney(cents) {
+  if (cents == null) return '0.00'
+  return (cents / 100).toFixed(2)
 }
 }
 
 
-function goCommission() {
-  if (!userStore.isLoggedIn) {
-    uni.navigateTo({ url: '/pages/login/index' })
-    return
-  }
-  uni.navigateTo({ url: '/pages/commission/index' })
+function commissionStatusText(status) {
+  const map = { settled: '已结算', pending: '处理中', withdrawn: '已提现', available: '可提现' }
+  return map[status] || status
+}
+
+async function fetchCommissionData() {
+  if (!userStore.isVip) return
+  try {
+    const [listData, teamData, statsData] = await Promise.all([
+      commissionApi.list(),
+      commissionApi.team(),
+      commissionApi.stats()
+    ])
+    commissions.value = listData || []
+    team.value = teamData || []
+    if (statsData) stats.value = statsData
+  } catch (e) { /* ignore */ }
+}
+
+function showTeamDetail() {
+  uni.showModal({
+    title: '推广团队',
+    content: `直接下级 ${stats.value.directInvites} 人\n间接下级 ${stats.value.indirectInvites} 人\n已升级VIP ${stats.value.convertedCount} 人`,
+    showCancel: false
+  })
 }
 }
 
 
 // EPIC 9: Navigate to practitioner workbench
 // EPIC 9: Navigate to practitioner workbench
@@ -508,16 +637,98 @@ function handleLogout() {
 </script>
 </script>
 
 
 <style scoped lang="scss">
 <style scoped lang="scss">
-// Brand colors (aligned with style-guide.md)
-$blue-dark: #1E3A5F;
-$gold: #C9A84C;
-$gold-light: #F8F0D8;
-$warm-white: #F8F6F1;
+// Brand colors (using CSS custom properties — responsive to theme)
+$blue-dark: var(--color-brand);
+$gold: var(--color-gold);
+$gold-light: var(--color-gold-light);
+$warm-white: var(--color-bg);
 $white: #FFFFFF;
 $white: #FFFFFF;
-$text-primary: #1F2937;
-$text-secondary: #6B7280;
-$text-muted: #9CA3AF;
-$danger: #EF4444;
+$card-bg: var(--color-bg-card);
+$text-primary: var(--color-text-primary);
+$text-secondary: var(--color-text-secondary);
+$text-muted: var(--color-text-tertiary);
+$danger: var(--color-danger);
+
+// ===== Theme Variables (class-based, replaces inline :style) =====
+.page-profile {
+  // Default: Dark Theme
+  --color-bg: #0c0a1a;
+  --color-bg-secondary: #120d28;
+  --color-bg-tertiary: #0f0c1e;
+  --color-bg-card: rgba(255, 255, 255, 0.06);
+  --color-bg-card-hover: rgba(255, 255, 255, 0.1);
+  --color-bg-input: rgba(255, 255, 255, 0.1);
+  --color-bg-tag: rgba(255, 255, 255, 0.08);
+  --color-bg-overlay: rgba(12, 10, 26, 0.85);
+  --color-text-primary: #FFFFFF;
+  --color-text-secondary: #CBD5E1;
+  --color-text-tertiary: rgba(255, 255, 255, 0.6);
+  --color-text-link: #60A5FA;
+  --color-text-gold: #C9A84C;
+  --color-brand: #1E3A5F;
+  --color-brand-light: #1E3A5F;
+  --color-elevated: #172943;
+  --color-gold: #C9A84C;
+  --color-gold-bg: rgba(201, 168, 76, 0.15);
+  --color-gold-light: #FEF3C7;
+  --color-border: rgba(255, 255, 255, 0.1);
+  --color-border-light: rgba(255, 255, 255, 0.06);
+  --color-border-focus: rgba(201, 168, 76, 0.5);
+  --color-success: #10b981;
+  --color-success-bg: rgba(16, 185, 129, 0.15);
+  --color-warning: #fbbf24;
+  --color-warning-bg: rgba(251, 191, 36, 0.15);
+  --color-danger: #ef4444;
+  --color-danger-bg: rgba(239, 68, 68, 0.15);
+  --color-info: #3B82F6;
+  --color-info-bg: rgba(59, 130, 246, 0.15);
+  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
+  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
+  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
+  --shadow-modal: 0 10px 40px rgba(0, 0, 0, 0.5);
+  --shadow-btn: 0 4px 15px rgba(30, 58, 95, 0.4);
+  --shadow-gold: 0 4px 15px rgba(201, 168, 76, 0.3);
+
+  // Light Theme override
+  &.theme-light {
+    --color-bg: #F8F6F1;
+    --color-bg-secondary: #F0EDE6;
+    --color-bg-tertiary: #E8E5DE;
+    --color-bg-card: #FFFFFF;
+    --color-bg-card-hover: #F7F8FC;
+    --color-bg-input: #F3F4F6;
+    --color-bg-tag: #F3F4F6;
+    --color-bg-overlay: rgba(248, 246, 241, 0.9);
+    --color-text-primary: #1A1A2E;
+    --color-text-secondary: #4A5568;
+    --color-text-tertiary: #9CA3AF;
+    --color-text-link: #2563EB;
+    --color-text-gold: #92400E;
+    --color-brand: #1E3A5F;
+    --color-brand-light: #1E3A5F;
+    --color-elevated: #2C5282;
+    --color-gold: #C9A84C;
+    --color-gold-bg: #FEF3C7;
+    --color-gold-light: #FEF3C7;
+    --color-border: #E2E8F0;
+    --color-border-light: #F3F4F6;
+    --color-border-focus: rgba(201, 168, 76, 0.6);
+    --color-success: #059669;
+    --color-success-bg: #D1FAE5;
+    --color-warning: #D97706;
+    --color-warning-bg: #FEF3C7;
+    --color-danger: #DC2626;
+    --color-danger-bg: #FEE2E2;
+    --color-info: #2563EB;
+    --color-info-bg: #DBEAFE;
+    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
+    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
+    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.06);
+    --shadow-modal: 0 8px 30px rgba(0, 0, 0, 0.1);
+    --shadow-btn: 0 4px 12px rgba(30, 58, 95, 0.2);
+    --shadow-gold: 0 4px 12px rgba(201, 168, 76, 0.2);
+  }
+}
 
 
 .page-profile {
 .page-profile {
   padding: 16px;
   padding: 16px;
@@ -527,10 +738,10 @@ $danger: #EF4444;
 
 
 // ========== Merged Region 1+2: User Card + Membership ==========
 // ========== Merged Region 1+2: User Card + Membership ==========
 .user-card {
 .user-card {
-  background: linear-gradient(135deg, $blue-dark, darken($blue-dark, 6%));
+  background: linear-gradient(135deg, var(--color-brand), var(--color-elevated));
   border-radius: 16px;
   border-radius: 16px;
   padding: 20px 18px;
   padding: 20px 18px;
-  margin-bottom: 16px;
+  margin-bottom: 24px;
 
 
   &__login {
   &__login {
     cursor: pointer;
     cursor: pointer;
@@ -553,11 +764,17 @@ $danger: #EF4444;
     min-width: 0;
     min-width: 0;
   }
   }
 
 
+  &__name-row {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    flex-wrap: wrap;
+  }
+
   &__nickname {
   &__nickname {
     font-size: 17px;
     font-size: 17px;
     font-weight: 600;
     font-weight: 600;
     color: $white;
     color: $white;
-    display: block;
   }
   }
 
 
   &__login-hint {
   &__login-hint {
@@ -573,27 +790,36 @@ $danger: #EF4444;
     border-radius: 20px;
     border-radius: 20px;
     font-size: 11px;
     font-size: 11px;
     margin-top: 6px;
     margin-top: 6px;
+    background: rgba(255, 255, 255, 0.22);
+    color: #fff;
 
 
     &--practitioner {
     &--practitioner {
       background: $gold;
       background: $gold;
-      color: $blue-dark;
+      color: #fff;
       font-weight: 600;
       font-weight: 600;
     }
     }
 
 
     &--annual {
     &--annual {
-      background: rgba($gold, 0.25);
-      color: $gold;
+      background: $gold;
+      color: #fff;
+      font-weight: 600;
+    }
+
+    &--super {
+      background: $gold;
+      color: #fff;
+      font-weight: 600;
     }
     }
 
 
     &--normal {
     &--normal {
-      background: rgba(255, 255, 255, 0.15);
-      color: rgba(255, 255, 255, 0.8);
+      background: rgba(255, 255, 255, 0.22);
+      color: #fff;
     }
     }
   }
   }
 
 
   &__summary {
   &__summary {
     font-size: 11px;
     font-size: 11px;
-    color: rgba(255, 255, 255, 0.55);
+    color: rgba(255, 255, 255, 0.78);
     margin-top: 4px;
     margin-top: 4px;
     display: block;
     display: block;
     overflow: hidden;
     overflow: hidden;
@@ -607,6 +833,232 @@ $danger: #EF4444;
     flex-shrink: 0;
     flex-shrink: 0;
     padding-left: 4px;
     padding-left: 4px;
   }
   }
+
+  &__header-right {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    flex-shrink: 0;
+    align-self: flex-start;
+    padding-top: 2px;
+  }
+}
+
+// Theme toggle button
+.theme-toggle-btn {
+  width: 36px;
+  height: 36px;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  background: rgba(255, 255, 255, 0.2);
+  border: 1.5px solid rgba(255, 255, 255, 0.35);
+  border-radius: 50%;
+  cursor: pointer;
+  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+}
+.theme-toggle-text {
+  font-size: 13px;
+  font-weight: 700;
+  color: #fff;
+  line-height: 1;
+}
+
+// ===== Promotion Center Sections =====
+.promo-section {
+  background: var(--color-bg-card);
+  border-radius: 14px;
+  padding: 16px;
+  margin-bottom: 16px;
+
+  &__header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 14px;
+  }
+  &__title {
+    font-size: 16px;
+    font-weight: 700;
+    color: $text-primary;
+  }
+  &__sub {
+    font-size: 12px;
+    color: #3B82F6;
+    font-weight: 500;
+  }
+}
+
+.earnings-section {
+  background: linear-gradient(135deg, var(--color-brand), var(--color-elevated));
+  .promo-section__title {
+    color: rgba(255,255,255,0.9);
+  }
+}
+
+.earnings-grid {
+  display: grid;
+  grid-template-columns: 1fr 1fr;
+  gap: 12px;
+}
+.earn-item {
+  text-align: center;
+  padding: 8px 0;
+}
+.earn-label {
+  font-size: 11px;
+  color: rgba(255,255,255,0.78);
+  display: block;
+  margin-bottom: 4px;
+}
+.earn-value {
+  font-size: 22px;
+  font-weight: 700;
+  color: #fff;
+  display: block;
+}
+.earn-value.accent {
+  color: var(--color-gold);
+}
+
+.earnings-breakdown {
+  margin-top: 12px;
+  padding: 10px 14px;
+  background: rgba(255,255,255,0.03);
+  border-radius: 8px;
+}
+.breakdown-row {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 4px 0;
+}
+.breakdown-label {
+  font-size: 12px;
+  color: rgba(255,255,255,0.7);
+}
+.breakdown-value {
+  font-size: 13px;
+  font-weight: 500;
+  color: rgba(255,255,255,0.9);
+}
+
+// Team
+.team-grid {
+  display: grid;
+  grid-template-columns: 1fr 1fr 1fr 1fr;
+  gap: 8px;
+  margin-bottom: 14px;
+}
+.team-stat {
+  text-align: center;
+  padding: 8px 0;
+}
+.stat-num {
+  font-size: 24px;
+  font-weight: 700;
+  color: var(--color-text-primary);
+  display: block;
+}
+.stat-label {
+  font-size: 11px;
+  color: $text-secondary;
+  margin-top: 2px;
+  display: block;
+}
+
+.team-preview {
+  border-top: 1px solid var(--color-border);
+  padding-top: 10px;
+}
+.member-row {
+  display: flex;
+  align-items: center;
+  padding: 8px 0;
+  border-bottom: 1px solid var(--color-bg);
+}
+.member-row:last-child { border-bottom: none; }
+.member-avatar {
+  width: 32px;
+  height: 32px;
+  border-radius: 50%;
+  margin-right: 10px;
+  flex-shrink: 0;
+}
+.member-info { flex: 1; }
+.member-name {
+  font-size: 13px;
+  color: $text-primary;
+  display: block;
+}
+.member-date {
+  font-size: 11px;
+  color: $text-secondary;
+  margin-top: 1px;
+  display: block;
+}
+.member-vip {
+  font-size: 10px;
+  color: var(--color-gold);
+  background: #FEF3C7;
+  padding: 2px 8px;
+  border-radius: 4px;
+  font-weight: 500;
+}
+
+.promo-empty {
+  padding: 24px 0;
+  text-align: center;
+}
+.promo-empty-text {
+  font-size: 13px;
+  color: $text-secondary;
+}
+
+// Commission List
+.commission-row {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 12px 0;
+  border-bottom: 1px solid var(--color-border);
+}
+.commission-row:last-child { border-bottom: none; }
+.comm-left { flex: 1; }
+.comm-amount {
+  font-size: 15px;
+  font-weight: 600;
+  color: #2D8B67;
+  display: block;
+}
+.comm-level {
+  font-size: 12px;
+  color: $text-secondary;
+  margin-top: 2px;
+  display: block;
+}
+.comm-remark {
+  font-size: 11px;
+  color: $text-secondary;
+  margin-top: 1px;
+  display: block;
+}
+.comm-right { text-align: right; }
+.comm-status {
+  font-size: 11px;
+  padding: 2px 8px;
+  border-radius: 4px;
+  display: inline-block;
+  margin-bottom: 2px;
+}
+.comm-status.status-settled { background: #ECFDF5; color: #2D8B67; }
+.comm-status.status-pending { background: #FEF3C7; color: #D4A017; }
+.comm-status.status-withdrawn { background: var(--color-bg-input); color: $text-secondary; }
+.comm-status.status-available { background: #EFF6FF; color: #3B82F6; }
+.comm-date {
+  font-size: 11px;
+  color: $text-secondary;
+  display: block;
 }
 }
 
 
 // Avatar
 // Avatar
@@ -696,7 +1148,7 @@ $danger: #EF4444;
   display: flex;
   display: flex;
   justify-content: space-between;
   justify-content: space-between;
   align-items: center;
   align-items: center;
-  margin-bottom: 16px;
+  margin-top: 16px;
 
 
   &__body {
   &__body {
     flex: 1;
     flex: 1;
@@ -710,7 +1162,7 @@ $danger: #EF4444;
 
 
   &__desc {
   &__desc {
     font-size: 12px;
     font-size: 12px;
-    opacity: 0.8;
+    opacity: 0.92;
     display: block;
     display: block;
     margin-top: 4px;
     margin-top: 4px;
   }
   }
@@ -770,17 +1222,17 @@ $danger: #EF4444;
   // Expired
   // Expired
   &--expired {
   &--expired {
     background: #E5E7EB;
     background: #E5E7EB;
-    .vip-card__title { color: $text-secondary; }
-    .vip-card__desc { color: $text-muted; }
+    .vip-card__title { color: $text-primary; }
+    .vip-card__desc { color: $text-secondary; }
     .vip-card__action {
     .vip-card__action {
-      color: $text-secondary;
-      background: $white;
+      color: #fff;
+      background: $text-secondary;
     }
     }
   }
   }
 
 
   // Upsell (free user — two options)
   // Upsell (free user — two options)
   &--upsell {
   &--upsell {
-    background: linear-gradient(135deg, $blue-dark, darken($blue-dark, 4%));
+    background: linear-gradient(135deg, var(--color-brand), var(--color-elevated));
     flex-direction: column;
     flex-direction: column;
     align-items: flex-start;
     align-items: flex-start;
     gap: 14px;
     gap: 14px;
@@ -832,7 +1284,7 @@ $danger: #EF4444;
 
 
     .vip-card__option .option-desc {
     .vip-card__option .option-desc {
       font-size: 11px;
       font-size: 11px;
-      color: rgba(255, 255, 255, 0.45);
+      color: rgba(255, 255, 255, 0.7);
     }
     }
 
 
     .vip-card__option .option-btn {
     .vip-card__option .option-btn {
@@ -857,15 +1309,15 @@ $danger: #EF4444;
     }
     }
 
 
     .vip-card__option--pro {
     .vip-card__option--pro {
-      border-color: rgba($gold, 0.2);
-      background: rgba($gold, 0.06);
+      border-color: rgba(201, 168, 76, 0.2);
+      background: rgba(201, 168, 76, 0.06);
     }
     }
   }
   }
 }
 }
 
 
 // Daily quota
 // Daily quota
 .quota-bar {
 .quota-bar {
-  background: $white;
+  background: $card-bg;
   border-radius: 12px;
   border-radius: 12px;
   padding: 16px;
   padding: 16px;
   margin-bottom: 16px;
   margin-bottom: 16px;
@@ -899,7 +1351,7 @@ $danger: #EF4444;
 
 
 // ========== Region 3: Feature Menu ==========
 // ========== Region 3: Feature Menu ==========
 .menu-section {
 .menu-section {
-  background: $white;
+  background: $card-bg;
   border-radius: 12px;
   border-radius: 12px;
   margin-bottom: 16px;
   margin-bottom: 16px;
   overflow: hidden;
   overflow: hidden;
@@ -907,7 +1359,7 @@ $danger: #EF4444;
   &__header {
   &__header {
     font-size: 12px;
     font-size: 12px;
     font-weight: 600;
     font-weight: 600;
-    color: $text-muted;
+    color: $text-secondary;
     text-transform: uppercase;
     text-transform: uppercase;
     letter-spacing: 0.5px;
     letter-spacing: 0.5px;
     padding: 14px 16px 6px;
     padding: 14px 16px 6px;
@@ -954,7 +1406,7 @@ $danger: #EF4444;
   }
   }
 
 
   &__arrow {
   &__arrow {
-    color: $text-muted;
+    color: $text-secondary;
     font-size: 18px;
     font-size: 18px;
   }
   }
 
 
@@ -982,7 +1434,7 @@ $danger: #EF4444;
 
 
   &__prefix {
   &__prefix {
     font-size: 13px;
     font-size: 13px;
-    color: $text-secondary;
+    color: $blue-dark;
   }
   }
 
 
   &__code {
   &__code {

+ 4 - 1
client/pages/register/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-register">
+  <view class="page-register" :class="themeClass">
     <view class="header">
     <view class="header">
       <text class="title">完善个人资料</text>
       <text class="title">完善个人资料</text>
       <text class="subtitle">填写以下信息以开启完整体验</text>
       <text class="subtitle">填写以下信息以开启完整体验</text>
@@ -90,6 +90,9 @@
 import { ref, reactive, computed } from 'vue'
 import { ref, reactive, computed } from 'vue'
 import { useUserStore } from '@/stores/user'
 import { useUserStore } from '@/stores/user'
 import { profileApi } from '@/utils/api'
 import { profileApi } from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const userStore = useUserStore()
 const userStore = useUserStore()
 const submitting = ref(false)
 const submitting = ref(false)

+ 7 - 4
client/pages/relations/add-relation.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-add-relation">
+  <view class="page-add-relation" :class="themeClass">
     <view class="form-card">
     <view class="form-card">
       <!-- Relation Type -->
       <!-- Relation Type -->
       <view class="form-group">
       <view class="form-group">
@@ -83,6 +83,9 @@
 import { ref, reactive } from 'vue'
 import { ref, reactive } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { onLoad } from '@dcloudio/uni-app'
 import requestInstance from '@/utils/api'
 import requestInstance from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const relationApi = {
 const relationApi = {
   create: (data) => requestInstance.post('/relation/create', data),
   create: (data) => requestInstance.post('/relation/create', data),
@@ -265,7 +268,7 @@ async function handleSave() {
   background: var(--color-brand);
   background: var(--color-brand);
 }
 }
 .type-chip.active .chip-text {
 .type-chip.active .chip-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
 }
 }
 .chip-text {
 .chip-text {
   font-size: 14px;
   font-size: 14px;
@@ -294,7 +297,7 @@ async function handleSave() {
   background: var(--color-brand);
   background: var(--color-brand);
 }
 }
 .gender-option.active .gender-text {
 .gender-option.active .gender-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
 }
 }
 .gender-text {
 .gender-text {
   font-size: 14px;
   font-size: 14px;
@@ -325,7 +328,7 @@ async function handleSave() {
   pointer-events: none;
   pointer-events: none;
 }
 }
 .btn-save-text {
 .btn-save-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 16px;
   font-size: 16px;
   font-weight: 600;
   font-weight: 600;
 }
 }

+ 9 - 6
client/pages/relations/analysis-chat.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-chat">
+  <view class="page-chat" :class="themeClass">
     <!-- ========== Member Bar ========== -->
     <!-- ========== Member Bar ========== -->
     <view class="member-bar">
     <view class="member-bar">
       <text class="member-bar-title">分析成员</text>
       <text class="member-bar-title">分析成员</text>
@@ -71,6 +71,9 @@
 import { ref, computed, nextTick, watch } from 'vue'
 import { ref, computed, nextTick, watch } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { onLoad } from '@dcloudio/uni-app'
 import request from '@/utils/api'
 import request from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const recordId = ref(null)
 const recordId = ref(null)
 const messages = ref([])
 const messages = ref([])
@@ -195,7 +198,7 @@ function onScrollToLower() {
 .mini-avatar-text {
 .mini-avatar-text {
   font-size: 11px;
   font-size: 11px;
   font-weight: 700;
   font-weight: 700;
-  color: var(--color-bg-card);
+  color: #FFFFFF;
 }
 }
 
 
 /* Chat scroll area */
 /* Chat scroll area */
@@ -236,11 +239,11 @@ function onScrollToLower() {
 }
 }
 .user-avatar {
 .user-avatar {
   background: var(--color-gold);
   background: var(--color-gold);
-  color: var(--color-bg-card);
+  color: #FFFFFF;
 }
 }
 .ai-avatar {
 .ai-avatar {
   background: var(--color-brand);
   background: var(--color-brand);
-  color: var(--color-bg-card);
+  color: #FFFFFF;
 }
 }
 
 
 .msg-bubble {
 .msg-bubble {
@@ -251,7 +254,7 @@ function onScrollToLower() {
 }
 }
 .bubble-user {
 .bubble-user {
   background: var(--color-brand);
   background: var(--color-brand);
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   border-bottom-right-radius: 4px;
   border-bottom-right-radius: 4px;
 }
 }
 .bubble-ai {
 .bubble-ai {
@@ -318,7 +321,7 @@ function onScrollToLower() {
   pointer-events: none;
   pointer-events: none;
 }
 }
 .btn-send-text {
 .btn-send-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 14px;
   font-size: 14px;
   font-weight: 700;
   font-weight: 700;
 }
 }

+ 6 - 3
client/pages/relations/analysis-records.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-records">
+  <view class="page-records" :class="themeClass">
     <!-- ========== Header ========== -->
     <!-- ========== Header ========== -->
     <view class="header-bar">
     <view class="header-bar">
       <text class="header-title">分析记录</text>
       <text class="header-title">分析记录</text>
@@ -54,6 +54,9 @@
 import { ref } from 'vue'
 import { ref } from 'vue'
 import { onShow } from '@dcloudio/uni-app'
 import { onShow } from '@dcloudio/uni-app'
 import request from '@/utils/api'
 import request from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const records = ref([])
 const records = ref([])
 const loading = ref(false)
 const loading = ref(false)
@@ -138,7 +141,7 @@ function formatTime(time) {
   transform: scale(0.97);
   transform: scale(0.97);
 }
 }
 .btn-new-text {
 .btn-new-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 14px;
   font-size: 14px;
   font-weight: 600;
   font-weight: 600;
 }
 }
@@ -192,7 +195,7 @@ function formatTime(time) {
   transform: scale(0.97);
   transform: scale(0.97);
 }
 }
 .btn-empty-new-text {
 .btn-empty-new-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 15px;
   font-size: 15px;
   font-weight: 600;
   font-weight: 600;
 }
 }

+ 7 - 4
client/pages/relations/analysis-select.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-select">
+  <view class="page-select" :class="themeClass">
     <!-- ========== Member Selection ========== -->
     <!-- ========== Member Selection ========== -->
     <view class="section">
     <view class="section">
       <text class="section-title">选择分析成员</text>
       <text class="section-title">选择分析成员</text>
@@ -81,6 +81,9 @@ import { ref, computed } from 'vue'
 import { onShow } from '@dcloudio/uni-app'
 import { onShow } from '@dcloudio/uni-app'
 import { useUserStore } from '@/stores/user'
 import { useUserStore } from '@/stores/user'
 import request from '@/utils/api'
 import request from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const userStore = useUserStore()
 const userStore = useUserStore()
 const relations = ref([])
 const relations = ref([])
@@ -224,7 +227,7 @@ $brand-color: #1E3A5F;
 .avatar-text {
 .avatar-text {
   font-size: 16px;
   font-size: 16px;
   font-weight: 700;
   font-weight: 700;
-  color: var(--color-bg-card);
+  color: #FFFFFF;
 }
 }
 
 
 .member-info {
 .member-info {
@@ -263,7 +266,7 @@ $brand-color: #1E3A5F;
   border-color: var(--color-gold);
   border-color: var(--color-gold);
 }
 }
 .checkbox-icon {
 .checkbox-icon {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 12px;
   font-size: 12px;
   font-weight: 700;
   font-weight: 700;
 }
 }
@@ -343,7 +346,7 @@ $brand-color: #1E3A5F;
   pointer-events: none;
   pointer-events: none;
 }
 }
 .btn-submit-text {
 .btn-submit-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 17px;
   font-size: 17px;
   font-weight: 700;
   font-weight: 700;
 }
 }

+ 5 - 2
client/pages/relations/chart-compare.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-compare">
+  <view class="page-compare" :class="themeClass">
     <!-- Loading state -->
     <!-- Loading state -->
     <view v-if="loading" class="loading-state">
     <view v-if="loading" class="loading-state">
       <view class="skeleton-chart" />
       <view class="skeleton-chart" />
@@ -69,6 +69,9 @@ import { ref } from 'vue'
 import { onLoad } from '@dcloudio/uni-app'
 import { onLoad } from '@dcloudio/uni-app'
 import requestInstance from '@/utils/api'
 import requestInstance from '@/utils/api'
 import TriangleChart from '@/components/TriangleChart.vue'
 import TriangleChart from '@/components/TriangleChart.vue'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const relationId = ref(null)
 const relationId = ref(null)
 const loading = ref(true)
 const loading = ref(true)
@@ -273,7 +276,7 @@ async function handleInterpret() {
   pointer-events: none;
   pointer-events: none;
 }
 }
 .btn-interpret-text {
 .btn-interpret-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 16px;
   font-size: 16px;
   font-weight: 600;
   font-weight: 600;
 }
 }

+ 55 - 13
client/pages/relations/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-relations">
+  <view class="page-relations" :class="themeClass">
     <!-- ========== Super Member Guard ========== -->
     <!-- ========== Super Member Guard ========== -->
     <view v-if="!isSuperMember" class="locked-screen">
     <view v-if="!isSuperMember" class="locked-screen">
       <view class="locked-icon-wrap">
       <view class="locked-icon-wrap">
@@ -49,7 +49,7 @@
         </template>
         </template>
         <template v-else>
         <template v-else>
           <view class="analysis-action-selected">
           <view class="analysis-action-selected">
-            <text class="analysis-action-title">已选 {{ selectedIds.length }} 人</text>
+            <text class="analysis-action-title">已选 {{ totalCount }} 人</text>
             <view class="analysis-action-input-wrap">
             <view class="analysis-action-input-wrap">
               <textarea
               <textarea
                 v-model="question"
                 v-model="question"
@@ -63,11 +63,11 @@
           </view>
           </view>
           <view
           <view
             class="analysis-action-submit"
             class="analysis-action-submit"
-            :class="{ disabled: !question.trim() || submitting }"
+            :class="{ disabled: totalCount < 2 || submitting }"
             @click="handleStartAnalysis"
             @click="handleStartAnalysis"
           >
           >
             <text class="analysis-action-submit-text">
             <text class="analysis-action-submit-text">
-              {{ submitting ? '分析中...' : '开始分析' }}
+              {{ submitting ? '分析中...' : totalCount < 2 ? '请至少选择2人' : '开始分析' }}
             </text>
             </text>
           </view>
           </view>
         </template>
         </template>
@@ -95,6 +95,27 @@
         </view>
         </view>
       </view>
       </view>
 
 
+      <!-- ========== Self Card ========== -->
+      <view class="section-header">
+        <text class="section-header-title">选择分析对象</text>
+      </view>
+
+      <view class="relation-card self-card" :class="{ selected: includeSelf }" @click="toggleSelf">
+        <view class="card-header">
+          <view class="type-tag">
+            <text class="type-tag-text">本人</text>
+          </view>
+          <view v-if="includeSelf" class="card-checked">
+            <text class="card-checked-icon">✓</text>
+          </view>
+        </view>
+        <view class="card-body">
+          <text class="card-name">{{ userStore.nickname || '我' }}(本人)</text>
+          <text v-if="userStore.birthYear" class="card-birth">{{ userStore.birthYear }}-{{ userStore.birthMonth }}-{{ userStore.birthDay }}</text>
+          <text v-else class="card-birth">未设置出生日期</text>
+        </view>
+      </view>
+
       <!-- ========== Relations Section ========== -->
       <!-- ========== Relations Section ========== -->
       <view class="section-header">
       <view class="section-header">
         <text class="section-header-title">我的关系人</text>
         <text class="section-header-title">我的关系人</text>
@@ -154,6 +175,9 @@ import { ref, computed } from 'vue'
 import { onShow } from '@dcloudio/uni-app'
 import { onShow } from '@dcloudio/uni-app'
 import { useUserStore } from '@/stores/user'
 import { useUserStore } from '@/stores/user'
 import requestInstance from '@/utils/api'
 import requestInstance from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const userStore = useUserStore()
 const userStore = useUserStore()
 const relations = ref([])
 const relations = ref([])
@@ -161,9 +185,12 @@ const loading = ref(false)
 const recentRecords = ref([])
 const recentRecords = ref([])
 const recordsLoading = ref(false)
 const recordsLoading = ref(false)
 const selectedIds = ref([])
 const selectedIds = ref([])
+const includeSelf = ref(true)
 const question = ref('')
 const question = ref('')
 const submitting = ref(false)
 const submitting = ref(false)
 
 
+const totalCount = computed(() => selectedIds.value.length + (includeSelf.value ? 1 : 0))
+
 const isSuperMember = computed(() => {
 const isSuperMember = computed(() => {
   if (!userStore.isVip) return false
   if (!userStore.isVip) return false
   return userStore.vipType === 'super_annual' || userStore.vipType === 'practitioner'
   return userStore.vipType === 'super_annual' || userStore.vipType === 'practitioner'
@@ -224,6 +251,10 @@ async function fetchRecentRecords() {
   }
   }
 }
 }
 
 
+function toggleSelf() {
+  includeSelf.value = !includeSelf.value
+}
+
 function toggleSelect(id) {
 function toggleSelect(id) {
   const idx = selectedIds.value.indexOf(id)
   const idx = selectedIds.value.indexOf(id)
   if (idx > -1) {
   if (idx > -1) {
@@ -234,12 +265,17 @@ function toggleSelect(id) {
 }
 }
 
 
 async function handleStartAnalysis() {
 async function handleStartAnalysis() {
-  if (!question.value.trim() || submitting.value) return
+  if (totalCount.value < 2) {
+    uni.showToast({ title: '请至少选择 2 人', icon: 'none' })
+    return
+  }
+  if (submitting.value) return
   submitting.value = true
   submitting.value = true
   try {
   try {
+    const autoQuestion = question.value.trim() || '请对这组关系进行能量分析,分析成员之间的能量互动关系'
     const res = await requestInstance.post('/relation/analysis/start', {
     const res = await requestInstance.post('/relation/analysis/start', {
       relationIds: selectedIds.value,
       relationIds: selectedIds.value,
-      question: question.value.trim()
+      question: autoQuestion
     })
     })
     if (res && res.id) {
     if (res && res.id) {
       selectedIds.value = []
       selectedIds.value = []
@@ -347,7 +383,7 @@ $brand-color: #1E3A5F;
   opacity: 0.9;
   opacity: 0.9;
 }
 }
 .btn-add-text {
 .btn-add-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 14px;
   font-size: 14px;
   font-weight: 600;
   font-weight: 600;
 }
 }
@@ -402,7 +438,7 @@ $brand-color: #1E3A5F;
   display: block;
   display: block;
   font-size: 15px;
   font-size: 15px;
   font-weight: 700;
   font-weight: 700;
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   margin-bottom: 3px;
   margin-bottom: 3px;
 }
 }
 .analysis-action-desc {
 .analysis-action-desc {
@@ -423,7 +459,7 @@ $brand-color: #1E3A5F;
   width: 100%;
   width: 100%;
   min-height: 60px;
   min-height: 60px;
   font-size: 14px;
   font-size: 14px;
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   line-height: 1.6;
   line-height: 1.6;
   background: transparent;
   background: transparent;
 }
 }
@@ -573,7 +609,7 @@ $brand-color: #1E3A5F;
   opacity: 0.9;
   opacity: 0.9;
 }
 }
 .btn-empty-add-text {
 .btn-empty-add-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 15px;
   font-size: 15px;
   font-weight: 600;
   font-weight: 600;
 }
 }
@@ -608,7 +644,7 @@ $brand-color: #1E3A5F;
 .type-tag {
 .type-tag {
   display: inline-flex;
   display: inline-flex;
   align-items: center;
   align-items: center;
-  background: #EBF2FA;
+  background: var(--color-bg-tag);
   border-radius: 6px;
   border-radius: 6px;
   padding: 3px 10px;
   padding: 3px 10px;
 }
 }
@@ -629,7 +665,7 @@ $brand-color: #1E3A5F;
 }
 }
 .card-checked-icon {
 .card-checked-icon {
   font-size: 13px;
   font-size: 13px;
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-weight: 700;
   font-weight: 700;
 }
 }
 .card-body {
 .card-body {
@@ -676,6 +712,12 @@ $brand-color: #1E3A5F;
   color: #D94A4A;
   color: #D94A4A;
 }
 }
 
 
+/* Self card */
+.self-card {
+  margin-bottom: 8px;
+  cursor: pointer;
+}
+
 /* ========== Upsell Banner ========== */
 /* ========== Upsell Banner ========== */
 .upsell-banner {
 .upsell-banner {
   background: linear-gradient(135deg, $brand-color, darken($brand-color, 4%));
   background: linear-gradient(135deg, $brand-color, darken($brand-color, 4%));
@@ -766,7 +808,7 @@ $brand-color: #1E3A5F;
   opacity: 0.9;
   opacity: 0.9;
 }
 }
 .btn-upgrade-text {
 .btn-upgrade-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 17px;
   font-size: 17px;
   font-weight: 700;
   font-weight: 700;
 }
 }

+ 5 - 2
client/pages/relations/number-analysis.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-number-analysis">
+  <view class="page-number-analysis" :class="themeClass">
     <!-- ========== Phone Input Section ========== -->
     <!-- ========== Phone Input Section ========== -->
     <view class="input-card">
     <view class="input-card">
       <text class="input-label">手机号码</text>
       <text class="input-label">手机号码</text>
@@ -79,6 +79,9 @@
 import { ref } from 'vue'
 import { ref } from 'vue'
 import { onShow } from '@dcloudio/uni-app'
 import { onShow } from '@dcloudio/uni-app'
 import requestInstance from '@/utils/api'
 import requestInstance from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const phoneNumber = ref('')
 const phoneNumber = ref('')
 const analyzing = ref(false)
 const analyzing = ref(false)
@@ -225,7 +228,7 @@ function formatDate(dateStr) {
   pointer-events: none;
   pointer-events: none;
 }
 }
 .btn-analyze-text {
 .btn-analyze-text {
-  color: var(--color-bg-card);
+  color: #FFFFFF;
   font-size: 16px;
   font-size: 16px;
   font-weight: 600;
   font-weight: 600;
 }
 }

+ 4 - 1
client/pages/withdraw/index.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <view class="page-withdraw">
+  <view class="page-withdraw" :class="themeClass">
     <!-- Balance card -->
     <!-- Balance card -->
     <view class="balance-card">
     <view class="balance-card">
       <text class="balance-label">可提现余额</text>
       <text class="balance-label">可提现余额</text>
@@ -44,6 +44,9 @@
 <script setup>
 <script setup>
 import { ref, computed, onMounted } from 'vue'
 import { ref, computed, onMounted } from 'vue'
 import { withdrawApi } from '@/utils/api'
 import { withdrawApi } from '@/utils/api'
+import { useTheme } from '@/composables/useThemeStyle'
+
+const { themeClass } = useTheme()
 
 
 const balance = ref(0)
 const balance = ref(0)
 const amount = ref('')
 const amount = ref('')