feat: add customer service agent entry in Settings
- "天工客服" agent (ID: 3490efa8) created on backend, status: published - Settings > Account section now has "联系客服" button - Tap navigates to chat with the CS agent directly Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,9 @@ import com.tiangong.aiagent.ui.settings.AboutScreen
|
||||
import com.tiangong.aiagent.ui.settings.AccountSecurityScreen
|
||||
import com.tiangong.aiagent.ui.settings.SettingsScreen
|
||||
|
||||
private const val CS_AGENT_ID = "3490efa8-330d-458d-a26e-0b6c1d72e6f4"
|
||||
private const val CS_AGENT_NAME = "天工客服"
|
||||
|
||||
object Routes {
|
||||
const val LOGIN = "login"
|
||||
const val REGISTER = "register"
|
||||
@@ -132,6 +135,9 @@ fun NavGraph(
|
||||
}
|
||||
|
||||
composable(Routes.SETTINGS) {
|
||||
val chatViewModel: ChatViewModel = hiltViewModel(
|
||||
navController.getBackStackEntry(Routes.CHAT)
|
||||
)
|
||||
SettingsScreen(
|
||||
onBack = { navController.popBackStack() },
|
||||
onLogout = {
|
||||
@@ -140,7 +146,16 @@ fun NavGraph(
|
||||
}
|
||||
},
|
||||
onNavigateToAbout = { navController.navigate(Routes.ABOUT) },
|
||||
onNavigateToAccountSecurity = { navController.navigate(Routes.ACCOUNT_SECURITY) }
|
||||
onNavigateToAccountSecurity = { navController.navigate(Routes.ACCOUNT_SECURITY) },
|
||||
onContactSupport = {
|
||||
val csAgent = Agent(
|
||||
id = CS_AGENT_ID,
|
||||
name = CS_AGENT_NAME,
|
||||
description = "天工智能体平台官方客服"
|
||||
)
|
||||
chatViewModel.switchAgent(csAgent)
|
||||
navController.popBackStack()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +171,7 @@ fun SettingsScreen(
|
||||
onLogout: () -> Unit,
|
||||
onNavigateToAbout: (() -> Unit)? = null,
|
||||
onNavigateToAccountSecurity: (() -> Unit)? = null,
|
||||
onContactSupport: (() -> Unit)? = null,
|
||||
viewModel: SettingsViewModel = hiltViewModel()
|
||||
) {
|
||||
var showLogoutDialog by remember { mutableStateOf(false) }
|
||||
@@ -227,6 +228,18 @@ fun SettingsScreen(
|
||||
)
|
||||
}
|
||||
|
||||
if (onContactSupport != null) {
|
||||
HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp))
|
||||
ListItem(
|
||||
headlineContent = { Text("联系客服") },
|
||||
supportingContent = { Text("有问题?随时联系我们") },
|
||||
leadingContent = {
|
||||
Icon(Icons.Default.Help, contentDescription = null)
|
||||
},
|
||||
modifier = Modifier.clickable { onContactSupport() }
|
||||
)
|
||||
}
|
||||
|
||||
HorizontalDivider(modifier = Modifier.padding(horizontal = 16.dp))
|
||||
|
||||
// Preferences section
|
||||
|
||||
Reference in New Issue
Block a user