Skip to content

Commit a9b4b15

Browse files
committed
fix(ChatLoading): fix text spacing error
1 parent 1c3cfd6 commit a9b4b15

File tree

19 files changed

+82
-70
lines changed

19 files changed

+82
-70
lines changed

packages/pro-components/chat/attachments/_example/file/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ Page({
33
items: [
44
{
55
fileType: 'doc',
6-
name: 'word-file.docxf',
7-
url: 'https://example.com/word-file.docxf',
6+
name: 'word-file.doc',
7+
url: 'https://example.com/word-file.doc',
88
size: 222859,
99
status: 'success',
1010
},
1111
{
12-
fileType: 'xls',
12+
fileType: 'excel',
1313
name: 'excel-file.xlsx',
1414
url: 'https://example.com/excel-file.xlsx',
1515
size: 222859,
@@ -37,8 +37,8 @@ Page({
3737
status: 'success',
3838
},
3939
{
40-
fileType: 'audio',
41-
name: 'audio-file.mp3',
40+
fileType: 'file',
41+
name: 'file',
4242
url: 'https://example.com/audio-file.mp3',
4343
size: 222859,
4444
status: 'success',

packages/pro-components/chat/chat-actionbar/chat-actionbar.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
// 操作项
7171
&__item {
7272
color: @chat-actionbar-item-color;
73-
margin: 8rpx 0;
74-
padding: 8rpx 28rpx;
73+
margin: 12rpx 0;
74+
padding: 4rpx 28rpx;
7575
border-right: 2rpx solid @component-stroke;
7676
background-color: unset;
7777
outline: none;

packages/pro-components/chat/chat-list/_example/agent/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
wx:for="{{item.tasks}}"
2828
wx:key="index"
2929
wx:for-item="taskItem"
30-
class="{{['step-text', taskItem.type]}}"
30+
class="step-text {{taskItem.type}}"
3131
>
3232
<t-icon
3333
wx:if="{{taskItem.type === 'command'}}"

packages/pro-components/chat/chat-list/_example/agent/index.wxss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
.step-icon {
5252
margin-right: 12rpx;
53-
margin-top: 4rpx;
53+
margin-top: 6rpx;
5454
}
5555

5656
.t-steps-item__circle--finish {

packages/pro-components/chat/chat-list/_example/hook-component/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const mockData = {
1919
};
2020

2121
const mockData1 =
22-
'嗯,用户问的是南极的自动提款机叫什么名字。这个问题有点有趣,因为南极是一个极端寒冷的地方,而且大部分地区都是无人居住的科研站。首先,我需要确认南极是否有自动提款机存在。\n\n首先,南极大陆没有常住居民,只有各国的科研人员季节性驻扎。主要的设施是各国的科学考察站,比如美国的麦克默多站、中国的长城站等。这些站点通常有基本的生活设施,但像银行这样的商业服务可能非常有限。\n\n接下来,我需要查找是否有关于南极自动提款机的信息。记得之前可能听说过某个银行在南极设立过ATM机作为宣传噱头,但不确定具体细节。比如,可能是一些国际银行为了品牌宣传或者方便科研人员而设置的。\n\n然后,我想到可能是在麦克默多站,那里是南极最大的科研社区之一,由美国运作。那里可能有较多的基础设施,包括可能的ATM机。如果有的话,可能是由某个美国银行设置的,比如富兰克林国家银行,或者是新西兰的银行,因为麦克默多站靠近新西兰的管辖区域。\n\n另外,需要考虑时间因素。ATM机的安装可能是在某个特定时期,比如早期的探险活动或者近年的项目。需要确认这些ATM是否仍然存在,或者是否已经被移除。\n\n还需要考虑是否有相关的新闻报道或官方信息。例如,是否有银行发布过在南极设立ATM的消息,或者科研站的官方网站提到过ATM的存在。\n\n可能还需要区分南极洲本身是否有独立的金融机构,但考虑到南极条约体系规定南极用于和平与科研,商业活动有限,因此可能没有常设的银行机构。ATM机可能是某个国家为了本国科考人员方便而设立的,比如美国的科考站使用美国的ATM机,由某个美国银行运营。\n\n然后,可能涉及到具体名称的问题。如果确实存在,可能ATM机属于某个特定的银行,比如富兰克林国家银行,但需要查证。或者,可能有一个特定的昵称,比如“南极ATM”之类的,但更可能是以所属银行命名。\n\n最后,可能需要综合这些信息,给出一个准确的答案,并指出可能的背景,比如安装时间、所属银行以及现状如何。\n';
22+
'嗯,用户问的是南极的自动提款机叫什么名字。这个问题有点有趣,因为南极是一个极端寒冷的地方,而且大部分地区都是无人居住的科研站。\n';
2323

2424
const mockData2 =
2525
'\n\n南极的自动提款机并没有一个特定的专属名称,但历史上确实有一台ATM机曾短暂存在于南极的**麦克默多站**(McMurdo Station)。这台ATM由美国**富兰克林国家银行**(Wells Fargo)于1998年安装,主要供驻扎在该站的科研人员使用。不过,由于南极的极端环境和极低的人口密度,这台ATM机并未长期运行,最终被移除。\n\n**背景补充:**\n- **麦克默多站**是美国在南极最大的科研基地,夏季人口可达约1,000人,冬季约200人。\n- 该ATM机更多是作为一种象征性服务存在,实际使用频率极低,因为南极科考人员通常依靠预支资金或电子支付。\n- 目前南极已无长期运行的ATM机,现代科考站更多依赖非现金交易方式。\n\n南极作为非主权领土,其基础设施以科研和生活支持为主,商业金融服务非常有限。若有类似设施,通常是临时或实验性质的。';

packages/pro-components/chat/chat-loading/_example/base/index.wxss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
background-color: var(--td-bg-color-container);
33
padding: 32rpx;
44
display: flex;
5+
align-items: center;
56
gap: 48rpx;
67
}

packages/pro-components/chat/chat-loading/chat-loading.less

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
}
1515

1616
&__icon {
17-
width: 28rpx;
18-
height: 28rpx;
19-
padding: 6rpx;
20-
margin-right: 8rpx;
21-
2217
.@{chat-loading}__skeleton{
2318
width: 100%
2419
}
@@ -41,7 +36,9 @@
4136
margin: 0 6rpx 0 0;
4237
scale: 0.8;
4338

44-
view {
39+
&--top,
40+
&--left,
41+
&--right {
4542
position: absolute;
4643
width: 16rpx;
4744
height: 16rpx;

packages/pro-components/chat/chat-loading/chat-loading.wxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<view class="class {{[classPrefix]}}" style="{{_._style([style, customStyle])}}">
44
<!-- 动态加载动画 -->
55
<view wx:if="{{animation !== 'skeleton'}}" class="{{classPrefix}}__icon">
6-
<block wx:if="{{animation==='moving'}}">
6+
<block wx:if="{{animation === 'moving'}}">
77
<view class="{{classPrefix}}__moving">
88
<view class="{{classPrefix}}__moving--top" />
99
<view class="{{classPrefix}}__moving--left" />
@@ -25,5 +25,5 @@
2525
</view>
2626
</block>
2727
<!-- 文本内容 -->
28-
<view class="{{classPrefix}}__text">{{text}}</view>
28+
<view wx:if="{{text}}" class="{{classPrefix}}__text">{{text}}</view>
2929
</view>

packages/pro-components/chat/chat-markdown/chat-markdown.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@
114114
// 列表样式
115115
&-list {
116116
display: block;
117-
padding-left: @spacer-1;
118-
margin: @spacer-1 0;
117+
padding: 0;
118+
margin: 0 0 @spacer 1.5em;;
119119

120120
// 有序列表
121121
&__decimal {

packages/pro-components/chat/chat-message/_example/content/index.js

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -98,47 +98,45 @@ Component({
9898
type: 'attachment',
9999
data: [
100100
{
101-
fileType: 'image',
102-
name: 'sample-image.jpg',
103-
url: 'https://tdesign.gtimg.com/demo/demo-image-1.png',
104-
size: 1024,
101+
fileType: 'doc',
102+
name: 'word-file.doc',
103+
url: 'https://example.com/word-file.doc',
104+
size: 222859,
105+
status: 'success',
106+
},
107+
{
108+
fileType: 'excel',
109+
name: 'excel-file.xlsx',
110+
url: 'https://example.com/excel-file.xlsx',
111+
size: 222859,
112+
status: 'success',
113+
},
114+
{
115+
fileType: 'pdf',
116+
name: 'pdf-file.pdf',
117+
url: 'https://example.com/pdf-file.pdf',
118+
size: 222859,
119+
status: 'success',
120+
},
121+
{
122+
fileType: 'ppt',
123+
name: 'ppt-file.pptx',
124+
url: 'https://example.com/ppt-file.pptx',
125+
size: 222859,
126+
status: 'success',
127+
},
128+
{
129+
fileType: 'video',
130+
name: 'video-file.mp4',
131+
url: 'https://example.com/video-file.mp4',
132+
size: 222859,
105133
status: 'success',
106-
width: 1920, // 图片实际宽度
107-
height: 1080, // 图片实际高度
108134
},
109-
// {
110-
// fileType: 'pdf',
111-
// name: 'document.pdf',
112-
// url: 'https://example.com/document.pdf',
113-
// size: 3072,
114-
// status: 'success',
115-
// },
116-
// {
117-
// fileType: 'doc',
118-
// name: 'report.docx',
119-
// url: 'https://example.com/report.docx',
120-
// size: 1536,
121-
// status: 'success',
122-
// },
123-
// {
124-
// fileType: 'audio',
125-
// name: 'audio.mp3',
126-
// url: 'https://example.com/audio.mp3',
127-
// size: 512,
128-
// status: 'success',
129-
// },
130-
// {
131-
// fileType: 'ppt',
132-
// name: 'presentation.ppt',
133-
// url: 'https://example.com/presentation.ppt',
134-
// size: 512,
135-
// status: 'success',
136-
// },
137135
{
138-
fileType: 'xls',
139-
name: 'spreadsheet.xls',
140-
url: 'https://example.com/spreadsheet.xls',
141-
size: 512,
136+
fileType: 'file',
137+
name: 'file',
138+
url: 'https://example.com/audio-file.mp3',
139+
size: 222859,
142140
status: 'success',
143141
},
144142
],

0 commit comments

Comments
 (0)