@tencentcloud/ai-desk-customer-vue 1.5.10 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/README.md +103 -77
- package/README_EN.md +873 -0
- package/assets/audio-blue.svg +4 -0
- package/assets/audio_icon_1.svg +3 -0
- package/assets/audio_icon_2.svg +3 -0
- package/assets/audio_icon_3.svg +3 -0
- package/assets/keyboard-icon.svg +9 -0
- package/components/CustomerServiceChat/chat-header/index-web.vue +41 -10
- package/components/CustomerServiceChat/feedback-modal/index.vue +1 -1
- package/components/CustomerServiceChat/index-web.vue +13 -3
- package/components/CustomerServiceChat/message-input/index-web.vue +57 -10
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +342 -11
- package/components/CustomerServiceChat/message-list/index-web.vue +13 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-audio-web.vue +50 -78
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +1 -1
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/marked.ts +4 -3
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-robot-welcome.vue +13 -6
- package/components/CustomerServiceChat/message-list/message-elements/message-text.vue +3 -2
- package/components/CustomerServiceChat/message-toolbar-button/index.vue +11 -6
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-end-human-service.vue +16 -5
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-human-service.vue +8 -5
- package/components/CustomerServiceChat/message-toolbar-button/toolbar-button-service-rating.vue +8 -5
- package/components/common/Toast/index-web.ts +16 -3
- package/components/common/Toast/index-web.vue +16 -6
- package/constant.ts +1 -0
- package/interface.ts +8 -0
- package/locales/en/TUIChat.ts +6 -2
- package/locales/fil/TUIChat.ts +6 -2
- package/locales/id/TUIChat.ts +76 -72
- package/locales/ja/TUIChat.ts +76 -72
- package/locales/ms/TUIChat.ts +76 -72
- package/locales/ru/TUIChat.ts +6 -2
- package/locales/th/TUIChat.ts +76 -72
- package/locales/vi/TUIChat.ts +76 -72
- package/locales/zh_cn/TUIChat.ts +6 -2
- package/locales/zh_tw/TUIChat.ts +6 -2
- package/package.json +2 -1
- package/server.ts +22 -3
- package/utils/utils.ts +13 -0
- package/assets/keyboard_icon.png +0 -0
package/locales/vi/TUIChat.ts
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
const TUIChat = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
2
|
+
'查看内容': 'Xem nội dung',
|
|
3
|
+
'立即填写': 'Điền ngay',
|
|
4
|
+
'已提交': 'Đã gửi',
|
|
5
|
+
'不能为空': 'Không được để trống',
|
|
6
|
+
'提交': 'Gửi',
|
|
7
|
+
'撤回': 'Thu hồi',
|
|
8
|
+
'删除': 'Xóa',
|
|
9
|
+
'复制': 'Sao chép',
|
|
10
|
+
'重新发送': 'Gửi lại',
|
|
11
|
+
'转发': 'Chuyển tiếp',
|
|
12
|
+
'引用': 'Trích dẫn',
|
|
13
|
+
'打开': 'Mở',
|
|
14
|
+
'已读': 'Đã đọc',
|
|
15
|
+
'全部已读': 'Đã đọc hết',
|
|
16
|
+
'人已读': ' đã đọc',
|
|
17
|
+
'人未读': ' chưa đọc',
|
|
18
|
+
'人关闭阅读状态': ' đóng trạng thái đọc',
|
|
19
|
+
'消息详情': 'Thông tin tin nhắn',
|
|
20
|
+
'关闭阅读状态': 'Đóng trạng thái đọc',
|
|
21
|
+
'该消息不存在': 'Tin nhắn không tồn tại',
|
|
22
|
+
'无法定位到原消息': 'Không thể xác định được tin nhắn gốc',
|
|
23
|
+
'未读': 'Chưa đọc',
|
|
24
|
+
'您': 'Bạn',
|
|
25
|
+
'撤回了一条消息': 'Đã thu hồi một tin nhắn',
|
|
26
|
+
'重新编辑': 'Chỉnh sửa lại',
|
|
27
|
+
'我': 'Tôi',
|
|
28
|
+
'查看更多': 'Xem thêm',
|
|
29
|
+
'转发给': 'Chuyển tiếp đến',
|
|
30
|
+
'请输入消息': 'Nhập tin nhắn',
|
|
31
|
+
'描述': 'Mô tả',
|
|
32
|
+
'经度': 'Kinh độ',
|
|
33
|
+
'纬度': 'Vĩ độ',
|
|
34
|
+
'自定义消息': 'Tin nhắn tùy chỉnh',
|
|
35
|
+
'图片': '[hình ảnh]',
|
|
36
|
+
'语音': '[âm thanh]',
|
|
37
|
+
'视频': '[video]',
|
|
38
|
+
'表情': '[biểu tượng cảm xúc]',
|
|
39
|
+
'文件': '[tệp tin]',
|
|
40
|
+
'自定义': '[tin nhắn tùy chỉnh]',
|
|
41
|
+
'管理员开启全员禁言': 'Quản trị viên mở chế độ im lặng cho tất cả mọi người',
|
|
42
|
+
'您已被管理员禁言': 'Bạn đã bị quản trị viên im lặng',
|
|
43
|
+
'按Enter发送': 'Nhấn Enter để gửi tin nhắn',
|
|
44
|
+
'单击下载': 'Nhấp để tải xuống',
|
|
45
45
|
'下载':'tải về',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
46
|
+
'确认重发该消息?': 'Xác nhận gửi lại tin nhắn này?',
|
|
47
|
+
'取消': 'Hủy',
|
|
48
|
+
'确定': 'Xác nhận',
|
|
49
|
+
'对方正在输入': 'Đang nhập tin...',
|
|
50
|
+
'回到最新位置': 'Quay lại vị trí mới nhất',
|
|
51
|
+
'条新消息': ' tin nhắn mới',
|
|
52
|
+
'点此投诉': 'Khiếu nại',
|
|
53
|
+
'语音通话': 'Cuộc gọi thoại',
|
|
54
|
+
'视频通话': 'Cuộc gọi video',
|
|
55
|
+
'发起群语音': 'Bắt đầu cuộc gọi thoại nhóm',
|
|
56
|
+
'发起群视频': 'Bắt đầu cuộc gọi video nhóm',
|
|
57
|
+
'已接听': 'Đã trả lời',
|
|
58
|
+
'拒绝通话': 'Từ chối cuộc gọi',
|
|
59
|
+
'无应答': 'Không trả lời',
|
|
60
|
+
'取消通话': 'Hủy cuộc gọi',
|
|
61
|
+
'发起通话': 'Bắt đầu cuộc gọi',
|
|
62
|
+
'结束群聊': 'Chỉnh sửa cuộc gọi nhóm',
|
|
63
|
+
'通话时长': 'Thời gian gọi',
|
|
64
|
+
'欢迎使用TUICallKit': 'Chào mừng đến với TUICallKit',
|
|
65
|
+
'检测到您暂未集成TUICallKit,无法体验音视频通话功能': 'Phát hiện rằng bạn chưa tích hợp TUI CallKit, vì vậy bạn không thể trải nghiệm chức năng cuộc gọi âm thanh và video.',
|
|
66
|
+
'请点击': 'Vui lòng nhấp chuột',
|
|
67
|
+
'集成TUICallKit': ' Tích hợp TUICallKit ',
|
|
68
|
+
'开通腾讯实时音视频服务': 'Tích hợp Tencent Real-Time Communication',
|
|
69
|
+
'进行体验': 'để trải nghiệm.',
|
|
70
|
+
'您当前购买使用的套餐包暂未开通此功能': 'Gói dịch vụ mà bạn đang sử dụng không hỗ trợ tính năng này.',
|
|
71
|
+
'系统消息': 'Bot',
|
|
72
|
+
'转人工服务': 'Chuyển sang dịch vụ nhân tạo',
|
|
73
73
|
'点击处理': 'Nhấp để xử lý',
|
|
74
74
|
'发送失败': 'Gửi thất bại',
|
|
75
75
|
'复制成功': 'Sao chép thành công',
|
|
@@ -110,8 +110,12 @@ const TUIChat = {
|
|
|
110
110
|
'空': 'Trống',
|
|
111
111
|
'文本包含本地审核拦截词': 'Văn bản chứa từ cấm kiểm duyệt địa phương',
|
|
112
112
|
'按住说话': 'Nhấn và nói',
|
|
113
|
-
'
|
|
114
|
-
'
|
|
113
|
+
'松开发送': 'Nhấc lên để gửi',
|
|
114
|
+
'松手取消': 'Nhấc lên để hủy',
|
|
115
|
+
'录音结束提醒': 'Ghi âm sẽ dừng sau',
|
|
116
|
+
'语音播放失败': 'Phát lại âm thanh không thành công',
|
|
117
|
+
'请检查麦克风访问权限': 'Vui lòng kiểm tra quyền truy cập microphone',
|
|
118
|
+
'按压时间过短,请按压超过1秒': 'Thời gian nhấn quá ngắn, vui lòng nhấn giữ hơn 1 giây',
|
|
115
119
|
'正在录音': 'Đang ghi âm',
|
|
116
120
|
'继续上滑可取消': 'Tiếp tục vuốt lên để hủy',
|
|
117
121
|
'松开手指 取消发送': 'Nhả tay để hủy gửi',
|
package/locales/zh_cn/TUIChat.ts
CHANGED
|
@@ -105,11 +105,15 @@ const TUIChat = {
|
|
|
105
105
|
'空': '空',
|
|
106
106
|
'文本包含本地审核拦截词': '文本包含本地审核拦截词',
|
|
107
107
|
'按住说话': '按住说话',
|
|
108
|
-
'
|
|
109
|
-
'
|
|
108
|
+
'松开发送': '松开发送',
|
|
109
|
+
'松手取消': '松手取消',
|
|
110
110
|
'正在录音': '正在录音',
|
|
111
111
|
'继续上滑可取消': '继续上滑可取消',
|
|
112
112
|
'松开手指 取消发送': '松开手指 取消发送',
|
|
113
|
+
'录音结束提醒': '秒后自动结束录音',
|
|
114
|
+
'请检查麦克风访问权限': '请检查麦克风访问权限',
|
|
115
|
+
'按压时间过短,请按压超过1秒': '按压时间过短,请按压超过1秒',
|
|
116
|
+
'语音播放失败': '语音播放失败',
|
|
113
117
|
'此机型暂不支持复制功能': '此机型暂不支持复制功能',
|
|
114
118
|
'请开通翻译功能': '请开通翻译功能',
|
|
115
119
|
'请开通语音转文字功能': '请开通语音转文字功能',
|
package/locales/zh_tw/TUIChat.ts
CHANGED
|
@@ -105,11 +105,15 @@ const TUIChat = {
|
|
|
105
105
|
'空': '空',
|
|
106
106
|
'文本包含本地审核拦截词': '文本包含本地審核攔截詞',
|
|
107
107
|
'按住说话': '按住說話',
|
|
108
|
-
'
|
|
109
|
-
'
|
|
108
|
+
'松开发送': '松開發送',
|
|
109
|
+
'松手取消': '松手取消',
|
|
110
110
|
'正在录音': '正在錄音',
|
|
111
111
|
'继续上滑可取消': '繼續上滑可取消',
|
|
112
112
|
'松开手指 取消发送': '松開手指 取消發送',
|
|
113
|
+
'录音结束提醒': '秒後自動結束錄音',
|
|
114
|
+
'语音播放失败': '語音播放失敗',
|
|
115
|
+
'请检查麦克风访问权限': '請檢查麥克風存取權限',
|
|
116
|
+
'按压时间过短,请按压超过1秒': '按壓時間過短,請按壓超過1秒',
|
|
113
117
|
'此机型暂不支持复制功能': '此機型暫不支持複製功能',
|
|
114
118
|
'请开通翻译功能': '請開通翻譯功能',
|
|
115
119
|
'请开通语音转文字功能': '請開通語音轉文字功能',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencentcloud/ai-desk-customer-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Vue2/Vue3 UIKit for AI Desk",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"keywords": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"@types/lodash": "^4.14.202",
|
|
35
35
|
"countries-and-timezones": "^3.8.0",
|
|
36
36
|
"dayjs": "^1.11.10",
|
|
37
|
+
"js-audio-recorder": "^1.0.7",
|
|
37
38
|
"lodash": "^4.17.21",
|
|
38
39
|
"marked": "^6.0.0",
|
|
39
40
|
"mp-html": "^2.5.0",
|
package/server.ts
CHANGED
|
@@ -17,7 +17,7 @@ import TUIChatEngine, {
|
|
|
17
17
|
import Log from './utils/logger';
|
|
18
18
|
import { version } from './package.json'
|
|
19
19
|
import { Toast, TOAST_TYPE } from "./components/common/Toast/index-web";
|
|
20
|
-
import { switchReadStatus, transferToHuman, transferToTaskFlow, validateUserID, updateCustomStore } from "./utils/utils";
|
|
20
|
+
import { switchReadStatus, transferToHuman, transferToTaskFlow, validateUserID, updateCustomStore, isNonEmptyObject } from "./utils/utils";
|
|
21
21
|
import state from "./utils/state";
|
|
22
22
|
import { USER_DEFAULT_AVATAR } from "./constant";
|
|
23
23
|
import { vueVersion } from "./adapter-vue-web";
|
|
@@ -45,11 +45,13 @@ export default class TUICustomerServer {
|
|
|
45
45
|
private loggedInUserID: string;
|
|
46
46
|
private myProfile: IProfile;
|
|
47
47
|
private paramsForActiveAgain: any;
|
|
48
|
+
private loginFailToasts: any[];
|
|
48
49
|
constructor() {
|
|
49
50
|
TUICore.registerService(TUIConstants.TUICustomerServicePlugin.SERVICE.NAME, this);
|
|
50
51
|
TUICore.registerExtension(TUIConstants.TUIContact.EXTENSION.CONTACT_LIST.EXT_ID, this);
|
|
51
52
|
this.customerServiceIDList = ['@customer_service_account'];
|
|
52
53
|
this.currentCustomerServiceID = this.customerServiceIDList[0];
|
|
54
|
+
this.loginFailToasts = [];
|
|
53
55
|
this.isLoggedIn = false;
|
|
54
56
|
this.loggedInUserID = '';
|
|
55
57
|
this.myProfile = { avatar: USER_DEFAULT_AVATAR };
|
|
@@ -62,6 +64,15 @@ export default class TUICustomerServer {
|
|
|
62
64
|
return TUICustomerServer.instance;
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
private clearToasts() {
|
|
68
|
+
this.loginFailToasts.forEach(toast => {
|
|
69
|
+
if (isNonEmptyObject(toast)) {
|
|
70
|
+
toast.close();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
this.loginFailToasts = [];
|
|
74
|
+
}
|
|
75
|
+
|
|
65
76
|
private async loginCustomerUIKit(SDKAppID:number, userID:string, userSig:string) {
|
|
66
77
|
clearChatStorage(SDKAppID, userID);
|
|
67
78
|
return TUIChatEngine.login({
|
|
@@ -71,6 +82,7 @@ export default class TUICustomerServer {
|
|
|
71
82
|
useUploadPlugin: true,
|
|
72
83
|
}).then(() => {
|
|
73
84
|
Log.i(`login success. userID:${userID}`);
|
|
85
|
+
this.clearToasts();
|
|
74
86
|
this.isLoggedIn = true;
|
|
75
87
|
this.loggedInUserID = userID;
|
|
76
88
|
this.switchConversation(`C2C${this.currentCustomerServiceID}`);
|
|
@@ -78,11 +90,12 @@ export default class TUICustomerServer {
|
|
|
78
90
|
TUIChatEngine.chat.callExperimentalAPI('isFeatureEnabledForStat', Math.pow(2, 42));
|
|
79
91
|
})
|
|
80
92
|
.catch((error) => {
|
|
81
|
-
Toast({
|
|
93
|
+
let loginFailToast = Toast({
|
|
82
94
|
message: TUITranslateService.t('TUIChat.登录失败'),
|
|
83
95
|
type: TOAST_TYPE.ERROR,
|
|
84
96
|
duration: 30000,
|
|
85
97
|
});
|
|
98
|
+
this.loginFailToasts.push(loginFailToast);
|
|
86
99
|
Log.l(error);
|
|
87
100
|
})
|
|
88
101
|
}
|
|
@@ -131,10 +144,16 @@ export default class TUICustomerServer {
|
|
|
131
144
|
if (nickName) {
|
|
132
145
|
// chat 个人资料的昵称是 nick
|
|
133
146
|
this.myProfile.nick = nickName;
|
|
147
|
+
} else {
|
|
148
|
+
this.myProfile.nick = '';
|
|
134
149
|
}
|
|
150
|
+
|
|
135
151
|
if (avatar) {
|
|
136
152
|
this.myProfile.avatar = avatar;
|
|
153
|
+
} else {
|
|
154
|
+
this.myProfile.avatar = USER_DEFAULT_AVATAR;
|
|
137
155
|
}
|
|
156
|
+
|
|
138
157
|
if (customerServiceID) {
|
|
139
158
|
this.currentCustomerServiceID = customerServiceID;
|
|
140
159
|
if (!this.customerServiceIDList.includes(this.currentCustomerServiceID)) {
|
|
@@ -146,7 +165,7 @@ export default class TUICustomerServer {
|
|
|
146
165
|
|
|
147
166
|
public async unInit() {
|
|
148
167
|
this.isLoggedIn = false;
|
|
149
|
-
this.
|
|
168
|
+
this.clearToasts();
|
|
150
169
|
return TUIChatEngine.logout();
|
|
151
170
|
}
|
|
152
171
|
|
package/utils/utils.ts
CHANGED
|
@@ -363,4 +363,17 @@ export function validateUserID(userID: string) {
|
|
|
363
363
|
|
|
364
364
|
export function updateCustomStore(key: string, data: {conversationID: string, value: boolean}) {
|
|
365
365
|
TUIStore.update(StoreName.CUSTOM, key, data);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export function debounce(func, delay) {
|
|
369
|
+
let timeoutID;
|
|
370
|
+
return function (this: any, ...args) {
|
|
371
|
+
const context = this;
|
|
372
|
+
if (timeoutID) {
|
|
373
|
+
clearTimeout(timeoutID);
|
|
374
|
+
}
|
|
375
|
+
timeoutID = setTimeout(() => {
|
|
376
|
+
func.apply(context, args);
|
|
377
|
+
}, delay);
|
|
378
|
+
}
|
|
366
379
|
}
|
package/assets/keyboard_icon.png
DELETED
|
Binary file
|