28 lines
1.1 KiB
Dart
28 lines
1.1 KiB
Dart
import '../models/message.dart';
|
|
|
|
class AIService {
|
|
static List<Message> mockChat(String userInput) {
|
|
String reply;
|
|
|
|
// 简单规则匹配
|
|
if (userInput.contains('活动') || userInput.contains('附近')) {
|
|
reply = '好的!我帮您查看附近的活动,您可以点击"活动广场"查看详情';
|
|
} else if (userInput.contains('挂号') || userInput.contains('医院')) {
|
|
reply = '挂号功能正在开发中,敬请期待!';
|
|
} else if (userInput.contains('买菜') || userInput.contains('购物')) {
|
|
reply = '生鲜配送功能正在开发中,敬请期待!';
|
|
} else if (userInput.contains('你好') || userInput.contains('您好')) {
|
|
reply = '您好!我是您的智能助手,有什么可以帮您的吗?';
|
|
} else if (userInput.contains('谢谢')) {
|
|
reply = '不客气!随时为您服务';
|
|
} else {
|
|
reply = '我理解您的意思了。目前我还在学习中,这个问题我会尽快帮您解决!';
|
|
}
|
|
|
|
return [
|
|
Message(text: userInput, isUser: true),
|
|
Message(text: reply, isUser: false),
|
|
];
|
|
}
|
|
}
|