Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
74018c6
Merge branch 'develop' of https://github.com/Tencent/tdesign-miniprog…
zydemail Jan 13, 2026
cc31f47
Merge branch 'develop' of https://github.com/Tencent/tdesign-miniprog…
zydemail Jan 29, 2026
63da25a
Merge branch 'develop' of https://github.com/Tencent/tdesign-miniprog…
zydemail Feb 6, 2026
a550342
feat: 支持ChatThinking组件content插槽自定义思考内容
zydemail Feb 9, 2026
2fe84ce
Merge branch 'develop' of https://github.com/Tencent/tdesign-miniprog…
zydemail Feb 9, 2026
c98f5e4
refactor: 为内容内部视图添加空数组类名参数保持结构一致
zydemail Feb 9, 2026
26942df
Merge branch 'develop' of https://github.com/Tencent/tdesign-miniprog…
zydemail Feb 13, 2026
9703e49
Feature/add chat record (#4281)
zhangjiaoalice Feb 24, 2026
227be59
Merge branch 'feature/add-chat-record' of https://github.com/Tencent/…
zydemail Feb 24, 2026
0bc4adc
Feature/add uni record (#4318)
zhangjiaoalice Mar 10, 2026
1060cb4
Merge branch 'feature/add-chat-record' of https://github.com/Tencent/…
zydemail Mar 12, 2026
af11132
feat: 将senderType改为allowSpeech控制语音输入开关
zydemail Mar 13, 2026
e895c9b
feat: 统一插槽命名并完善语音输入相关文档与属性
zydemail Mar 13, 2026
7dbd4e0
Feature/add chat record (#4391)
zhangjiaoalice Apr 9, 2026
7e6f5ed
chat-record 组件更改
Apr 9, 2026
3262ad9
Merge branch develop into feature/refactor-chat-record
zhangjiaoalice Apr 13, 2026
7e9a649
fix(chat-record): 组件问题修复
zhangjiaoalice Apr 20, 2026
aec8be5
feat: 新增聊天发送示例并重构语音记录组件
zydemail Apr 30, 2026
63873f4
fix: chat-record demo 样式调整
zhangjiaoalice May 6, 2026
fd0bbc1
style(chat-record): 调整 chat-record 示例样式
zhangjiaoalice May 9, 2026
d08d906
style(chat-record): 调整 chat-record 示例样式
zhangjiaoalice May 9, 2026
4415c6e
style(chat-sender): sender 组件record 示例样式调整
zhangjiaoalice May 11, 2026
2f5f60a
style(chat-record): 语言输入组件样式调整
zhangjiaoalice May 13, 2026
efab764
feat(chat-record): chat-record demo 重构
zhangjiaoalice May 14, 2026
ae46a2c
feat(chat-record): chat-record 组件国际化处理
zhangjiaoalice May 14, 2026
c437316
chore: 移除手动发送逻辑并自动发送识别文本,
zydemail May 15, 2026
bcf783f
style(chat-record): chat-record demo 样式调整
zhangjiaoalice May 29, 2026
4d7b27e
style(chat-record): chat-record demo 动效调整
zhangjiaoalice May 29, 2026
9d0671c
Merge branch 'feature/add-chat-record-new' of https://github.com/Tenc…
zydemail May 29, 2026
40a7ebc
feat: 代码优化
zydemail Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .kuai.yaml
Empty file.
33 changes: 25 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,29 @@
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.words": [
"stylelint",
"cascader",
"tdesign",
"uniapp",
"backtop",
"miniprogram"
]
"cSpell.words": ["stylelint", "cascader", "tdesign", "uniapp", "backtop", "miniprogram"],
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash"
},
"zsh": {
"path": "zsh"
},
"fish": {
"path": "fish"
},
"tmux": {
"path": "tmux",
"icon": "terminal-tmux"
},
"pwsh": {
"path": "pwsh",
"icon": "terminal-powershell"
},
"supercode-sh": {
"path": "/bin/zsh",
"args": ["-l"]
}
}
}
16 changes: 16 additions & 0 deletions packages/components/locale/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,22 @@ export default {
sendText: 'send',
stopText: 'stop',
},
chatRecord: {
holdToTalk: 'Hold to talk',
requestAuth: 'Please authorize microphone permission',
releaseToCancel: 'Release to cancel',
releaseToSend: 'Release to send, swipe up to cancel',
cancelText: 'Cancel',
sendText: 'Send',
busyTip: 'Recognizing, please wait...',
recognizeFailTip: 'Voice recognition failed, please try again',
missingPluginTip: 'Missing voice recognition plugin WechatSI',
authSettingFail: 'Failed to get recording permission settings',
openSettingFail: 'Failed to open settings',
systemMicTitle: 'Cannot use microphone',
systemMicContent:
'It is detected that the microphone permission of "WeChat" has been disabled in the system.\n\nPlease enable it in system settings:\n- iOS: Settings > WeChat > Microphone\n- Android: Settings > Apps > WeChat > Permissions > Microphone\n\nReturn to the mini program and try again after enabling.',
},
chatThinking: {
status: {
pending: 'thinking...',
Expand Down
16 changes: 16 additions & 0 deletions packages/components/locale/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ export default {
sendText: '发送',
stopText: '停止',
},
chatRecord: {
holdToTalk: '按住 说话',
requestAuth: '请授权麦克风权限',
releaseToCancel: '松开取消',
releaseToSend: '松开发送,上滑取消',
cancelText: '取消',
sendText: '发送',
busyTip: '识别中,请稍候…',
recognizeFailTip: '录音识别失败,请重试',
missingPluginTip: '缺少语音识别插件 WechatSI',
authSettingFail: '获取录音权限设置失败',
openSettingFail: '打开设置失败',
systemMicTitle: '无法使用麦克风',
systemMicContent:
'检测到手机系统已关闭"微信"的麦克风权限。\n\n请到系统设置中开启:\n- iOS:设置 > 微信 > 麦克风\n- Android:设置 > 应用管理 > 微信 > 权限 > 麦克风\n\n开启后返回小程序再试。',
},
chatThinking: {
status: {
pending: '正在思考中...',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
align-items: center;
justify-content: center;

image {
.attachment-image {
width: 100%;
height: 100%;
}
Expand Down
110 changes: 110 additions & 0 deletions packages/pro-components/chat/chat-record/README.en-US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
---
title: ChatRecord
description: A component for displaying chat conversation history with features like time grouping, scroll loading, and message interactions.
spline: base
isComponent: true
---

## Import

For global import, configure in `app.json` in the miniprogram root directory. For local import, configure in the `index.json` of the page or component where you need to import.

```json
"usingComponents": {
"t-chat-record": "tdesign-miniprogram/chat-record/chat-record"
}
```

## Usage

### 01 Component Types

#### Basic Type

Display a basic chat record list.

```xml
<t-chat-record records="{{records}}" />
```

#### With Time Grouping

Support automatic time grouping display based on time intervals.

```xml
<t-chat-record
records="{{records}}"
show-time-group="{{true}}"
time-group-interval="{{5}}"
/>
```

#### Scroll Load More

Support loading more history when scrolling to the top.

```xml
<t-chat-record
records="{{records}}"
loading="{{loading}}"
finished="{{finished}}"
bind:loadmore="handleLoadMore"
/>
```

#### Custom Message Rendering

Support custom message rendering through slots.

```xml
<t-chat-record records="{{records}}">
<view slot="message" slot-scope="record">
<!-- Custom message content -->
</view>
</t-chat-record>
```

## API

### ChatRecord Props

Name | Type | Default | Description | Required
-- | -- | -- | -- | --
style | Object | - | Style | N
custom-style | Object | - | Style, generally used for virtualized component node scenarios | N
records | Array | [] | Chat record data list. TS Type: `ChatRecordItem[]` | N
loading | Boolean | false | Whether to show loading state | N
finished | Boolean | false | Whether all data has been loaded | N
loading-text | String | Loading... | Loading prompt text | N
finished-text | String | No more data | Finished loading prompt text | N
empty-text | String | No chat records | Empty state prompt text | N
show-time-group | Boolean | true | Whether to show time grouping | N
time-group-interval | Number | 5 | Time grouping interval (minutes) | N
virtual-scroll | Boolean | false | Whether to enable virtual scrolling | N
scroll-view-height | String | 100vh | Scroll view height | N
auto-scroll-to-bottom | Boolean | true | Whether to auto scroll to bottom | N

### ChatRecord Events

Name | Parameters | Description
-- | -- | --
loadmore | - | Triggered when scrolling to the top, used to load more history
scroll | `(detail: ScrollDetail)` | Triggered when scrolling
message-click | `(detail: { record: ChatRecordItem })` | Triggered when clicking a message
message-long-press | `(detail: { record: ChatRecordItem })` | Triggered when long-pressing a message

### ChatRecord Slots

Name | Description
-- | --
empty | Custom empty state content
message | Custom message content, receives record parameter

### ChatRecord External Style Classes

Class Name | Description
-- | --
t-class | Root node style class
t-class-empty | Empty state style class
t-class-time | Time grouping style class
t-class-message | Message item style class
84 changes: 84 additions & 0 deletions packages/pro-components/chat/chat-record/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
title: ChatRecord 语音输入
description: 用于聊天场景的语音输入组件,支持语音转文字、录音时长控制等功能。
spline: base
isComponent: true
---

## 引入

全局引入,在 miniprogram 根目录下的`app.json`中配置,局部引入,在需要引入的页面或组件的`index.json`中配置。

```json
"usingComponents": {
"t-chat-record": "tdesign-miniprogram/chat-record/chat-record"
}
```

## 前置配置

### 1. 添加插件声明

在 `app.json` 中声明微信同声传译插件:

```json
{
"plugins": {
"WechatSI": {
"version": "0.3.6",
"provider": "wx069ba97219f66d99"
}
}
}
```

### 2. 麦克风权限

使用语音输入需要用户授权麦克风权限。组件会自动处理授权流程,但开发者需要了解以下场景:

#### 首次使用
- 组件会自动调用 `wx.authorize` 申请麦克风权限
- 用户同意后即可正常使用

#### 用户拒绝授权
- 如果用户点击拒绝,会显示"请授权麦克风权限"提示
- 点击提示区域会引导用户前往设置页面开启权限

#### 权限问题排查

如果在小程序设置页面看不到麦克风权限选项:

1. **检查微信 App 权限**
- 进入手机系统设置 > 应用管理 > 微信
- 确保微信有麦克风权限

2. **检查小程序授权**
- 微信中下拉打开最近使用小程序列表
- 长按目标小程序 > 关于小程序 > 设置
- 查看是否有麦克风权限选项

3. **重新授权**
- 删除小程序后重新搜索进入
- 首次点击语音输入时会重新触发授权弹窗

4. **真机调试**
- 模拟器无法测试录音功能
- 必须使用真机预览或体验版测试

## API



### ChatRecord Events

名称 | 参数 | 描述
-- | -- | --
recognize | msg: string | 识别到的文本内容

### ChatRecord Slots

名称 | 描述
-- | --
speechInput | 语音输入按钮插槽
speechNoAuth | 语音授权按钮插槽

Loading
Loading