From f99650a3b7073096c745071ccf50d6ba2393710a Mon Sep 17 00:00:00 2001
From: wangdongbo <949818794@qq.com>
Date: Fri, 23 Jan 2026 15:51:26 +0800
Subject: [PATCH 1/3] no message
---
pages/message/README.md | 95 +++++
pages/message/common-phrases.vue | 590 +++++++++++++++++++++++++++++++
2 files changed, 685 insertions(+)
create mode 100644 pages/message/README.md
create mode 100644 pages/message/common-phrases.vue
diff --git a/pages/message/README.md b/pages/message/README.md
new file mode 100644
index 0000000..4cf1f3c
--- /dev/null
+++ b/pages/message/README.md
@@ -0,0 +1,95 @@
+# 常用语功能说明
+
+## 功能概述
+在聊天页面添加了常用语功能,医生可以快速选择并发送预设的常用语内容。
+
+## 功能特性
+
+### 1. 常用语列表页面 (`common-phrases.vue`)
+- 支持分类管理(文字随访、语音随访、常用回复等)
+- 支持添加、编辑、删除常用语
+- 支持添加自定义分类
+- 点击常用语直接发送到聊天
+
+### 2. 聊天输入框集成
+- 在聊天输入框的"更多"面板中添加"常用语"入口
+- 点击后跳转到常用语列表页面
+- 选择常用语后自动返回并发送
+
+### 3. 数据持久化
+- 常用语数据存储在MongoDB的`common-words`集合中
+- 支持机构级别和个人级别的常用语
+- 与PC端管理后台数据互通
+
+## 文件结构
+
+```
+ykt-wx-app/pages/message/
+├── common-phrases.vue # 常用语列表页面
+├── components/
+│ └── chat-input.vue # 聊天输入框组件(已更新)
+├── index.vue # 聊天主页面(已更新)
+└── README.md # 本文档
+
+ykt-wx-app/utils/
+└── api.js # API配置(已添加常用语接口)
+
+ytk-customer-service/knowledgeBase/common-words/
+└── index.js # 后端常用语接口(已添加小程序接口)
+```
+
+## API接口
+
+### 1. 获取常用语列表
+```javascript
+api('getCommonPhrases', { corpId })
+```
+
+### 2. 保存常用语
+```javascript
+api('saveCommonPhrase', {
+ id, // 可选,更新时传入
+ corpId,
+ userId,
+ categoryId,
+ content
+})
+```
+
+### 3. 删除常用语
+```javascript
+api('deleteCommonPhrase', {
+ id,
+ corpId
+})
+```
+
+### 4. 获取分类列表
+```javascript
+api('getCommonPhraseCategories', { corpId })
+```
+
+### 5. 保存分类
+```javascript
+api('saveCommonPhraseCategory', {
+ corpId,
+ userId,
+ name
+})
+```
+
+## 使用流程
+
+1. 用户在聊天页面点击输入框右侧的"+"按钮
+2. 在弹出的功能面板中点击"常用语"
+3. 跳转到常用语列表页面
+4. 可以切换分类查看不同类型的常用语
+5. 点击任意常用语,自动返回聊天页面并发送该内容
+6. 在编辑模式下可以添加、编辑、删除常用语
+
+## 注意事项
+
+1. 常用语功能需要用户已登录并有有效的corpId
+2. 如果后端API调用失败,会使用本地模拟数据
+3. 常用语内容最多500字
+4. 分类名称最多6个字
diff --git a/pages/message/common-phrases.vue b/pages/message/common-phrases.vue
new file mode 100644
index 0000000..5d26818
--- /dev/null
+++ b/pages/message/common-phrases.vue
@@ -0,0 +1,590 @@
+
+
+
+
+
+
+ {{ category.name }}
+
+
+ +
+ 加分类
+
+
+
+
+
+ {{ phrase.content }}
+
+ 编辑
+ 删除
+
+
+
+
+
+ 暂无常用语
+
+
+
+
+ +
+ 添加快捷回复
+
+
+
+
+
+
+
+
+
+
+
+
+
From 8ddeb572d435b3cb246dd4e05db8982a2f69fe84 Mon Sep 17 00:00:00 2001
From: wangdongbo <949818794@qq.com>
Date: Fri, 23 Jan 2026 16:09:34 +0800
Subject: [PATCH 2/3] no message
---
App.vue | 734 ++++++++++++------------
pages.json | 6 +
pages/message/common-phrases.vue | 285 +++++----
pages/message/components/chat-input.vue | 57 +-
pages/message/index.vue | 16 +
static/icon/icon-chinese-rx.png | Bin 4406 -> 0 bytes
static/icon/icon-western-rx.png | Bin 3880 -> 0 bytes
static/icon/kaichufang.png | Bin 1346 -> 0 bytes
static/icon/kaizhongyao.png | Bin 1288 -> 0 bytes
static/icon/quxiaobingtuikuan.png | Bin 3930 -> 0 bytes
utils/api.js | 7 +-
11 files changed, 635 insertions(+), 470 deletions(-)
delete mode 100644 static/icon/icon-chinese-rx.png
delete mode 100644 static/icon/icon-western-rx.png
delete mode 100644 static/icon/kaichufang.png
delete mode 100644 static/icon/kaizhongyao.png
delete mode 100644 static/icon/quxiaobingtuikuan.png
diff --git a/App.vue b/App.vue
index bffc016..1010425 100644
--- a/App.vue
+++ b/App.vue
@@ -1,365 +1,369 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 4e9ea8a..a97b558 100644
--- a/pages.json
+++ b/pages.json
@@ -13,6 +13,12 @@
"enablePullDownRefresh": false
}
},
+ {
+ "path": "pages/message/common-phrases",
+ "style": {
+ "navigationBarTitleText": "常用语"
+ }
+ },
{
"path": "pages/case/case",
"style": {
diff --git a/pages/message/common-phrases.vue b/pages/message/common-phrases.vue
index 5d26818..39a22a3 100644
--- a/pages/message/common-phrases.vue
+++ b/pages/message/common-phrases.vue
@@ -1,61 +1,95 @@
-
+
+
+
-
-
- {{ category.name }}
-
-
- +
- 加分类
-
-
-
-
-
- {{ phrase.content }}
-
- 编辑
- 删除
+
+ 快捷回复
+
+
+ {{ isEditMode ? '完成' : '编辑' }}
-
-
-
- 暂无常用语
-
-
+
-
- +
- 添加快捷回复
+
+
+
+
+
+
+
+
+
+
+ {{ phrase.content }}
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+ 暂无常用语
+ 点击上方按钮添加常用语
+
+
+