From ea9535be7b314618a226665b2025e78f76074e0d Mon Sep 17 00:00:00 2001
From: wangdongbo <>
Date: Fri, 7 Aug 2026 09:35:21 +0800
Subject: [PATCH] =?UTF-8?q?=E5=92=A8=E8=AF=A2=E5=8A=A9=E7=90=86=E5=8A=9F?=
=?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 30 +++++--
pages/ai-consult/chat.vue | 158 +++++++++++++++++++++++++++++++++++++
pages/ai-consult/entry.vue | 12 +++
pages/ai-consult/list.vue | 40 ++++++++++
pages/home/consult.vue | 37 +++++++--
utils/api.js | 7 ++
6 files changed, 270 insertions(+), 14 deletions(-)
create mode 100644 pages/ai-consult/chat.vue
create mode 100644 pages/ai-consult/entry.vue
create mode 100644 pages/ai-consult/list.vue
diff --git a/pages.json b/pages.json
index b2d702d..e47d85e 100644
--- a/pages.json
+++ b/pages.json
@@ -136,8 +136,8 @@
}
]
},
- {
- "root": "pages/rate",
+ {
+ "root": "pages/rate",
"name": "rate",
"pages": [
{
@@ -154,10 +154,28 @@
"disableScroll": true
}
}
- ]
- },
- {
- "root": "pages/archive",
+ ]
+ },
+ {
+ "root": "pages/ai-consult",
+ "name": "ai-consult",
+ "pages": [
+ {
+ "path": "list",
+ "style": { "navigationBarTitleText": "AI咨询记录", "disableScroll": true }
+ },
+ {
+ "path": "chat",
+ "style": { "navigationBarTitleText": "AI咨询助理", "disableScroll": true }
+ },
+ {
+ "path": "entry",
+ "style": { "navigationBarTitleText": "AI咨询助理", "disableScroll": true }
+ }
+ ]
+ },
+ {
+ "root": "pages/archive",
"name": "archive",
"pages": [
{
diff --git a/pages/ai-consult/chat.vue b/pages/ai-consult/chat.vue
new file mode 100644
index 0000000..ba7793f
--- /dev/null
+++ b/pages/ai-consult/chat.vue
@@ -0,0 +1,158 @@
+
+
+
+
+
+ {{ formatMessageTime(item.createTime) }}
+ {{ displayContent(item) }}
+
+
+ AI
+
+ {{ session?.assistantName || 'AI咨询助理' }}
+
+ {{ displayContent(item) }}
+
+ 发送失败,请重试
+
+ 我
+
+
+
+ AI{{ session?.assistantName || 'AI咨询助理' }}
+
+
+
+
+
+
+
+
+ 本次AI咨询已结束
+
+
+
+
+
+
diff --git a/pages/ai-consult/entry.vue b/pages/ai-consult/entry.vue
new file mode 100644
index 0000000..22a2352
--- /dev/null
+++ b/pages/ai-consult/entry.vue
@@ -0,0 +1,12 @@
+请选择本次咨询档案{{item.name || '未命名'}}{{ item.age ? item.age + '岁' : '' }}正在进入AI咨询...
+
diff --git a/pages/ai-consult/list.vue b/pages/ai-consult/list.vue
new file mode 100644
index 0000000..ea7768c
--- /dev/null
+++ b/pages/ai-consult/list.vue
@@ -0,0 +1,40 @@
+
+
+
+
+ {{ item.name }}
+
+
+
+
+
+ {{ item.assistantName }}{{ statusText(item) }}
+ 团队:{{ item.teamName || item.teamId || '-' }}
+ 档案:{{ item.customerName || '-' }}
+ 最近互动:{{ format(item.lastActiveTime) }}
+ 已触发敏感词
+
+
+
+
+
+
diff --git a/pages/home/consult.vue b/pages/home/consult.vue
index 5941631..55171e2 100644
--- a/pages/home/consult.vue
+++ b/pages/home/consult.vue
@@ -49,6 +49,7 @@ const props = defineProps({
const { account } = storeToRefs(useAccount());
const consultantPopup = ref(null);
const badgeMap = ref({});
+const aiConsultEnabled = ref(false);
let loading = false;
const consultItems = ref([
@@ -80,6 +81,12 @@ const consultItems = ref([
path: "/pages/rate/rate-list",
badge: 'rate'
},
+ {
+ id: "aiConsultRecord",
+ label: "AI咨询记录",
+ icon: "/static/home/chat-consult.png",
+ path: "/pages/ai-consult/list",
+ },
]);
const hideMenus = computed(() => {
const result = {};
@@ -87,6 +94,7 @@ const hideMenus = computed(() => {
if (!(props.team && props.team.createSource === 'yzs')) {
result.chat = true;
}
+ if (!aiConsultEnabled.value) result.aiConsultRecord = true;
return result;
})
@@ -191,8 +199,15 @@ async function getBadgeCount() {
loading = false;
}
+async function loadAiConsultPermission() {
+ if (!props.corpId) return;
+ const res = await api('getAiConsultPermission', { corpId: props.corpId }, false);
+ aiConsultEnabled.value = Boolean(res?.success && res?.data?.enabled);
+}
+
watch(() => [props.customers, props.teamId, props.corpId], n => {
getBadgeCount()
+ loadAiConsultPermission()
}, { immediate: true })
defineExpose({
@@ -216,23 +231,26 @@ defineExpose({
}
.consult-grid {
- height: 208rpx;
+ min-height: 208rpx;
box-sizing: border-box;
background: #fff;
border-radius: 16rpx;
- padding: 24rpx 30rpx;
+ padding: 26rpx 22rpx;
display: grid;
grid-template-columns: repeat(4, 1fr);
- align-items: center;
- gap: 32rpx;
+ grid-auto-rows: 120rpx;
+ align-items: start;
+ column-gap: 0;
+ row-gap: 24rpx;
box-shadow: 0 8rpx 10rpx 0 rgba(60, 169, 145, 0.06);
}
.consult-item {
+ min-width: 0;
display: flex;
flex-direction: column;
align-items: center;
- gap: 12rpx;
+ gap: 10rpx;
cursor: pointer;
}
@@ -242,7 +260,7 @@ defineExpose({
.item-icon {
width: 80rpx;
- height: 80;
+ height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
@@ -270,9 +288,12 @@ defineExpose({
}
.item-label {
- font-size: 30rpx;
- color: #666d76;
+ max-width: 100%;
+ color: #596273;
+ font-size: 26rpx;
+ line-height: 36rpx;
text-align: center;
font-weight: 400;
+ white-space: nowrap;
}
diff --git a/utils/api.js b/utils/api.js
index 727f007..1daba3e 100644
--- a/utils/api.js
+++ b/utils/api.js
@@ -20,6 +20,13 @@ const urlsConfig = {
recordBusinessCardBehavior: 'recordBusinessCardBehavior',
getJoinedTeams: 'getJoinedTeams',
getCorpBusinessCardStatus: 'getCorpBusinessCardStatus',
+ getAiConsultPermission: 'getAiConsultPermission',
+ getAiConsultAssistants: 'getAiConsultAssistants',
+ getAiConsultSessions: 'getAiConsultSessions',
+ getAiConsultSessionDetail: 'getAiConsultSessionDetail',
+ openAiConsultSession: 'openAiConsultSession',
+ sendAiConsultMessage: 'sendAiConsultMessage',
+ closeAiConsultSession: 'closeAiConsultSession',
},
knowledgeBase: {