Skip to content

Commit 011e031

Browse files
committed
Merge branch 'feature/chat' of https://github.com/Tencent/tdesign-miniprogram into feature/chat
2 parents 2e63f5e + e46324e commit 011e031

File tree

7 files changed

+42
-32
lines changed

7 files changed

+42
-32
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,15 @@
9191
// 文件项样式
9292
&__file {
9393
border-radius: @radius-extraLarge;
94-
margin-top: @attachments-file-margin-tiny;
9594
display: block;
9695
position: relative;
9796
background-color: @attachments-background-color;
9897

98+
// 仅当有删除按钮时,增加上边距
99+
&--removable {
100+
margin-top: @attachments-file-margin-tiny;
101+
}
102+
99103
// 删除按钮样式
100104
.@{attachments}__remove {
101105
background-color: @text-color-primary;
@@ -185,13 +189,10 @@
185189

186190
// 对话中附件样式覆盖
187191
.@{attachments}--chatting {
188-
.@{attachments}__file {
189-
margin-top: 0;
190-
margin-bottom: @attachments-file-margin;
191-
}
192192

193193
&.all_images {
194194
width: 100%;
195+
195196
.file-image.@{attachments}__file {
196197
background-color: transparent !important;
197198
}
@@ -209,6 +210,11 @@
209210

210211
&.all_files {
211212
width: auto;
213+
214+
.@{attachments}__files:not(:last-child) {
215+
margin-bottom: @attachments-file-margin;
216+
}
217+
212218
.file-image.@{attachments}__file {
213219
background-color: transparent !important;
214220
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<block wx:for="{{files}}" wx:for-item="item" wx:for-index="index" wx:key="index">
1111
<view class="{{classPrefix}}__files" bindtap="onFileWrapTap" data-index="{{index}}">
1212
<block wx:if="{{item.fileType==='image'}}">
13-
<view class="file-image {{classPrefix}}__file">
13+
<view class="file-image {{classPrefix}}__file {{removable ? classPrefix + '__file--removable' : ''}}">
1414
<block wx:if="{{item.status==='pending' || item.status==='fail' || item.status==='error'}}">
1515
<view class="{{item.status}} {{classPrefix}}__file--{{item.status}}">
1616
<t-loading theme="circular" size="48rpx" />
@@ -20,7 +20,7 @@
2020
<image
2121
class="image"
2222
src="{{item.url}}"
23-
mode="{{ _this.getImageMode(item)}}"
23+
mode="{{_this.getImageMode(item)}}"
2424
lazy-load="false"
2525
style="{{inChat ? _this.imageStyle(item) : ''}}"
2626
></image>
@@ -31,7 +31,7 @@
3131
</view>
3232
</block>
3333
<block wx:else>
34-
<view class="file {{classPrefix}}__file">
34+
<view class="file {{classPrefix}}__file {{removable ? classPrefix + '__file--removable' : ''}}">
3535
<view class="image">
3636
<block wx:if="{{item.status==='pending'}}">
3737
<view class="loading {{classPrefix}}__file--pending">

packages/pro-components/chat/chat-list/_example/image/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Component({
177177
data: [
178178
{
179179
name: 'sample1.png',
180-
url: 'https://tdesign.gtimg.com/site/avatar.jpg',
180+
url: 'https://tdesign.gtimg.com/site/square.png',
181181
fileType: 'image',
182182
status: 'success',
183183
size: 1032,
@@ -186,7 +186,7 @@ Component({
186186
},
187187
{
188188
name: 'sample2.png',
189-
url: 'https://tdesign.gtimg.com/site/avatar.jpg',
189+
url: 'https://tdesign.gtimg.com/site/square.png',
190190
fileType: 'image',
191191
status: 'success',
192192
size: 1032,
@@ -195,7 +195,7 @@ Component({
195195
},
196196
{
197197
name: 'sample3.png',
198-
url: 'https://tdesign.gtimg.com/site/avatar.jpg',
198+
url: 'https://tdesign.gtimg.com/site/square.png',
199199
fileType: 'image',
200200
status: 'success',
201201
size: 1032,
@@ -204,7 +204,7 @@ Component({
204204
},
205205
{
206206
name: 'sample4.png',
207-
url: 'https://tdesign.gtimg.com/site/avatar.jpg',
207+
url: 'https://tdesign.gtimg.com/site/square.png',
208208
fileType: 'image',
209209
status: 'success',
210210
size: 1032,
@@ -213,7 +213,7 @@ Component({
213213
},
214214
{
215215
name: 'sample5.png',
216-
url: 'https://tdesign.gtimg.com/site/avatar.jpg',
216+
url: 'https://tdesign.gtimg.com/site/square.png',
217217
fileType: 'image',
218218
status: 'success',
219219
size: 1032,

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@
4949
}
5050

5151
&--top {
52-
top: -8rpx;
52+
top: -6rpx;
5353
left: 7rpx;
5454
animation: dot-moving-top @chat-loading-animation-duration ease-in-out alternate infinite;
5555
}
5656

5757
&--left {
58-
bottom: -8rpx;
58+
bottom: -6rpx;
5959
left: -6rpx;
6060
animation: dot-moving-left @chat-loading-animation-duration ease-in-out alternate infinite;
6161
}
6262

6363
&--right {
64-
bottom: -8rpx;
64+
bottom: -6rpx;
6565
right: -6rpx;
6666
animation: dot-moving-right @chat-loading-animation-duration ease-in-out alternate infinite;
6767
}
@@ -94,37 +94,37 @@
9494
@keyframes dot-moving-top {
9595
0% {
9696
transform: scale(1);
97-
top: -7rpx;
97+
top: -6rpx;
9898
}
9999
to {
100-
transform: scale(1.75);
101-
top: 6rpx;
100+
transform: scale(2);
101+
top: 7rpx;
102102
}
103103
}
104104

105105
@keyframes dot-moving-left {
106106
0% {
107107
transform: scale(1);
108-
bottom: -7rpx;
109-
left: -7rpx;
108+
bottom: -6rpx;
109+
left: -6rpx;
110110
}
111111
to {
112-
transform: scale(1.75);
113-
bottom: 6rpx;
114-
left: 6rpx;
112+
transform: scale(2);
113+
bottom: 7rpx;
114+
left: 7rpx;
115115
}
116116
}
117117

118118
@keyframes dot-moving-right {
119119
0% {
120120
transform: scale(1);
121-
bottom: -7rpx;
122-
right: -7rpx;
121+
bottom: -6rpx;
122+
right: -6rpx;
123123
}
124124
to {
125-
transform: scale(1.75);
126-
bottom: 6rpx;
127-
right: 6rpx;
125+
transform: scale(2);
126+
bottom: 7rpx;
127+
right: 7rpx;
128128
}
129129
}
130130

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Component({
22
data: {
33
message: {
4-
role: 'user',
4+
role: 'system',
55
content: [
66
{
77
type: 'text',

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
.@{chat-message}__base {
6363
padding-right: @spacer-2;
6464
}
65+
66+
.@{chat-content} {
67+
max-width: 90%;
68+
}
6569
}
6670

6771
// 助手消息样式

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Page({
99
{
1010
fileType: 'image',
1111
name: '图片1.png',
12-
url: 'https://tdesign.gtimg.com/site/avatar.jpg',
12+
url: 'https://tdesign.gtimg.com/site/square.png',
1313
},
1414
{
1515
fileType: 'pdf',
@@ -32,7 +32,7 @@ Page({
3232
{
3333
fileType: 'image',
3434
name: '图片1.png',
35-
url: 'https://tdesign.gtimg.com/site/avatar.jpg',
35+
url: 'https://tdesign.gtimg.com/site/square.png',
3636
},
3737
{
3838
fileType: 'pdf',

0 commit comments

Comments
 (0)