@tencentcloud/ai-desk-customer-vue 0.1.2 → 0.1.4
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 +7 -14
- 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/message-input/message-input-quote/index.vue +3 -14
- package/components/CustomerServiceChat/message-input-toolbar/emoji-dialog-mobile/emoji-dialog-mobile.vue +2 -5
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue +8 -15
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +3 -7
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +6 -44
- package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +1 -14
- package/components/CustomerServiceChat/message-input-toolbar/style/uni.scss +0 -56
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/index.vue +4 -7
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/index.scss +0 -1
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +7 -50
- package/components/CustomerServiceChat/message-list/index-web.vue +3 -7
- package/components/CustomerServiceChat/message-list/message-elements/{plugins/plugin-components → message-desk}/index.ts +1 -1
- package/components/{customer-icon.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/customer-icon.vue} +0 -9
- package/components/CustomerServiceChat/message-list/message-elements/{plugins/plugin-components/message-customer → message-desk/message-desk-elements}/index.ts +1 -1
- package/components/{message-branch.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-branch.vue} +4 -4
- package/components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-desk.vue +126 -0
- package/components/{message-multi-branch → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch}/branch-pc.vue +1 -1
- package/components/{message-multi-branch → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-branch}/index.vue +2 -3
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-mobile/form-popup.vue +2 -3
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-mobile/input-mobile.vue +1 -1
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-mobile/radios-mobile.vue +7 -7
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-pc/input-pc.vue +1 -1
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-pc/radio-pc.vue +4 -5
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/form-mobile.vue +8 -7
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/form-pc.vue +5 -5
- package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/index.vue +3 -3
- package/components/{message-product-card.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-product-card.vue} +2 -2
- package/components/{message-rating → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating}/index.vue +4 -4
- package/components/{message-rating → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating}/message-rating-number.vue +3 -3
- package/components/{message-rating → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rating}/message-rating-star.vue +5 -5
- package/components/{message-rich-text.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-rich-text.vue} +5 -17
- package/components/{message-robot-welcome.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-robot-welcome.vue} +7 -7
- package/components/{message-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-single-form}/form-input.vue +5 -5
- package/components/{message-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-single-form}/index.vue +1 -1
- package/components/{message-stream.vue → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-stream.vue} +2 -2
- package/{styles → components/CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/styles}/common.scss +1 -1
- package/components/CustomerServiceChat/message-list/message-elements/{plugins/plugin-components → message-desk}/message-plugin-layout-web.vue +2 -9
- package/components/CustomerServiceChat/message-list/message-elements/{plugins/plugin-components → message-desk}/message-plugin-web.vue +5 -5
- package/components/CustomerServiceChat/message-list/message-elements/message-quote/index-web.vue +2 -4
- package/components/CustomerServiceChat/message-list/message-elements/message-record/index.vue +3 -6
- package/components/CustomerServiceChat/message-list/message-elements/simple-message-list/index.vue +3 -29
- package/components/CustomerServiceChat/style/h5.scss +2 -1
- package/components/CustomerServiceChat/style/index.scss +0 -2
- package/components/common/Avatar/index.vue +2 -23
- package/components/common/BottomPopup/index.vue +2 -3
- package/components/common/Dialog/index.vue +2 -2
- package/components/common/ImagePreviewer/index-web.vue +2 -84
- package/components/common/ProgressMessage/index.vue +0 -8
- package/index.ts +4 -13
- package/index.vue +1 -60
- package/package.json +4 -5
- package/server.ts +3 -32
- package/utils/chatStorage.ts +2 -11
- package/utils/index.ts +2 -1
- package/assets/audio-before-delete.svg +0 -4
- package/assets/audio-blue.png +0 -0
- package/assets/audio-bubble-blue.svg +0 -3
- package/assets/audio-bubble-red.svg +0 -3
- package/assets/audio-delete.svg +0 -10
- package/assets/audio.svg +0 -6
- package/assets/camera-uni.png +0 -0
- package/assets/face-uni.png +0 -0
- package/assets/more-uni.png +0 -0
- package/assets/translate.svg +0 -12
- package/assets/video-uni.png +0 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/uni.scss +0 -36
- package/components/CustomerServiceChat/message-list/link/index.ts +0 -23
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-customer/message-customer-service.vue +0 -22
- package/components/CustomerServiceChat/style/uni.scss +0 -12
- package/components/CustomerServiceChat/style/wx.scss +0 -5
- package/components/common/RichText/LICENSE +0 -21
- package/components/common/RichText/README.md +0 -244
- package/components/common/RichText/dist/mp-alipay/index.acss +0 -1
- package/components/common/RichText/dist/mp-alipay/index.axml +0 -1
- package/components/common/RichText/dist/mp-alipay/index.js +0 -8
- package/components/common/RichText/dist/mp-alipay/index.json +0 -1
- package/components/common/RichText/dist/mp-alipay/node/node.acss +0 -1
- package/components/common/RichText/dist/mp-alipay/node/node.axml +0 -1
- package/components/common/RichText/dist/mp-alipay/node/node.js +0 -1
- package/components/common/RichText/dist/mp-alipay/node/node.json +0 -1
- package/components/common/RichText/dist/mp-alipay/parser.js +0 -1
- package/components/common/RichText/dist/mp-baidu/index.css +0 -1
- package/components/common/RichText/dist/mp-baidu/index.js +0 -8
- package/components/common/RichText/dist/mp-baidu/index.json +0 -1
- package/components/common/RichText/dist/mp-baidu/index.swan +0 -1
- package/components/common/RichText/dist/mp-baidu/node/node.css +0 -1
- package/components/common/RichText/dist/mp-baidu/node/node.js +0 -1
- package/components/common/RichText/dist/mp-baidu/node/node.json +0 -1
- package/components/common/RichText/dist/mp-baidu/node/node.swan +0 -1
- package/components/common/RichText/dist/mp-baidu/parser.js +0 -1
- package/components/common/RichText/dist/mp-qq/index.js +0 -8
- package/components/common/RichText/dist/mp-qq/index.json +0 -1
- package/components/common/RichText/dist/mp-qq/index.qml +0 -1
- package/components/common/RichText/dist/mp-qq/index.qss +0 -1
- package/components/common/RichText/dist/mp-qq/node/node.js +0 -1
- package/components/common/RichText/dist/mp-qq/node/node.json +0 -1
- package/components/common/RichText/dist/mp-qq/node/node.qml +0 -1
- package/components/common/RichText/dist/mp-qq/node/node.qss +0 -1
- package/components/common/RichText/dist/mp-qq/parser.js +0 -1
- package/components/common/RichText/dist/mp-toutiao/index.js +0 -8
- package/components/common/RichText/dist/mp-toutiao/index.json +0 -1
- package/components/common/RichText/dist/mp-toutiao/index.ttml +0 -1
- package/components/common/RichText/dist/mp-toutiao/index.ttss +0 -1
- package/components/common/RichText/dist/mp-toutiao/node/node.js +0 -1
- package/components/common/RichText/dist/mp-toutiao/node/node.json +0 -1
- package/components/common/RichText/dist/mp-toutiao/node/node.ttml +0 -1
- package/components/common/RichText/dist/mp-toutiao/node/node.ttss +0 -1
- package/components/common/RichText/dist/mp-toutiao/parser.js +0 -1
- package/components/common/RichText/dist/mp-weixin/index.js +0 -8
- package/components/common/RichText/dist/mp-weixin/index.json +0 -1
- package/components/common/RichText/dist/mp-weixin/index.wxml +0 -1
- package/components/common/RichText/dist/mp-weixin/index.wxss +0 -1
- package/components/common/RichText/dist/mp-weixin/node/node.js +0 -1
- package/components/common/RichText/dist/mp-weixin/node/node.json +0 -1
- package/components/common/RichText/dist/mp-weixin/node/node.wxml +0 -1
- package/components/common/RichText/dist/mp-weixin/node/node.wxss +0 -1
- package/components/common/RichText/dist/mp-weixin/parser.js +0 -1
- package/components/common/RichText/dist/uni-app/components/mp-html/mp-html.vue +0 -498
- package/components/common/RichText/dist/uni-app/components/mp-html/node/node.vue +0 -587
- package/components/common/RichText/dist/uni-app/components/mp-html/parser.js +0 -1393
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/js/handler.js +0 -1
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/js/uni.webview.min.js +0 -1
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/local.html +0 -1
- package/components/common/RichText/docs/.nojekyll +0 -0
- package/components/common/RichText/docs/index.html +0 -50
- package/components/common/RichText/docs/lib/docsify.min.js +0 -1
- package/components/common/RichText/docs/lib/prism-bash.min.js +0 -1
- package/components/common/RichText/docs/lib/search.min.js +0 -1
- package/components/common/RichText/docs/lib/vue.css +0 -858
- package/components/common/RichText/gulpfile.js +0 -113
- package/components/common/RichText/lint.js +0 -63
- package/components/common/RichText/package.json +0 -74
- package/components/common/RichText/plugins/README.md +0 -2
- package/components/common/RichText/plugins/audio/README.md +0 -25
- package/components/common/RichText/plugins/audio/build.js +0 -11
- package/components/common/RichText/plugins/audio/context.js +0 -7
- package/components/common/RichText/plugins/audio/index.js +0 -34
- package/components/common/RichText/plugins/audio/miniprogram/audio.js +0 -189
- package/components/common/RichText/plugins/audio/miniprogram/audio.json +0 -3
- package/components/common/RichText/plugins/audio/miniprogram/audio.wxml +0 -17
- package/components/common/RichText/plugins/audio/miniprogram/audio.wxss +0 -127
- package/components/common/RichText/plugins/audio/miniprogram/build.js +0 -3
- package/components/common/RichText/plugins/audio/uni-app/audio.vue +0 -269
- package/components/common/RichText/plugins/audio/uni-app/build.js +0 -3
- package/components/common/RichText/plugins/card/README.md +0 -30
- package/components/common/RichText/plugins/card/build.js +0 -14
- package/components/common/RichText/plugins/card/index.js +0 -7
- package/components/common/RichText/plugins/card/miniprogram/build.js +0 -3
- package/components/common/RichText/plugins/card/miniprogram/card.js +0 -26
- package/components/common/RichText/plugins/card/miniprogram/card.json +0 -3
- package/components/common/RichText/plugins/card/miniprogram/card.wxml +0 -9
- package/components/common/RichText/plugins/card/miniprogram/card.wxss +0 -55
- package/components/common/RichText/plugins/card/uni-app/build.js +0 -3
- package/components/common/RichText/plugins/card/uni-app/card.vue +0 -122
- package/components/common/RichText/plugins/editable/README.md +0 -137
- package/components/common/RichText/plugins/editable/config.js +0 -15
- package/components/common/RichText/plugins/editable/miniprogram/build.js +0 -813
- package/components/common/RichText/plugins/editable/miniprogram/index.js +0 -551
- package/components/common/RichText/plugins/editable/uni-app/build.js +0 -744
- package/components/common/RichText/plugins/editable/uni-app/index.js +0 -553
- package/components/common/RichText/plugins/emoji/README.md +0 -15
- package/components/common/RichText/plugins/emoji/index.js +0 -203
- package/components/common/RichText/plugins/highlight/README.md +0 -26
- package/components/common/RichText/plugins/highlight/config.js +0 -5
- package/components/common/RichText/plugins/highlight/index.js +0 -96
- package/components/common/RichText/plugins/highlight/miniprogram/build.js +0 -88
- package/components/common/RichText/plugins/highlight/prism.css +0 -125
- package/components/common/RichText/plugins/highlight/prism.min.js +0 -7
- package/components/common/RichText/plugins/highlight/uni-app/build.js +0 -88
- package/components/common/RichText/plugins/img-cache/README.md +0 -24
- package/components/common/RichText/plugins/img-cache/build.js +0 -16
- package/components/common/RichText/plugins/img-cache/index.js +0 -138
- package/components/common/RichText/plugins/latex/README.md +0 -16
- package/components/common/RichText/plugins/latex/build.js +0 -14
- package/components/common/RichText/plugins/latex/index.js +0 -77
- package/components/common/RichText/plugins/latex/katex.css +0 -1070
- package/components/common/RichText/plugins/latex/katex.min.js +0 -1
- package/components/common/RichText/plugins/markdown/README.md +0 -17
- package/components/common/RichText/plugins/markdown/index.js +0 -34
- package/components/common/RichText/plugins/markdown/marked.min.js +0 -6
- package/components/common/RichText/plugins/markdown/miniprogram/build.js +0 -70
- package/components/common/RichText/plugins/markdown/uni-app/build.js +0 -68
- package/components/common/RichText/plugins/search/README.md +0 -46
- package/components/common/RichText/plugins/search/miniprogram/index.js +0 -137
- package/components/common/RichText/plugins/search/uni-app/index.js +0 -132
- package/components/common/RichText/plugins/style/README.md +0 -30
- package/components/common/RichText/plugins/style/index.js +0 -129
- package/components/common/RichText/plugins/style/parser.js +0 -175
- package/components/common/RichText/plugins/template/README.md +0 -2
- package/components/common/RichText/plugins/template/build.js +0 -65
- package/components/common/RichText/plugins/template/index.js +0 -67
- package/components/common/RichText/plugins/txv-video/README.md +0 -18
- package/components/common/RichText/plugins/txv-video/build.js +0 -3
- package/components/common/RichText/plugins/txv-video/index.js +0 -46
- package/components/common/RichText/plugins/txv-video/miniprogram/build.js +0 -6
- package/components/common/RichText/plugins/txv-video/uni-app/build.js +0 -3
- package/components/common/RichText/src/miniprogram/index.js +0 -396
- package/components/common/RichText/src/miniprogram/index.json +0 -6
- package/components/common/RichText/src/miniprogram/index.wxml +0 -7
- package/components/common/RichText/src/miniprogram/index.wxss +0 -13
- package/components/common/RichText/src/miniprogram/node/node.js +0 -247
- package/components/common/RichText/src/miniprogram/node/node.json +0 -6
- package/components/common/RichText/src/miniprogram/node/node.wxml +0 -112
- package/components/common/RichText/src/miniprogram/node/node.wxss +0 -164
- package/components/common/RichText/src/miniprogram/parser.js +0 -1269
- package/components/common/RichText/src/uni-app/components/mp-html/mp-html.vue +0 -498
- package/components/common/RichText/src/uni-app/components/mp-html/node/node.vue +0 -585
- package/components/common/RichText/src/uni-app/components/mp-html/parser.js +0 -1393
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/js/handler.js +0 -254
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/js/uni.webview.min.js +0 -1
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/local.html +0 -33
- package/components/common/RichText/tools/config.js +0 -82
- package/components/common/RichText/tools/converter.js +0 -205
- package/components/common/RichText/tools/ifdef.js +0 -115
- package/components/common/RichText/tools/minifier.js +0 -40
- package/components/common/RichText/tools/plugin.js +0 -248
- package/components/message-customer-service.vue +0 -114
- package/script/fileCopy.js +0 -60
- package/script/syncVersion.js +0 -35
- /package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-mobile/label-mobile.vue +0 -0
- /package/components/{message-multi-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-multi-form}/component-pc/label-pc.vue +0 -0
- /package/components/{message-form → CustomerServiceChat/message-list/message-elements/message-desk/message-desk-elements/message-single-form}/form-branch.vue +0 -0
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
<ChatHeader
|
|
8
8
|
:class="[
|
|
9
9
|
'tui-chat-header',
|
|
10
|
-
!isPC && 'tui-chat-H5-header'
|
|
11
|
-
isUniFrameWork && 'tui-chat-uniapp-header',
|
|
10
|
+
!isPC && 'tui-chat-H5-header'
|
|
12
11
|
]"
|
|
13
12
|
:canCloseChat="props.canCloseChat"
|
|
14
13
|
@closeChat="closeChat"
|
|
@@ -23,8 +22,7 @@
|
|
|
23
22
|
v-if="isInputToolbarShow"
|
|
24
23
|
:class="[
|
|
25
24
|
'tui-chat-message-input-toolbar',
|
|
26
|
-
!isPC && 'tui-chat-h5-message-input-toolbar'
|
|
27
|
-
isUniFrameWork && 'tui-chat-uni-message-input-toolbar',
|
|
25
|
+
!isPC && 'tui-chat-h5-message-input-toolbar'
|
|
28
26
|
]"
|
|
29
27
|
:displayType="inputToolbarDisplayType"
|
|
30
28
|
@insertEmoji="insertEmoji"
|
|
@@ -35,9 +33,7 @@
|
|
|
35
33
|
ref="messageInputRef"
|
|
36
34
|
:class="[
|
|
37
35
|
'tui-chat-message-input',
|
|
38
|
-
!isPC && 'tui-chat-h5-message-input'
|
|
39
|
-
isUniFrameWork && 'tui-chat-uni-message-input',
|
|
40
|
-
isWeChat && 'tui-chat-wx-message-input',
|
|
36
|
+
!isPC && 'tui-chat-h5-message-input'
|
|
41
37
|
]"
|
|
42
38
|
:isMuted="false"
|
|
43
39
|
:muteText="TUITranslateService.t('TUIChat.您已被管理员禁言')"
|
|
@@ -60,8 +56,7 @@
|
|
|
60
56
|
v-if="!isPC"
|
|
61
57
|
:class="[
|
|
62
58
|
'tui-chat-message-input-toolbar',
|
|
63
|
-
!isPC && 'tui-chat-h5-message-input-toolbar'
|
|
64
|
-
isUniFrameWork && 'tui-chat-uni-message-input-toolbar',
|
|
59
|
+
!isPC && 'tui-chat-h5-message-input-toolbar'
|
|
65
60
|
]"
|
|
66
61
|
:isH5ToolShow="toolShowH5"
|
|
67
62
|
:displayType="inputToolbarDisplayType"
|
|
@@ -91,7 +86,7 @@ import MessageList from './message-list/index-web.vue';
|
|
|
91
86
|
import MessageInput from './message-input/index-web.vue';
|
|
92
87
|
import MessageInputToolbar from './message-input-toolbar/index-web.vue';
|
|
93
88
|
import EmojiDialog from './message-input-toolbar/emoji-dialog-mobile/emoji-dialog-mobile.vue';
|
|
94
|
-
import { isPC, isH5
|
|
89
|
+
import { isPC, isH5} from '../../utils/env';
|
|
95
90
|
import { ToolbarDisplayType } from '../../interface';
|
|
96
91
|
|
|
97
92
|
|
|
@@ -129,6 +124,7 @@ const loginCustomerUIKit = () => {
|
|
|
129
124
|
console.log("ai-desk-customer login success");
|
|
130
125
|
let conversationID = 'C2C@customer_service_account';
|
|
131
126
|
TUIConversationService.switchConversation(conversationID);
|
|
127
|
+
TUIChatEngine.chat.callExperimentalAPI('isFeatureEnabledForStat', Math.pow(2, 42));
|
|
132
128
|
}).catch((error) => {
|
|
133
129
|
console.log(error);
|
|
134
130
|
})
|
|
@@ -156,7 +152,7 @@ onUnmounted(() => {
|
|
|
156
152
|
});
|
|
157
153
|
|
|
158
154
|
const isInputToolbarShow = computed<boolean>(() => {
|
|
159
|
-
return (
|
|
155
|
+
return (isH5) ? inputToolbarDisplayType.value !== 'none' : true;
|
|
160
156
|
});
|
|
161
157
|
|
|
162
158
|
const reset = () => {
|
|
@@ -197,9 +193,6 @@ const handleEditor = (message: IMessageModel, type: string) => {
|
|
|
197
193
|
function changeToolbarDisplayType(type: ToolbarDisplayType) {
|
|
198
194
|
inputToolbarDisplayType.value
|
|
199
195
|
= inputToolbarDisplayType.value === type ? 'none' : type;
|
|
200
|
-
if (inputToolbarDisplayType.value !== 'none' && isUniFrameWork) {
|
|
201
|
-
uni.$emit('scroll-to-bottom');
|
|
202
|
-
}
|
|
203
196
|
}
|
|
204
197
|
|
|
205
198
|
function scrollToLatestMessage() {
|
|
@@ -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 {
|
|
@@ -3,17 +3,13 @@
|
|
|
3
3
|
v-if="Boolean(quoteMessage) && props.displayType !== 'audio'"
|
|
4
4
|
:class="{
|
|
5
5
|
'input-quote-container': true,
|
|
6
|
-
|
|
7
|
-
'input-quote-container-h5': isH5 || isUniFrameWork,
|
|
6
|
+
'input-quote-container-h5': isH5,
|
|
8
7
|
}"
|
|
9
8
|
>
|
|
10
9
|
<div :class="(!isPC) ? 'input-quote-content-h5' :'input-quote-content'">
|
|
11
10
|
<div>
|
|
12
|
-
<div v-if="isUniFrameWork" class="input-quote-sender-h5">
|
|
13
|
-
{{ quoteMessage.nick || quoteMessage.from }}
|
|
14
|
-
</div>
|
|
15
11
|
<div class="max-one-line">
|
|
16
|
-
{{
|
|
12
|
+
{{ (quoteMessage.nick || quoteMessage.from)+ ': ' + quoteContentText }}
|
|
17
13
|
</div>
|
|
18
14
|
</div>
|
|
19
15
|
<Icon
|
|
@@ -39,7 +35,7 @@ import TUIChatEngine, {
|
|
|
39
35
|
} from '@tencentcloud/chat-uikit-engine';
|
|
40
36
|
import Icon from '../../../common/Icon.vue';
|
|
41
37
|
import closeIcon from '../../../../assets/close-quote-icon.svg';
|
|
42
|
-
import { isPC,isH5
|
|
38
|
+
import { isPC,isH5 } from '../../../../utils/env';
|
|
43
39
|
import { transformTextWithKeysToEmojiNames } from '../../emoji-config';
|
|
44
40
|
import { InputDisplayType } from '../../../../interface';
|
|
45
41
|
const { ref, computed, onMounted, onUnmounted } = vue;
|
|
@@ -187,13 +183,6 @@ function onQuoteMessageUpdated(options?: {
|
|
|
187
183
|
max-width: 500px;
|
|
188
184
|
}
|
|
189
185
|
|
|
190
|
-
.input-quote-container-uni {
|
|
191
|
-
@extend %common-container-style;
|
|
192
|
-
|
|
193
|
-
width: fit-content;
|
|
194
|
-
max-width: 250px;
|
|
195
|
-
margin: 5px 60px 0 30px;
|
|
196
|
-
}
|
|
197
186
|
|
|
198
187
|
.input-quote-container-h5 {
|
|
199
188
|
@extend %common-container-style;
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
convertKeyToEmojiName,
|
|
41
41
|
} from '../../emoji-config';
|
|
42
42
|
import { EMOJI_TYPE } from '.././../../../constant';
|
|
43
|
-
import { isPC,
|
|
43
|
+
import { isPC, } from '../../../../utils/env';
|
|
44
44
|
|
|
45
45
|
const emits = defineEmits(['insertEmoji', 'onClose', 'sendMessage']);
|
|
46
46
|
const list = ref<IEmojiGroupList>(initEmojiList());
|
|
@@ -70,11 +70,8 @@ const select = (item: any, index: number) => {
|
|
|
70
70
|
switch (currentTabItem?.value?.type) {
|
|
71
71
|
case EMOJI_TYPE.BASIC:
|
|
72
72
|
options.url = currentTabItem?.value?.url + BASIC_EMOJI_URL_MAPPING[item];
|
|
73
|
-
if (isUniFrameWork) {
|
|
74
|
-
uni.$emit('insert-emoji', options);
|
|
75
|
-
} else {
|
|
76
73
|
emits('insertEmoji', options);
|
|
77
|
-
|
|
74
|
+
|
|
78
75
|
break;
|
|
79
76
|
case EMOJI_TYPE.BIG:
|
|
80
77
|
// sendFaceMessage(index, currentTabItem.value);
|
package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue
CHANGED
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
>
|
|
58
58
|
</li>
|
|
59
59
|
<li
|
|
60
|
-
v-if="
|
|
60
|
+
v-if="isH5"
|
|
61
61
|
class="send-btn"
|
|
62
62
|
@click="sendMessage"
|
|
63
63
|
>
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
import Icon from '../../../common/Icon.vue';
|
|
79
79
|
import faceIcon from '../../../../assets/face.png';
|
|
80
80
|
import { EMOJI_TYPE } from '.././../../../constant';
|
|
81
|
-
import { isPC,
|
|
81
|
+
import { isPC, isH5 } from '../../../../utils/env';
|
|
82
82
|
import { IEmojiGroupList, IEmojiGroup } from '../../../../interface';
|
|
83
83
|
import { isEnabledMessageReadReceiptGlobal } from '../../../../utils/utils';
|
|
84
84
|
import {
|
|
@@ -114,9 +114,8 @@ const toggleEmojiTab = (index: number) => {
|
|
|
114
114
|
currentTabItem.value = list?.value[index];
|
|
115
115
|
currentEmojiList.value = list?.value[index]?.list;
|
|
116
116
|
// web & h5 side scroll to top
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
117
|
+
emojiPickerListRef?.value && (emojiPickerListRef.value.scrollTop = 0);
|
|
118
|
+
|
|
120
119
|
};
|
|
121
120
|
|
|
122
121
|
const select = (item: any, index: number) => {
|
|
@@ -127,11 +126,8 @@ const select = (item: any, index: number) => {
|
|
|
127
126
|
switch (currentTabItem?.value?.type) {
|
|
128
127
|
case EMOJI_TYPE.BASIC:
|
|
129
128
|
options.url = currentTabItem?.value?.url + BASIC_EMOJI_URL_MAPPING[item];
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
} else {
|
|
133
|
-
emits('insertEmoji', options);
|
|
134
|
-
}
|
|
129
|
+
emits('insertEmoji', options);
|
|
130
|
+
|
|
135
131
|
break;
|
|
136
132
|
case EMOJI_TYPE.BIG:
|
|
137
133
|
sendFaceMessage(index, currentTabItem.value);
|
|
@@ -161,11 +157,8 @@ const sendFaceMessage = (index: number, listItem: IEmojiGroup) => {
|
|
|
161
157
|
};
|
|
162
158
|
|
|
163
159
|
function sendMessage() {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}else{
|
|
167
|
-
emits('sendMessage');
|
|
168
|
-
}
|
|
160
|
+
emits('sendMessage');
|
|
161
|
+
|
|
169
162
|
}
|
|
170
163
|
|
|
171
164
|
function onCurrentConversationUpdate(conversation: IConversationModel) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<ToolbarItemContainer
|
|
3
3
|
:iconFile="isH5?fileIconH5:fileIcon"
|
|
4
4
|
title="文件"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
iconWidth='21px'
|
|
6
|
+
iconHeight='18px'
|
|
7
7
|
:needDialog="false"
|
|
8
8
|
@onIconClick="onIconClick"
|
|
9
9
|
>
|
|
@@ -32,7 +32,7 @@ import vue from '../../../../adapter-vue';
|
|
|
32
32
|
import ToolbarItemContainer from '../toolbar-item-container/index.vue';
|
|
33
33
|
import fileIcon from '../../../../assets/files.png';
|
|
34
34
|
import fileIconH5 from '../../../../assets/file-h5.png';
|
|
35
|
-
import { isPC,
|
|
35
|
+
import { isPC, isH5 } from '../../../../utils/env';
|
|
36
36
|
import { isEnabledMessageReadReceiptGlobal } from '../../../../utils/utils';
|
|
37
37
|
const { ref } = vue;
|
|
38
38
|
|
|
@@ -46,11 +46,7 @@ TUIStore.watch(StoreName.CONV, {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const onIconClick = () => {
|
|
49
|
-
if (isUniFrameWork) {
|
|
50
|
-
return;
|
|
51
|
-
} else {
|
|
52
49
|
inputRef?.value?.click && inputRef?.value?.click();
|
|
53
|
-
}
|
|
54
50
|
};
|
|
55
51
|
|
|
56
52
|
const sendFileMessage = (e: any) => {
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
<ToolbarItemContainer
|
|
3
3
|
:iconFile="imageToolbarForShow.icon"
|
|
4
4
|
:title="imageToolbarForShow.title"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
iconWidth='21px'
|
|
6
|
+
iconHeight= '18px'
|
|
7
7
|
:needDialog="false"
|
|
8
8
|
@onIconClick="onIconClick"
|
|
9
9
|
:isH5ToolShow="isH5ToolShow"
|
|
10
10
|
>
|
|
11
11
|
<div
|
|
12
|
-
v-if="!isUniFrameWork"
|
|
13
12
|
:class="['image-upload', !isPC && 'image-upload-h5','image-video']"
|
|
14
13
|
>
|
|
15
14
|
<input
|
|
@@ -33,11 +32,10 @@ import {
|
|
|
33
32
|
} from '@tencentcloud/chat-uikit-engine';
|
|
34
33
|
import { TUIGlobal } from '@tencentcloud/universal-api';
|
|
35
34
|
import vue from '../../../../adapter-vue';
|
|
36
|
-
import { isPC, isH5
|
|
35
|
+
import { isPC, isH5 } from '../../../../utils/env';
|
|
37
36
|
import ToolbarItemContainer from '../toolbar-item-container/index.vue';
|
|
38
37
|
import imageIcon from '../../../../assets/image.png';
|
|
39
38
|
import imageUniIcon from '../../../../assets/image-uni.png';
|
|
40
|
-
import cameraUniIcon from '../../../../assets/camera-uni.png';
|
|
41
39
|
import { isEnabledMessageReadReceiptGlobal } from '../../../../utils/utils';
|
|
42
40
|
const { ref, computed } = vue;
|
|
43
41
|
|
|
@@ -65,11 +63,7 @@ const IMAGE_TOOLBAR_SHOW_MAP = {
|
|
|
65
63
|
uni_album: {
|
|
66
64
|
icon: imageUniIcon,
|
|
67
65
|
title: '图片',
|
|
68
|
-
}
|
|
69
|
-
uni_camera: {
|
|
70
|
-
icon: cameraUniIcon,
|
|
71
|
-
title: '拍照',
|
|
72
|
-
},
|
|
66
|
+
}
|
|
73
67
|
};
|
|
74
68
|
|
|
75
69
|
TUIStore.watch(StoreName.CONV, {
|
|
@@ -79,11 +73,7 @@ TUIStore.watch(StoreName.CONV, {
|
|
|
79
73
|
});
|
|
80
74
|
|
|
81
75
|
const imageToolbarForShow = computed((): { icon: string; title: string } => {
|
|
82
|
-
if
|
|
83
|
-
return props.imageSourceType === 'camera'
|
|
84
|
-
? IMAGE_TOOLBAR_SHOW_MAP['uni_camera']
|
|
85
|
-
: IMAGE_TOOLBAR_SHOW_MAP['uni_album'];
|
|
86
|
-
} else if(isH5){
|
|
76
|
+
if(isH5){
|
|
87
77
|
return IMAGE_TOOLBAR_SHOW_MAP['uni_album'];
|
|
88
78
|
}
|
|
89
79
|
else {
|
|
@@ -92,38 +82,10 @@ const imageToolbarForShow = computed((): { icon: string; title: string } => {
|
|
|
92
82
|
});
|
|
93
83
|
|
|
94
84
|
const onIconClick = () => {
|
|
95
|
-
// uni-app send image
|
|
96
|
-
if (isUniFrameWork) {
|
|
97
|
-
if (isWeChat && TUIGlobal?.chooseMedia) {
|
|
98
|
-
TUIGlobal?.chooseMedia({
|
|
99
|
-
count: 1,
|
|
100
|
-
mediaType: ['image','video'],
|
|
101
|
-
sizeType: ['original', 'compressed'],
|
|
102
|
-
sourceType: [props.imageSourceType], // Use camera or select from album.
|
|
103
|
-
success: function (res: any) {
|
|
104
|
-
if(res.tempFiles[0].fileType == 'image'){
|
|
105
|
-
sendImageMessage(res);
|
|
106
|
-
} else if(res.tempFiles[0].fileType == 'video'){
|
|
107
|
-
sendVideoMessage(res);
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
} else {
|
|
112
|
-
// uni-app H5/App send image
|
|
113
|
-
TUIGlobal?.chooseImage({
|
|
114
|
-
count: 1,
|
|
115
|
-
sourceType: [props.imageSourceType], // Use camera or select from album.
|
|
116
|
-
success: function (res) {
|
|
117
|
-
sendImageMessage(res);
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
} else {
|
|
122
|
-
console.log("imageToolbarForShow.value.icon")
|
|
123
85
|
if (inputRef.value?.click) {
|
|
124
86
|
inputRef.value.click();
|
|
125
87
|
}
|
|
126
|
-
|
|
88
|
+
|
|
127
89
|
};
|
|
128
90
|
|
|
129
91
|
const sendImageInWeb = (e: any) => {
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
:class="[
|
|
4
4
|
'message-input-toolbar',
|
|
5
5
|
!isPC && 'message-input-toolbar-h5',
|
|
6
|
-
isUniFrameWork && 'message-input-toolbar-uni',
|
|
7
6
|
]"
|
|
8
7
|
>
|
|
9
8
|
<div
|
|
10
9
|
:class="[
|
|
11
10
|
'message-input-toolbar-list',
|
|
12
11
|
!isPC && 'message-input-toolbar-h5-list',
|
|
13
|
-
isUniFrameWork && 'message-input-toolbar-uni-list',
|
|
14
12
|
]"
|
|
15
13
|
>
|
|
16
14
|
<EmojiPicker
|
|
@@ -46,7 +44,7 @@ import EmojiPicker from './emoji-picker/index.vue';
|
|
|
46
44
|
import ImageUpload from './image-upload/index.vue';
|
|
47
45
|
import FileUpload from './file-upload/index.vue';
|
|
48
46
|
import VideoUpload from './video-upload/index.vue';
|
|
49
|
-
import { isPC, isH5
|
|
47
|
+
import { isPC, isH5 } from '../../../utils/env';
|
|
50
48
|
import { ToolbarDisplayType } from '../../../interface';
|
|
51
49
|
const { ref, onMounted, onUnmounted, watch } = vue;
|
|
52
50
|
|
|
@@ -177,15 +175,4 @@ const dialogCloseInH5 = (dialogDom: any) => {
|
|
|
177
175
|
flex-direction: column;
|
|
178
176
|
}
|
|
179
177
|
|
|
180
|
-
.message-input-toolbar-uni {
|
|
181
|
-
background-color: #ebf0f6;
|
|
182
|
-
flex-direction: column;
|
|
183
|
-
|
|
184
|
-
&-list {
|
|
185
|
-
flex: 1;
|
|
186
|
-
display: grid;
|
|
187
|
-
grid-template-columns: repeat(4, 25%);
|
|
188
|
-
grid-template-rows: repeat(2, 100px);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
178
|
</style>
|
|
@@ -39,26 +39,6 @@
|
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
.message-input-toolbar-uni {
|
|
43
|
-
background-color: transparent;
|
|
44
|
-
flex-direction: column;
|
|
45
|
-
z-index: 100;
|
|
46
|
-
|
|
47
|
-
&-list {
|
|
48
|
-
flex: 1;
|
|
49
|
-
display: grid;
|
|
50
|
-
grid-template-columns: repeat(4, 25%);
|
|
51
|
-
grid-template-rows: repeat(2, 100px);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// uniapp swiper style
|
|
56
|
-
wx-swiper .wx-swiper-wrapper,
|
|
57
|
-
wx-swiper .wx-swiper-slides,
|
|
58
|
-
wx-swiper .wx-swiper-slide-frame,
|
|
59
|
-
.message-input-toolbar-list {
|
|
60
|
-
overflow: visible !important;
|
|
61
|
-
}
|
|
62
42
|
|
|
63
43
|
.message-input-toolbar {
|
|
64
44
|
|
|
@@ -72,40 +52,4 @@ wx-swiper .wx-swiper-slide-frame,
|
|
|
72
52
|
.message-input-toolbar-swiper {
|
|
73
53
|
width: 100%;
|
|
74
54
|
height: 220px;
|
|
75
|
-
|
|
76
|
-
::v-deep .uni-swiper-wrapper,
|
|
77
|
-
wx-swiper .wx-swiper-wrapper {
|
|
78
|
-
overflow: visible !important;
|
|
79
|
-
|
|
80
|
-
.uni-swiper-slides,
|
|
81
|
-
.wx-swiper-slides,
|
|
82
|
-
wx-swiper .wx-swiper-slides {
|
|
83
|
-
overflow: visible !important;
|
|
84
|
-
|
|
85
|
-
.uni-swiper-slide-frame,
|
|
86
|
-
.wx-swiper-slide-frame,
|
|
87
|
-
wx-swiper .wx-swiper-slide-frame {
|
|
88
|
-
overflow: visible !important;
|
|
89
|
-
|
|
90
|
-
.message-input-toolbar-list {
|
|
91
|
-
overflow: visible !important;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.toolbar-item-container-uni {
|
|
95
|
-
position: static !important;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.toolbar-item-container-dialog {
|
|
99
|
-
position: absolute !important;
|
|
100
|
-
background: transparent;
|
|
101
|
-
left: -10px;
|
|
102
|
-
bottom: -5px;
|
|
103
|
-
|
|
104
|
-
.bottom-popup-uni {
|
|
105
|
-
position: sticky !important;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
55
|
}
|
package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/index.vue
CHANGED
|
@@ -4,14 +4,12 @@
|
|
|
4
4
|
:class="[
|
|
5
5
|
'toolbar-item-container',
|
|
6
6
|
!isPC && 'toolbar-item-container-h5',
|
|
7
|
-
isUniFrameWork && 'toolbar-item-container-uni',
|
|
8
7
|
]"
|
|
9
8
|
>
|
|
10
9
|
<div
|
|
11
|
-
v-if="isPC || (isH5 && !isH5Emoji && isH5ToolShow)
|
|
10
|
+
v-if="isPC || (isH5 && !isH5Emoji && isH5ToolShow)"
|
|
12
11
|
:class="[
|
|
13
12
|
'toolbar-item-container-icon',
|
|
14
|
-
isUniFrameWork && 'toolbar-item-container-uni-icon',
|
|
15
13
|
isH5 && 'toolbar-item-container-h5-icon'
|
|
16
14
|
]"
|
|
17
15
|
@click="toggleToolbarItem"
|
|
@@ -24,8 +22,8 @@
|
|
|
24
22
|
/>
|
|
25
23
|
</div>
|
|
26
24
|
<div
|
|
27
|
-
v-if="
|
|
28
|
-
:class="['toolbar-item-container-
|
|
25
|
+
v-if="(isH5 && !isH5Emoji && isH5ToolShow)"
|
|
26
|
+
:class="['toolbar-item-container-h5-title']"
|
|
29
27
|
>
|
|
30
28
|
{{ props.title }}
|
|
31
29
|
</div>
|
|
@@ -35,7 +33,6 @@
|
|
|
35
33
|
:class="[
|
|
36
34
|
'toolbar-item-container-dialog',
|
|
37
35
|
!isPC && 'toolbar-item-container-h5-dialog',
|
|
38
|
-
isUniFrameWork && 'toolbar-item-container-uni-dialog',
|
|
39
36
|
]"
|
|
40
37
|
>
|
|
41
38
|
<BottomPopup
|
|
@@ -56,7 +53,7 @@ import vue from '../../../../adapter-vue';
|
|
|
56
53
|
import { outsideClick } from '@tencentcloud/universal-api';
|
|
57
54
|
import Icon from '../../../common/Icon.vue';
|
|
58
55
|
import BottomPopup from '../../../common/BottomPopup/index.vue';
|
|
59
|
-
import { isPC,
|
|
56
|
+
import { isPC, isH5 } from '../../../../utils/env';
|
|
60
57
|
const { ref } = vue;
|
|
61
58
|
|
|
62
59
|
const props = defineProps({
|
|
@@ -3,14 +3,8 @@
|
|
|
3
3
|
:iconFile="handleIcon()"
|
|
4
4
|
:title="handleTitle()"
|
|
5
5
|
:needDialog="false"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
isUniFrameWork
|
|
9
|
-
? props.videoSourceType === 'album'
|
|
10
|
-
? '20px'
|
|
11
|
-
: '25px'
|
|
12
|
-
: '18px'
|
|
13
|
-
"
|
|
6
|
+
iconWidth='21px'
|
|
7
|
+
iconHeight='18px'
|
|
14
8
|
@onIconClick="onIconClick"
|
|
15
9
|
>
|
|
16
10
|
<div :class="['video-upload', !isPC && 'video-upload-h5']">
|
|
@@ -36,11 +30,9 @@ import {
|
|
|
36
30
|
} from '@tencentcloud/chat-uikit-engine';
|
|
37
31
|
import { TUIGlobal } from '@tencentcloud/universal-api';
|
|
38
32
|
import vue from '../../../../adapter-vue';
|
|
39
|
-
import { isPC
|
|
33
|
+
import { isPC } from '../../../../utils/env';
|
|
40
34
|
import ToolbarItemContainer from '../toolbar-item-container/index.vue';
|
|
41
35
|
import videoIcon from '../../../../assets/video.png';
|
|
42
|
-
import videoUniIcon from '../../../../assets/video-uni.png';
|
|
43
|
-
import cameraUniIcon from '../../../../assets/camera-uni.png';
|
|
44
36
|
import { isEnabledMessageReadReceiptGlobal } from '../../../../utils/utils';
|
|
45
37
|
const { ref } = vue;
|
|
46
38
|
|
|
@@ -64,54 +56,19 @@ TUIStore.watch(StoreName.CONV, {
|
|
|
64
56
|
});
|
|
65
57
|
|
|
66
58
|
const handleIcon = (): string => {
|
|
67
|
-
if (isUniFrameWork) {
|
|
68
|
-
switch (props.videoSourceType) {
|
|
69
|
-
case 'album':
|
|
70
|
-
return videoUniIcon;
|
|
71
|
-
case 'camera':
|
|
72
|
-
return cameraUniIcon;
|
|
73
|
-
default:
|
|
74
|
-
return videoUniIcon;
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
59
|
return videoIcon;
|
|
78
|
-
|
|
60
|
+
|
|
79
61
|
};
|
|
80
62
|
|
|
81
63
|
const handleTitle = (): string => {
|
|
82
|
-
|
|
83
|
-
return '录制';
|
|
84
|
-
} else {
|
|
64
|
+
|
|
85
65
|
return '视频';
|
|
86
|
-
|
|
66
|
+
|
|
87
67
|
};
|
|
88
68
|
|
|
89
69
|
const onIconClick = () => {
|
|
90
|
-
// uni-app send video
|
|
91
|
-
if (isUniFrameWork) {
|
|
92
|
-
if (isWeChat && TUIGlobal?.chooseMedia) {
|
|
93
|
-
TUIGlobal?.chooseMedia({
|
|
94
|
-
mediaType: ['video'],
|
|
95
|
-
count: 1,
|
|
96
|
-
sourceType: [props.videoSourceType],
|
|
97
|
-
maxDuration: 60,
|
|
98
|
-
success: function (res: any) {
|
|
99
|
-
sendVideoMessage(res);
|
|
100
|
-
},
|
|
101
|
-
});
|
|
102
|
-
} else {
|
|
103
|
-
TUIGlobal?.chooseVideo({
|
|
104
|
-
count: 1,
|
|
105
|
-
sourceType: [props.videoSourceType],
|
|
106
|
-
compressed: false,
|
|
107
|
-
success: function (res: any) {
|
|
108
|
-
sendVideoMessage(res);
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
} else {
|
|
113
70
|
inputRef?.value?.click && inputRef?.value?.click();
|
|
114
|
-
|
|
71
|
+
|
|
115
72
|
};
|
|
116
73
|
|
|
117
74
|
const sendVideoInWeb = (e: any) => {
|