Skip to content

Commit 1c3cfd6

Browse files
committed
Merge branch 'feature/chat' of https://github.com/Tencent/tdesign-miniprogram into feature/chat
2 parents f53f3b9 + a1725af commit 1c3cfd6

File tree

38 files changed

+160
-137
lines changed

38 files changed

+160
-137
lines changed

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,44 @@ Page({
22
data: {
33
items: [
44
{
5-
fileType: 'pdf',
6-
name: 'document.pdf',
7-
url: 'https://example.com/document.pdf',
5+
fileType: 'doc',
6+
name: 'word-file.docxf',
7+
url: 'https://example.com/word-file.docxf',
88
size: 222859,
99
status: 'success',
1010
},
1111
{
12-
fileType: 'doc',
13-
name: 'report.docx',
14-
url: 'https://example.com/report.docx',
12+
fileType: 'xls',
13+
name: 'excel-file.xlsx',
14+
url: 'https://example.com/excel-file.xlsx',
1515
size: 222859,
1616
status: 'success',
1717
},
1818
{
19-
fileType: 'audio',
20-
name: 'audio.mp3',
21-
url: 'https://example.com/audio.mp3',
19+
fileType: 'pdf',
20+
name: 'pdf-file.pdf',
21+
url: 'https://example.com/pdf-file.pdf',
2222
size: 222859,
2323
status: 'success',
2424
},
2525
{
2626
fileType: 'ppt',
27-
name: 'presentation.ppt',
28-
url: 'https://example.com/presentation.ppt',
27+
name: 'ppt-file.pptx',
28+
url: 'https://example.com/ppt-file.pptx',
2929
size: 222859,
3030
status: 'success',
3131
},
3232
{
33-
fileType: 'xls',
34-
name: 'spreadsheet.xls',
35-
url: 'https://example.com/spreadsheet.xls',
33+
fileType: 'video',
34+
name: 'video-file.mp4',
35+
url: 'https://example.com/video-file.mp4',
3636
size: 222859,
3737
status: 'success',
3838
},
3939
{
40-
fileType: 'video',
41-
name: 'video.mp4',
42-
url: 'https://example.com/video.mp4',
40+
fileType: 'audio',
41+
name: 'audio-file.mp3',
42+
url: 'https://example.com/audio-file.mp3',
4343
size: 222859,
4444
status: 'success',
4545
},

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@
55
</view> -->
66

77
<view class="chat-example-block" wx:for="{{items}}" wx:for-item="item" wx:key="url">
8-
<t-attachments
9-
style="display: inline"
10-
items="{{[item]}}"
11-
bind:fileClick="onFileClick"
12-
bind:remove="onRemove"
13-
bind:add="onAdd"
14-
/>
8+
<t-attachments items="{{[item]}}" bind:fileClick="onFileClick" bind:remove="onRemove" bind:add="onAdd" />
159
</view>
1610
</view>
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
.chat-example {
2-
display: grid;
3-
grid-template-columns: 1fr 1fr;
4-
gap: 32rpx;
5-
62
padding: 32rpx;
73
box-sizing: border-box;
84
background-color: var(--td-bg-color-container);
95
}
6+
7+
.chat-example-block {
8+
display: inline-flex;
9+
width: 336rpx;
10+
margin-bottom: 26rpx;
11+
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@
9898

9999
// 删除按钮样式
100100
.@{attachments}__remove {
101-
color: @text-color-primary;
101+
background-color: @text-color-primary;
102+
color: @bg-color-container;
103+
border-radius: @radius-circle;
102104
position: absolute;
103105
right: -4px;
104106
top: -4px;
@@ -174,6 +176,7 @@
174176
font-style: normal;
175177
font-weight: 400;
176178
line-height: @attachments-desc-line-height;
179+
margin-top: -4rpx;
177180
}
178181
}
179182
}

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

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,9 @@
2525
style="{{inChat ? _this.imageStyle(item) : ''}}"
2626
></image>
2727
</block>
28-
<block wx:if="{{removable}}">
29-
<t-icon
30-
catchtap="onRemoveTap"
31-
data-index="{{index}}"
32-
class="{{classPrefix}}__remove"
33-
name="close-circle-filled"
34-
size="16px"
35-
/>
36-
</block>
28+
<view wx:if="{{removable}}" class="{{classPrefix}}__remove">
29+
<t-icon data-index="{{index}}" name="multiply" size="16px" catchtap="onRemoveTap" />
30+
</view>
3731
</view>
3832
</block>
3933
<block wx:else>
@@ -69,15 +63,9 @@
6963
<view wx:else class="{{classPrefix}}__desc">{{item.desc}}</view>
7064
</block>
7165
</view>
72-
<block wx:if="{{removable}}">
73-
<t-icon
74-
catchtap="onRemoveTap"
75-
data-index="{{index}}"
76-
class="{{classPrefix}}__remove"
77-
name="close-circle-filled"
78-
size="16px"
79-
/>
80-
</block>
66+
<view wx:if="{{removable}}" class="{{classPrefix}}__remove">
67+
<t-icon data-index="{{index}}" name="multiply" size="16px" catchtap="onRemoveTap" />
68+
</view>
8169
</view>
8270
</block>
8371
</view>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
// 操作项
7171
&__item {
7272
color: @chat-actionbar-item-color;
73-
padding: @chat-actionbar-item-padding;
73+
margin: 8rpx 0;
74+
padding: 8rpx 28rpx;
7475
border-right: 2rpx solid @component-stroke;
7576
background-color: unset;
7677
outline: none;

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77
padding: 0 0 0 32rpx;
88
box-sizing: border-box;
99
}
10-
1110
.t-chat-message {
12-
padding-right: 32rpx;
11+
padding: 0 32rpx;
1312
}
1413

1514
.preview {
1615
padding: 16rpx;
1716
display: flex;
1817
justify-content: space-between;
19-
border: 1px solid black;
18+
border: 1px solid var(--td-component-border);
2019
}
2120

2221
.step {
@@ -36,17 +35,17 @@
3635
.step-text.command {
3736
padding: 16rpx;
3837
border-radius: 16rpx;
39-
background-color: #f3f3f3;
38+
background-color: var(--td-bg-color-secondarycontainer);
4039
display: flex;
4140
font-size: 28rpx;
4241
line-height: 44rpx;
43-
color: rgba(0, 0, 0, 0.6);
42+
color: var(--td-text-color-secondary);
4443
}
4544

4645
.step-text.result {
4746
font-size: 28rpx;
4847
line-height: 44rpx;
49-
color: rgba(0, 0, 0, 0.9);
48+
color: var(--td-text-color-primary);
5049
}
5150

5251
.step-icon {
@@ -56,8 +55,8 @@
5655

5756
.t-steps-item__circle--finish {
5857
background-color: transparent;
59-
color: #000000e5;
60-
border: 1px solid #000000e5;
58+
color: var(--td-text-color-primary);
59+
border: 1px solid var(--td-text-color-primary);
6160
width: 16px;
6261
height: 16px;
6362
}
@@ -67,10 +66,10 @@
6766
}
6867

6968
.t-steps-item__line--finish {
70-
background-color: #dcdcdc;
69+
background-color: var(--td-component-border);
7170
}
7271

7372
.t-steps-item__title--finish {
74-
color: #000000e5;
73+
color: var(--td-text-color-primary);
7574
font-weight: 600;
7675
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
}
1010

1111
.t-chat-message {
12-
padding-right: 32rpx;
12+
padding: 0 32rpx;
1313
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010

1111
.t-chat-message {
12-
padding-right: 32rpx;
12+
padding: 0 32rpx;
1313
}
1414

1515
.preview {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010

1111
.t-chat-message {
12-
padding-right: 32rpx;
12+
padding: 0 32rpx;
1313
}
1414

1515
.chart-chat .assistant .t-chat__detail {

0 commit comments

Comments
 (0)