-imporve system
All checks were successful
Build Docker Image / Build Docker Image (push) Successful in 7m2s
Build Docker Image / Restart Docker Compose (push) Successful in 0s

+chatwidget
This commit is contained in:
2025-12-01 14:06:46 +07:00
parent f332f8b6e2
commit 9136619628
9 changed files with 173 additions and 4 deletions

View File

@@ -0,0 +1,36 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-chat-widget-component',
standalone: false,
templateUrl: './chat-widget-component.html',
styleUrl: './chat-widget-component.css',
})
export class ChatWidgetComponent {
isOpen = false;
newMessage = '';
messages = [
{ text: 'สวัสดีครับ มีอะไรให้ทีมงานช่วยเหลือไหมครับ? 👋', isUser: false },
];
toggleChat() {
this.isOpen = !this.isOpen;
}
sendMessage() {
if (this.newMessage.trim()) {
// 1. ใส่ข้อความเราลงไป
this.messages.push({ text: this.newMessage, isUser: true });
this.newMessage = '';
// 2. จำลองบอทตอบกลับ (Auto Reply Simulation)
setTimeout(() => {
this.messages.push({
text: 'ขอบคุณที่ติดต่อมาครับ ขณะนี้เจ้าหน้าที่กำลังติดลูกค้าท่านอื่น จะรีบตอบกลับให้เร็วที่สุดครับ',
isUser: false
});
}, 1000);
}
}
}