@tencentcloud/ai-desk-customer-vue 0.1.2 → 0.1.3
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/components/CustomerServiceChat/index-web.vue +1 -0
- package/components/CustomerServiceChat/message-input/index-web.vue +17 -16
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +3 -6
- package/components/CustomerServiceChat/style/h5.scss +2 -1
- package/package.json +4 -5
- package/server.ts +1 -20
|
@@ -129,6 +129,7 @@ const loginCustomerUIKit = () => {
|
|
|
129
129
|
console.log("ai-desk-customer login success");
|
|
130
130
|
let conversationID = 'C2C@customer_service_account';
|
|
131
131
|
TUIConversationService.switchConversation(conversationID);
|
|
132
|
+
TUIChatEngine.chat.callExperimentalAPI('isFeatureEnabledForStat', Math.pow(2, 42));
|
|
132
133
|
}).catch((error) => {
|
|
133
134
|
console.log(error);
|
|
134
135
|
})
|
|
@@ -24,13 +24,10 @@
|
|
|
24
24
|
@sendMessage="sendMessage"
|
|
25
25
|
/>
|
|
26
26
|
<div v-if="isH5" class="emoji-icon" id="emoji-icon-h5" @click="emojiShow">
|
|
27
|
-
<Icon :file="emojiIcon" width="
|
|
27
|
+
<Icon :file="emojiIcon" width="24px" height="24px"/>
|
|
28
28
|
</div>
|
|
29
29
|
<div v-if="isH5" class="tool-icon" @click="toolShow">
|
|
30
|
-
<Icon :file="toolIcon" width="
|
|
31
|
-
</div>
|
|
32
|
-
<div v-if="isH5" class="send-btn-h5" @click="sendMessage">
|
|
33
|
-
发送
|
|
30
|
+
<Icon :file="toolIcon" width="24px" height="24px"/>
|
|
34
31
|
</div>
|
|
35
32
|
</div>
|
|
36
33
|
|
|
@@ -185,21 +182,25 @@ defineExpose({
|
|
|
185
182
|
}
|
|
186
183
|
.emoji-icon {
|
|
187
184
|
background: #fff;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
185
|
+
border-radius: 0 10px 10px 0;
|
|
186
|
+
padding: 5px;
|
|
187
|
+
display: flex;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
align-items: center;
|
|
190
|
+
border: none;
|
|
193
191
|
}
|
|
192
|
+
|
|
194
193
|
.tool-icon {
|
|
195
194
|
background: #fff;
|
|
196
|
-
margin-left:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
195
|
+
margin-left: 5px;
|
|
196
|
+
margin-right: 10px;
|
|
197
|
+
border-radius: 10px;
|
|
198
|
+
padding: 5px;
|
|
199
|
+
display: flex;
|
|
200
|
+
justify-content: center;
|
|
201
|
+
align-items: center;
|
|
202
202
|
}
|
|
203
|
+
|
|
203
204
|
.input-tool-dialog{
|
|
204
205
|
height: fit-content;
|
|
205
206
|
background: #fff;
|
|
@@ -203,9 +203,6 @@ onUnmounted(() => {
|
|
|
203
203
|
});
|
|
204
204
|
|
|
205
205
|
function handleEnter(e: any) {
|
|
206
|
-
if (isH5) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
206
|
e?.preventDefault();
|
|
210
207
|
e?.stopPropagation();
|
|
211
208
|
if (e.keyCode === 13 && e.ctrlKey) {
|
|
@@ -752,13 +749,13 @@ defineExpose({
|
|
|
752
749
|
.message-input-editor-container-h5 {
|
|
753
750
|
box-sizing: border-box;
|
|
754
751
|
flex: 1;
|
|
755
|
-
height:
|
|
752
|
+
height: 34px;
|
|
756
753
|
background: #fff;
|
|
757
|
-
border-radius:
|
|
754
|
+
border-radius: 10px 0 0 10px;
|
|
758
755
|
padding: 8px 0 8px 10px;
|
|
759
756
|
font-size: 16px !important;
|
|
760
757
|
max-height: 86px;
|
|
761
|
-
margin
|
|
758
|
+
margin: 10px 0 0 10px;
|
|
762
759
|
overflow: hidden;
|
|
763
760
|
|
|
764
761
|
.message-input-editor-area {
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
.tui-chat-h5 {
|
|
8
8
|
background-image:url("../../../assets/background_mobile.png");
|
|
9
9
|
background-size: cover;
|
|
10
|
+
height: 100vh;
|
|
10
11
|
&-message-list {
|
|
11
12
|
flex: 1;
|
|
12
13
|
overflow: hidden;
|
|
@@ -14,7 +15,7 @@
|
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
&-message-input {
|
|
17
|
-
height:
|
|
18
|
+
height: auto;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
&-message-input-toolbar {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tencentcloud/ai-desk-customer-vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "chat uikit ai-desk-customer",
|
|
5
5
|
"main": "index",
|
|
6
6
|
"keywords": [
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"publish:uniapp": "cd ../tui-customer-service-plugin-uniapp && ls && npm publish --access public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@tencentcloud/chat-uikit-engine": "
|
|
26
|
-
"@tencentcloud/tui-core": "
|
|
25
|
+
"@tencentcloud/chat-uikit-engine": "^2.4.2",
|
|
26
|
+
"@tencentcloud/tui-core": "^2.4.0",
|
|
27
27
|
"@tencentcloud/tui-emoji-plugin": "latest",
|
|
28
|
-
"@tencentcloud/universal-api": "
|
|
28
|
+
"@tencentcloud/universal-api": "^2.4.0",
|
|
29
29
|
"@tiptap/core": "2.0.0-beta.220",
|
|
30
30
|
"@tiptap/extension-document": "2.0.0-beta.220",
|
|
31
31
|
"@tiptap/extension-image": "2.0.0-beta.220",
|
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
"vue-clipboard3": "2.0.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@tencentcloud/tui-core": "latest",
|
|
48
47
|
"@vue/composition-api": "^1.0.0-rc.1",
|
|
49
48
|
"vue": "^2.0.0 || >=3.0.0"
|
|
50
49
|
},
|
package/server.ts
CHANGED
|
@@ -14,7 +14,6 @@ export default class TUICustomerServer {
|
|
|
14
14
|
console.log('TUICustomerServer.init ok');
|
|
15
15
|
TUICore.registerService(TUIConstants.TUICustomerServicePlugin.SERVICE.NAME, this);
|
|
16
16
|
TUICore.registerExtension(TUIConstants.TUIContact.EXTENSION.CONTACT_LIST.EXT_ID, this);
|
|
17
|
-
// TUICore.registerEvent(TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, this);
|
|
18
17
|
this.customerServiceAccounts = ['@customer_service_account'];
|
|
19
18
|
}
|
|
20
19
|
|
|
@@ -25,25 +24,6 @@ export default class TUICustomerServer {
|
|
|
25
24
|
return TUICustomerServer.instance;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
public onNotifyEvent(eventName: string, subKey: string, params?: Record<string, any>) {
|
|
29
|
-
if (eventName === TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED) {
|
|
30
|
-
switch (subKey) {
|
|
31
|
-
case TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS:
|
|
32
|
-
const { chat, SDKAppID, userID, userSig } = TUILogin.getContext();
|
|
33
|
-
|
|
34
|
-
TUIChatEngine.login({
|
|
35
|
-
chat,
|
|
36
|
-
SDKAppID,
|
|
37
|
-
userID,
|
|
38
|
-
userSig,
|
|
39
|
-
});
|
|
40
|
-
TUIConversationService.switchConversation('C2C@customer_service_account');
|
|
41
|
-
TUICore.unregisterEvent(TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED, TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, this);
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
27
|
static loginCustomerUIKit(SDKAppID:number, userID:string, userSig:string) {
|
|
48
28
|
TUIChatEngine.login({
|
|
49
29
|
SDKAppID,
|
|
@@ -53,6 +33,7 @@ export default class TUICustomerServer {
|
|
|
53
33
|
}).then(() => {
|
|
54
34
|
console.log("login success");
|
|
55
35
|
TUIConversationService.switchConversation('C2C@customer_service_account');
|
|
36
|
+
TUIChatEngine.chat.callExperimentalAPI('isFeatureEnabledForStat', Math.pow(2, 42));
|
|
56
37
|
})
|
|
57
38
|
.catch((error) => {
|
|
58
39
|
console.log(error);
|