Browse Source

update:page-crm-decision

0235664 3 days ago
parent
commit
8d8735cf1c

+ 3 - 0
ai-assisant/src/index.html

@@ -9,6 +9,9 @@
 </head>
 <body>
   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
+  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
+<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
+
   <app-page-crm-data></app-page-crm-data>
   <app-root></app-root>
 </body>

+ 1 - 0
ai-assisant/src/modules/crm/mobile/mobile.routes.ts

@@ -4,6 +4,7 @@ export const MOBILE_ROUTES: Routes = [
       {
         path: 'decision',
         loadComponent: () => import('./page-crm-decision/page-crm-decision').then(m => m.PageCrmDecision)
+        
       },
       {
         path: 'training',

+ 1 - 1
ai-assisant/src/modules/crm/mobile/page-crm-data/page-crm-data.scss

@@ -549,7 +549,7 @@
     color: $text-dark;
     margin-bottom: 8px;
     background: linear-gradient(90deg, #3367d6, #4285f4);
-    -webkit-background-clip: text;
+    //webkit-background-clip: text;
     -webkit-text-fill-color: transparent;
     position: relative;
     display: inline-block;

+ 162 - 1
ai-assisant/src/modules/crm/mobile/page-crm-decision/page-crm-decision.html

@@ -1 +1,162 @@
-<p>page-crm-decision works!</p>
+<div class="container">
+    <!-- 顶部导航 -->
+    <header class="app-header">
+      <div class="header-title">
+        <i class="fas fa-robot"></i>
+        <h1>话术决策助手</h1>
+      </div>
+    </header>
+    
+    <!-- 场景选择 -->
+    <section class="scene-selector">
+      <h2 class="input-title">
+        <i class="fas fa-dharmachakra"></i>
+        选择对话场景
+      </h2>
+      <div class="scene-options">
+        <div class="scene-option" [class.active]="selectedScene === 'first-contact'" 
+            (click)="selectScene('first-contact')">
+          <i class="fas fa-handshake"></i>
+          <h3>首次接触</h3>
+          <p>初次沟通建立信任</p>
+        </div>
+        <div class="scene-option" [class.active]="selectedScene === 'deep-talk'" 
+            (click)="selectScene('deep-talk')">
+          <i class="fas fa-comments"></i>
+          <h3>深度交流</h3>
+          <p>深入挖掘客户需求</p>
+        </div>
+      </div>
+    </section>
+    
+    <!-- 客户对话分析 -->
+    <section class="input-area">
+      <h2 class="chat-title">
+        <i class="fas fa-comments"></i>
+        客户对话分析
+      </h2>
+      <div class="chat-area" #chatContainer>
+        <div *ngFor="let msg of messages" class="chat-message" 
+            [class.customer-message]="msg.role === 'customer'"
+            [class.assistant-message]="msg.role === 'assistant'">
+          <div class="message-header" [class.customer-header]="msg.role === 'customer'"
+               [class.assistant-header]="msg.role === 'assistant'">
+            <div class="icon">
+              <i *ngIf="msg.role === 'customer'" class="fas fa-user"></i>
+              <i *ngIf="msg.role === 'assistant'" class="fas fa-headset"></i>
+            </div>
+            <div>{{msg.role === 'customer' ? '客户' : '销售顾问'}}</div>
+          </div>
+          <div class="message-content">{{msg.content}}</div>
+          <div class="message-time">{{msg.time}}</div>
+        </div>
+      </div>
+      
+      <!-- 客户标签编辑区 -->
+      <div class="tags-area">
+        <div class="tags-header">
+          <div class="tags-title">客户标签</div>
+          <div class="add-tag" (click)="addTag()">
+            <i class="fas fa-plus"></i>
+            <span>添加标签</span>
+          </div>
+        </div>
+        <div class="input-tags">
+          <div *ngFor="let tag of tags" class="tag" [style.background]="tag.background" 
+              [style.color]="tag.color">
+            <i [class]="tag.icon"></i>
+            <span>{{tag.text}}</span>
+            <span class="delete" (click)="removeTag($event, tag)">
+              <i class="fas fa-times"></i>
+            </span>
+          </div>
+        </div>
+      </div>
+    </section>
+    
+    <!-- 输入工作区 -->
+    <section class="input-area">
+      <h2 class="input-title">
+        <i class="fas fa-comment-dots"></i>
+        输入对话内容
+      </h2>
+      
+      <div class="role-selector">
+        <div class="role-btn" [class.active]="currentRole === 'customer'" 
+            (click)="setRole('customer')">客户消息</div>
+        <div class="role-btn" [class.active]="currentRole === 'assistant'" 
+            (click)="setRole('assistant')">销售回复</div>
+      </div>
+      
+      <div class="input-field">
+        <textarea class="text-input" placeholder="输入对话内容..." [(ngModel)]="newMessage" (keydown)="handleKeydown($event)"> <!-- 修改这里 -->
+        </textarea>
+            
+      </div>
+      
+      <div class="action-buttons">
+        <div class="action-btn save-btn" (click)="sendMessage()">
+          <i class="fas fa-paper-plane"></i>
+          <span>发送消息</span>
+        </div>
+      </div>
+    </section>
+    
+    <!-- 策略卡片组 -->
+    <section class="strategy-area">
+      <h2 class="strategy-title">
+        <i class="fas fa-cards"></i>
+        {{sceneTitle}} - 推荐应对策略
+      </h2>
+      <div class="cards-container">
+        <div *ngFor="let strategy of strategies; let i = index" 
+            class="strategy-card"
+            [class.card-aggressive]="strategy.type === 'aggressive'"
+            [class.card-neutral]="strategy.type === 'neutral'"
+            [class.card-conservative]="strategy.type === 'conservative'"
+            [style.transform]="getCardTransform(i)"
+            [style.zIndex]="getCardZIndex(i)"
+            (click)="activateCard(i)">
+          <div class="card-header">
+            <div class="card-title">{{strategy.title}}</div>
+            <div class="card-icon" [style.background]="strategy.iconBg" 
+                [style.color]="strategy.iconColor">
+              <i [class]="strategy.icon"></i>
+            </div>
+          </div>
+          <div class="card-content">
+            <p>{{strategy.description}}</p>
+            <div class="card-highlight">
+              {{strategy.highlight}}
+            </div>
+            <p><strong>适用场景:</strong>{{strategy.applicable}}</p>
+            <p><strong>优势:</strong>{{strategy.advantage}}</p>
+          </div>
+          <div class="card-footer">
+            <div class="card-hint">成功率: {{strategy.successRate}}</div>
+            <div class="card-hint"><i class="fas fa-clock"></i> 推荐指数: {{strategy.rating}}</div>
+          </div>
+        </div>
+      </div>
+      
+      <!-- 卡片导航点 -->
+      <div class="card-navigation">
+        <div *ngFor="let strategy of strategies; let i = index" 
+            class="card-nav-btn" 
+            [class.active]="activeCardIndex === i"
+            (click)="activateCard(i)"></div>
+      </div>
+      
+      <!-- 操作按钮 -->
+      <div class="action-buttons">
+        <div class="action-btn save-btn" (click)="saveRecord()">
+          <i class="fas fa-save"></i>
+          <span>保存记录</span>
+        </div>
+        <div class="action-btn history-btn" (click)="viewHistory()">
+          <i class="fas fa-history"></i>
+          <span>查看历史</span>
+        </div>
+      </div>
+    </section>
+  </div>

+ 550 - 0
ai-assisant/src/modules/crm/mobile/page-crm-decision/page-crm-decision.scss

@@ -0,0 +1,550 @@
+:host {
+    display: block;
+    background-color: #f0f5ff;
+    color: var(--dark);
+    line-height: 1.6;
+    overflow-x: hidden;
+    background: linear-gradient(135deg, #e6f0ff 0%, #f5f9ff 100%);
+    min-height: 100vh;
+    padding: 20px 0;
+  }
+  
+  /* 变量定义 */
+  :root {
+    --primary: #64a0ff;
+    --primary-light: rgba(100, 160, 255, 0.1);
+    --dark: #0a192f;
+    --dark-light: #112240;
+    --gray: #8892b0;
+    --light-gray: #f8f9fa;
+    --white: #ffffff;
+    --blue: #64a0ff;
+    --blue-light: rgba(100, 160, 255, 0.15);
+    --yellow: #ffd43b;
+    --orange: #ff922b;
+    --purple: #9c36b5;
+    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
+    --shadow-primary: 0 4px 20px rgba(100, 160, 255, 0.2);
+  }
+  
+  /* 基础样式 */
+  * {
+    margin: 0;
+    padding: 0;
+    box-sizing: border-box;
+    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
+  }
+  
+  /* 容器样式 */
+  .container {
+    max-width: 480px;
+    margin: 0 auto;
+    padding: 0 16px 30px;
+    position: relative;
+  }
+  
+  /* 顶部导航 */
+  .app-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    padding: 15px 0;
+    margin-bottom: 15px;
+    border-bottom: 1px solid rgba(10, 25, 47, 0.05);
+  }
+  
+  .header-title {
+    font-size: 22px;
+    font-weight: 700;
+    color: var(--dark);
+    display: flex;
+    align-items: center;
+    gap: 10px;
+  }
+  
+  .header-title i {
+    color: var(--primary);
+    background: var(--primary-light);
+    width: 36px;
+    height: 36px;
+    border-radius: 10px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+  }
+  
+  /* 场景选择 */
+  .scene-selector {
+    background: var(--white);
+    border-radius: 20px;
+    padding: 20px;
+    margin-bottom: 20px;
+    box-shadow: var(--shadow);
+    position: relative;
+    overflow: hidden;
+    border: 1px solid rgba(100, 160, 255, 0.2);
+  }
+  
+  .scene-options {
+    display: flex;
+    gap: 15px;
+    margin-top: 10px;
+  }
+  
+  .scene-option {
+    flex: 1;
+    padding: 15px;
+    border-radius: 15px;
+    background: var(--light-gray);
+    text-align: center;
+    cursor: pointer;
+    transition: all 0.3s ease;
+    border: 1px solid rgba(100, 160, 255, 0.1);
+  }
+  
+  .scene-option.active {
+    background: var(--primary-light);
+    border-color: var(--primary);
+    box-shadow: var(--shadow-primary);
+  }
+  
+  .scene-option i {
+    font-size: 28px;
+    margin-bottom: 10px;
+    color: var(--primary);
+  }
+  
+  .scene-option h3 {
+    font-size: 16px;
+    margin-bottom: 5px;
+  }
+  
+  .scene-option p {
+    font-size: 13px;
+    color: var(--gray);
+  }
+  
+  /* 对话聊天区 */
+  .chat-area {
+    background: var(--white);
+    border-radius: 20px;
+    padding: 20px;
+    margin-bottom: 20px;
+    box-shadow: var(--shadow);
+    height: 350px;
+    overflow-y: auto;
+    display: flex;
+    flex-direction: column;
+    gap: 15px;
+    border: 1px solid rgba(100, 160, 255, 0.2);
+  }
+  
+  .chat-title, .input-title, .strategy-title {
+    font-size: 18px;
+    font-weight: 600;
+    margin-bottom: 15px;
+    color: var(--dark);
+    display: flex;
+    align-items: center;
+    gap: 10px;
+    padding-bottom: 10px;
+    border-bottom: 1px solid rgba(100, 160, 255, 0.1);
+  }
+  
+  .chat-title i, .input-title i, .strategy-title i {
+    color: var(--primary);
+  }
+  
+  .chat-message {
+    max-width: 85%;
+    padding: 14px 18px;
+    border-radius: 18px;
+    position: relative;
+    animation: fadeIn 0.3s ease;
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
+  }
+  
+  @keyframes fadeIn {
+    from { opacity: 0; transform: translateY(10px); }
+    to { opacity: 1; transform: translateY(0); }
+  }
+  
+  .customer-message {
+    background: linear-gradient(135deg, #e6f0ff, #ebf2ff);
+    align-self: flex-start;
+    border-bottom-left-radius: 5px;
+    border-left: 3px solid var(--blue);
+  }
+  
+  .assistant-message {
+    background: linear-gradient(135deg, #e6f7ff, #ebf9ff);
+    border: 1px solid rgba(100, 160, 255, 0.3);
+    align-self: flex-end;
+    border-bottom-right-radius: 5px;
+    border-right: 3px solid var(--primary);
+  }
+  
+  .message-header {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+    margin-bottom: 8px;
+    font-weight: 600;
+  }
+  
+  .customer-header .icon {
+    background: var(--blue-light);
+    color: var(--blue);
+  }
+  
+  .assistant-header .icon {
+    background: var(--primary-light);
+    color: var(--primary);
+  }
+  
+  .message-header .icon {
+    width: 28px;
+    height: 28px;
+    border-radius: 8px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 14px;
+  }
+  
+  .message-content {
+    line-height: 1.5;
+  }
+  
+  .message-time {
+    font-size: 11px;
+    color: var(--gray);
+    margin-top: 8px;
+    text-align: right;
+  }
+  
+  /* 客户标签编辑区 */
+  .tags-area {
+    background: var(--light-gray);
+    border-radius: 15px;
+    padding: 15px;
+    margin-top: 10px;
+    border: 1px solid rgba(100, 160, 255, 0.1);
+  }
+  
+  .tags-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 10px;
+  }
+  
+  .tags-title {
+    font-size: 14px;
+    font-weight: 600;
+    color: var(--dark);
+  }
+  
+  .input-tags {
+    display: flex;
+    gap: 8px;
+    flex-wrap: wrap;
+  }
+  
+  .tag {
+    background: var(--primary-light);
+    color: var(--primary);
+    padding: 6px 12px 6px 8px;
+    border-radius: 20px;
+    font-size: 13px;
+    display: flex;
+    align-items: center;
+    gap: 5px;
+    cursor: pointer;
+    transition: all 0.2s ease;
+    border: 1px solid rgba(100, 160, 255, 0.2);
+  }
+  
+  .tag:hover {
+    background: rgba(100, 160, 255, 0.3);
+  }
+  
+  .tag .delete {
+    font-size: 12px;
+    margin-left: 5px;
+    opacity: 0.7;
+  }
+  
+  .tag .delete:hover {
+    opacity: 1;
+  }
+  
+  .add-tag {
+    background: rgba(136, 146, 176, 0.1);
+    color: var(--gray);
+    padding: 6px 12px;
+    border-radius: 20px;
+    font-size: 13px;
+    display: flex;
+    align-items: center;
+    gap: 5px;
+    cursor: pointer;
+    transition: all 0.2s ease;
+  }
+  
+  .add-tag:hover {
+    background: rgba(136, 146, 176, 0.2);
+  }
+  
+  /* 输入工作区 */
+  .input-area {
+    background: var(--white);
+    border-radius: 20px;
+    padding: 20px;
+    margin-bottom: 20px;
+    box-shadow: var(--shadow);
+    border: 1px solid rgba(100, 160, 255, 0.2);
+  }
+  
+  .role-selector {
+    display: flex;
+    background: var(--light-gray);
+    border-radius: 12px;
+    padding: 4px;
+    margin-bottom: 15px;
+  }
+  
+  .role-btn {
+    flex: 1;
+    padding: 10px;
+    text-align: center;
+    border-radius: 10px;
+    cursor: pointer;
+    transition: all 0.3s ease;
+    font-weight: 500;
+  }
+  
+  .role-btn.active {
+    background: var(--white);
+    box-shadow: var(--shadow);
+    color: var(--primary);
+  }
+  
+  .input-field {
+    position: relative;
+  }
+  
+  .text-input {
+    width: 100%;
+    height: 120px;
+    padding: 15px;
+    border-radius: 15px;
+    border: 1px solid rgba(136, 146, 176, 0.2);
+    background: var(--light-gray);
+    resize: none;
+    font-size: 16px;
+    color: var(--dark);
+    transition: all 0.3s ease;
+  }
+  
+  .text-input:focus {
+    outline: none;
+    border-color: var(--primary);
+    box-shadow: 0 0 0 2px rgba(100, 160, 255, 0.2);
+  }
+  
+  /* 策略卡片组 */
+  .strategy-area {
+    margin-bottom: 25px;
+  }
+  
+  .cards-container {
+    position: relative;
+    height: 320px;
+    perspective: 1000px;
+  }
+  
+  .strategy-card {
+    position: absolute;
+    width: 100%;
+    height: 280px;
+    border-radius: 20px;
+    padding: 25px;
+    box-shadow: var(--shadow);
+    display: flex;
+    flex-direction: column;
+    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), 
+                opacity 0.4s ease, 
+                box-shadow 0.3s ease;
+    backface-visibility: hidden;
+    cursor: pointer;
+    border: 1px solid rgba(100, 160, 255, 0.2);
+  }
+  
+  .card-aggressive {
+    background: linear-gradient(135deg, #eef6ff, #f0f8ff);
+    border-top: 4px solid var(--blue);
+    z-index: 30;
+  }
+  
+  .card-neutral {
+    background: linear-gradient(135deg, #fff9e6, #fffbf0);
+    border-top: 4px solid var(--yellow);
+    transform: translateY(20px) scale(0.95);
+    z-index: 20;
+  }
+  
+  .card-conservative {
+    background: linear-gradient(135deg, #f9f0ff, #fdf5ff);
+    border-top: 4px solid var(--purple);
+    transform: translateY(40px) scale(0.9);
+    z-index: 10;
+  }
+  
+  .card-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 20px;
+  }
+  
+  .card-title {
+    font-size: 18px;
+    font-weight: 700;
+  }
+  
+  .card-icon {
+    width: 40px;
+    height: 40px;
+    border-radius: 12px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    font-size: 18px;
+  }
+  
+  .card-content {
+    flex: 1;
+    overflow-y: auto;
+    padding-right: 10px;
+  }
+  
+  .card-content p {
+    margin-bottom: 15px;
+    line-height: 1.7;
+    color: #333;
+  }
+  
+  .card-highlight {
+    background: rgba(10, 25, 47, 0.05);
+    padding: 12px 15px;
+    border-radius: 12px;
+    border-left: 3px solid var(--primary);
+    margin: 15px 0;
+    font-weight: 500;
+    line-height: 1.6;
+  }
+  
+  .card-footer {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-top: 15px;
+    padding-top: 15px;
+    border-top: 1px solid rgba(136, 146, 176, 0.1);
+  }
+  
+  .card-hint {
+    font-size: 14px;
+    color: var(--gray);
+  }
+  
+  /* 卡片导航点 */
+  .card-navigation {
+    display: flex;
+    justify-content: center;
+    gap: 10px;
+    margin-top: 15px;
+  }
+  
+  .card-nav-btn {
+    width: 12px;
+    height: 12px;
+    border-radius: 50%;
+    background: var(--light-gray);
+    cursor: pointer;
+    transition: all 0.2s ease;
+  }
+  
+  .card-nav-btn.active {
+    background: var(--primary);
+    transform: scale(1.2);
+  }
+  
+  /* 操作按钮 */
+  .action-buttons {
+    display: flex;
+    gap: 15px;
+    margin-top: 25px;
+  }
+  
+  .action-btn {
+    flex: 1;
+    height: 50px;
+    border-radius: 15px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    gap: 10px;
+    font-weight: 600;
+    cursor: pointer;
+    transition: all 0.3s ease;
+  }
+  
+  .save-btn {
+    background: var(--primary);
+    color: var(--dark);
+    border: none;
+    box-shadow: 0 4px 15px rgba(100, 160, 255, 0.3);
+  }
+  
+  .save-btn:hover {
+    transform: translateY(-2px);
+    box-shadow: 0 6px 20px rgba(100, 160, 255, 0.4);
+  }
+  
+  .history-btn {
+    background: var(--white);
+    color: var(--dark);
+    border: 2px solid var(--primary);
+    box-shadow: 0 4px 15px rgba(100, 160, 255, 0.1);
+  }
+  
+  .history-btn:hover {
+    transform: translateY(-2px);
+    box-shadow: 0 6px 20px rgba(100, 160, 255, 0.2);
+  }
+  
+  /* 响应式调整 */
+  @media (max-width: 380px) {
+    .container {
+      padding: 0 12px 25px;
+    }
+    
+    .scene-options {
+      flex-direction: column;
+    }
+    
+    .cards-container {
+      height: 300px;
+    }
+    
+    .strategy-card {
+      height: 260px;
+      padding: 20px;
+    }
+    
+    .chat-area {
+      height: 320px;
+    }
+  }

+ 262 - 6
ai-assisant/src/modules/crm/mobile/page-crm-decision/page-crm-decision.ts

@@ -1,11 +1,267 @@
-import { Component } from '@angular/core';
+import { 
+  Component, 
+  OnInit, 
+  ViewChild, 
+  ElementRef, 
+  AfterViewChecked 
+} from '@angular/core';
+import { FormsModule } from '@angular/forms';
+import { CommonModule } from '@angular/common';
+
+type SceneType = 'first-contact' | 'deep-talk';
+type MessageRole = 'customer' | 'assistant';
+
+interface Message {
+  role: MessageRole;
+  content: string;
+  time: string;
+}
+
+interface Tag {
+  text: string;
+  icon: string;
+  background: string;
+  color: string;
+}
+
+interface Strategy {
+  type: string;
+  title: string;
+  icon: string;
+  iconBg: string;
+  iconColor: string;
+  description: string;
+  highlight: string;
+  applicable: string;
+  advantage: string;
+  successRate: string;
+  rating: string;
+}
 
 @Component({
   selector: 'app-page-crm-decision',
-  imports: [],
+  standalone: true,
+  imports: [CommonModule, FormsModule],
   templateUrl: './page-crm-decision.html',
-  styleUrl: './page-crm-decision.scss'
+  styleUrls: ['./page-crm-decision.scss']
 })
-export class PageCrmDecision {
-
-}
+export class PageCrmDecision implements OnInit, AfterViewChecked {
+  @ViewChild('chatContainer') chatContainer!: ElementRef;
+  
+  
+  selectedScene: SceneType = 'first-contact';
+  sceneTitle = '首次接触';
+  
+  messages: Message[] = [
+    { role: 'customer', content: '您好,我对贵酒店的豪华套房很感兴趣,但觉得价格偏高,能否提供一些优惠?', time: '10:25 AM' },
+    { role: 'assistant', content: '感谢您对我们豪华套房的关注!我们的套房拥有全景海景和私人管家服务,目前预订可享8折优惠,您觉得如何?', time: '10:26 AM' },
+    { role: 'customer', content: '8折还是有点高,我看到其他酒店类似房型有更优惠的价格。', time: '10:27 AM' },
+    { role: 'assistant', content: '我理解您的考虑。我们的套房包含双人早餐和免费SPA体验,这些增值服务能让您的住宿体验更加完美。', time: '10:28 AM' },
+    { role: 'customer', content: '这个听起来不错,我考虑一下。', time: '10:29 AM' },
+    { role: 'assistant', content: '好的,如果您今天预订,我们还可以额外赠送您一次下午茶体验。', time: '10:30 AM' }
+  ];
+  
+  tags: Tag[] = [
+    { text: 'VIP客户', icon: 'fas fa-user', background: 'rgba(100, 160, 255, 0.15)', color: '#64a0ff' },
+    { text: '旺季时段', icon: 'fas fa-calendar', background: 'rgba(255, 212, 59, 0.15)', color: '#ffd43b' },
+    { text: '价格敏感', icon: 'fas fa-percent', background: 'rgba(156, 54, 181, 0.15)', color: '#9c36b5' }
+  ];
+  
+  currentRole: MessageRole = 'customer';
+  newMessage = '';
+  
+  strategies: Strategy[] = [
+    {
+      type: 'aggressive',
+      title: '主动型策略',
+      icon: 'fas fa-bolt',
+      iconBg: 'var(--blue-light)',
+      iconColor: 'var(--blue)',
+      description: '直接强调酒店独特价值,限量优惠制造紧迫感:',
+      highlight: '',
+      applicable: '客户表现出明确兴趣,决策周期短',
+      advantage: '快速成交,提升单笔订单价值',
+      successRate: '68%',
+      rating: '⭐⭐⭐⭐'
+    },
+    {
+      type: 'neutral',
+      title: '平衡型策略',
+      icon: 'fas fa-balance-scale',
+      iconBg: 'rgba(255, 212, 59, 0.15)',
+      iconColor: 'var(--yellow)',
+      description: '提供阶梯式优惠,引导客户选择:',
+      highlight: '',
+      applicable: '客户在多个选项间犹豫',
+      advantage: '平衡双方利益,建立长期关系',
+      successRate: '82%',
+      rating: '⭐⭐⭐⭐⭐'
+    },
+    {
+      type: 'conservative',
+      title: '保守型策略',
+      icon: 'fas fa-shield-alt',
+      iconBg: 'rgba(156, 54, 181, 0.15)',
+      iconColor: 'var(--purple)',
+      description: '提供灵活方案,降低决策风险:',
+      highlight: '',
+      applicable: '客户犹豫不决,决策周期长',
+      advantage: '降低客户风险感知,提高转化率',
+      successRate: '75%',
+      rating: '⭐⭐⭐⭐'
+    }
+  ];
+  
+  activeCardIndex = 0;
+  
+  private strategiesContent: Record<SceneType, { aggressive: string; neutral: string; conservative: string }> = {
+    "first-contact": {
+      aggressive: "主动介绍酒店特色和限时优惠,强调独特卖点",
+      neutral: "提供套餐选择,引导客户了解不同房型",
+      conservative: "邀请客户参观虚拟酒店,提供详细资料"
+    },
+    "deep-talk": {
+      aggressive: "深度挖掘客户需求,提供定制化解决方案",
+      neutral: "建立信任关系,分享成功案例和客户评价",
+      conservative: "提供专业建议,解答客户深层疑问"
+    }
+  };
+  
+  ngOnInit() {
+    this.updateStrategies();
+  }
+  
+  ngAfterViewChecked() {
+    this.scrollToBottom();
+  }
+  
+  scrollToBottom(): void {
+    try {
+      this.chatContainer.nativeElement.scrollTop = this.chatContainer.nativeElement.scrollHeight;
+    } catch (err) {
+      console.error(err);
+    }
+  }
+  
+  handleKeydown(event: KeyboardEvent): void {
+    if (event.key === 'Enter' && !event.shiftKey) {
+      event.preventDefault();
+      this.sendMessage();
+    }
+  }
+  onTextareaKeydown(event: KeyboardEvent): void {
+    if (event.key === 'Enter' && !event.shiftKey) {
+      event.preventDefault();
+      this.sendMessage();
+    }
+  }
+  
+  updateStrategies(): void {
+    const sceneStrategies = this.strategiesContent[this.selectedScene];
+    this.strategies[0].highlight = sceneStrategies.aggressive;
+    this.strategies[1].highlight = sceneStrategies.neutral;
+    this.strategies[2].highlight = sceneStrategies.conservative;
+  }
+  
+  selectScene(scene: SceneType): void {
+    this.selectedScene = scene;
+    this.sceneTitle = scene === 'first-contact' ? '首次接触' : '深度交流';
+    this.updateStrategies();
+  }
+  
+  setRole(role: MessageRole): void {
+    this.currentRole = role;
+  }
+  
+  addTag(): void {
+    const newTag: Tag = {
+      text: '新标签',
+      icon: 'fas fa-tag',
+      background: 'rgba(100, 160, 255, 0.15)',
+      color: '#64a0ff'
+    };
+    this.tags.push(newTag);
+  }
+  
+  removeTag(event: Event, tag: Tag): void {
+    event.stopPropagation();
+    this.tags = this.tags.filter(t => t !== tag);
+  }
+  
+  sendMessage(): void {
+    if (this.newMessage.trim()) {
+      const now = new Date();
+      const timeString = `${now.getHours()}:${now.getMinutes().toString().padStart(2, '0')}`;
+      
+      this.messages.push({
+        role: this.currentRole,
+        content: this.newMessage.trim(),
+        time: timeString
+      });
+      
+      this.newMessage = '';
+      
+      if (this.currentRole === 'assistant') {
+        setTimeout(() => {
+          this.simulateCustomerReply(now);
+        }, 1500);
+      }
+    }
+  }
+  
+  simulateCustomerReply(prevTime: Date): void {
+    const replies = [
+      "这个优惠包含早餐吗?",
+      "我需要和家人商量一下",
+      "能否提供免费接机服务?",
+      "价格还是有点高,能再优惠些吗?",
+      "你们的取消政策是怎样的?",
+      "如果我今天预订,还有额外优惠吗?",
+      "套餐包含哪些服务?",
+      "有更经济的房型推荐吗?"
+    ];
+    
+    const randomReply = replies[Math.floor(Math.random() * replies.length)];
+    const time = new Date(prevTime.getTime() + 60000); // 加1分钟
+    
+    this.messages.push({
+      role: 'customer',
+      content: randomReply,
+      time: `${time.getHours()}:${time.getMinutes().toString().padStart(2, '0')}`
+    });
+  }
+  
+  activateCard(index: number): void {
+    this.activeCardIndex = index;
+  }
+  
+  getCardTransform(index: number): string {
+    if (index === this.activeCardIndex) {
+      return 'translateY(0) scale(1)';
+    } else if (Math.abs(index - this.activeCardIndex) === 1) {
+      return `translateY(${20 * Math.abs(index - this.activeCardIndex)}px) scale(${1 - 0.05 * Math.abs(index - this.activeCardIndex)})`;
+    } else {
+      return `translateY(${40 * Math.abs(index - this.activeCardIndex)}px) scale(${1 - 0.1 * Math.abs(index - this.activeCardIndex)})`;
+    }
+  }
+  
+  getCardZIndex(index: number): string {
+    if (index === this.activeCardIndex) {
+      return '30';
+    } else if (Math.abs(index - this.activeCardIndex) === 1) {
+      return '20';
+    } else {
+      return '10';
+    }
+  }
+  
+  saveRecord(): void {
+    console.log('记录已保存');
+    // 这里可以添加实际的保存逻辑
+  }
+  
+  viewHistory(): void {
+    console.log('查看历史记录');
+    // 这里可以添加历史查看逻辑
+  }
+}