@tencentcloud/ai-desk-customer-vue 0.1.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/.code.yml +17 -0
- package/.eslintignore +6 -0
- package/.stylelintrc.json +40 -0
- package/CHANGELOG.md +5 -0
- package/README.md +12 -0
- package/adapter-vue-web.ts +73 -0
- package/adapter-vue.ts +10 -0
- package/assets/audio-before-delete.svg +4 -0
- package/assets/audio-blue.png +0 -0
- package/assets/audio-bubble-blue.svg +3 -0
- package/assets/audio-bubble-red.svg +3 -0
- package/assets/audio-delete.svg +10 -0
- package/assets/audio.svg +6 -0
- package/assets/back.svg +16 -0
- package/assets/background_mobile.png +0 -0
- package/assets/camera-uni.png +0 -0
- package/assets/close-quote-icon.svg +3 -0
- package/assets/customer_avatar.png +0 -0
- package/assets/customer_avatar_mobile.png +0 -0
- package/assets/dialog-close.png +0 -0
- package/assets/double-arrow.svg +1 -0
- package/assets/download.svg +6 -0
- package/assets/emoji.png +0 -0
- package/assets/face-uni.png +0 -0
- package/assets/face.png +0 -0
- package/assets/file-h5.png +0 -0
- package/assets/files.png +0 -0
- package/assets/form-dialog-bg.png +0 -0
- package/assets/icon-arrow-left.svg +7 -0
- package/assets/icon-close.svg +6 -0
- package/assets/iconRight.svg +3 -0
- package/assets/icon_form.png +0 -0
- package/assets/icon_form_filled.png +0 -0
- package/assets/icon_question.png +0 -0
- package/assets/icon_refresh.png +0 -0
- package/assets/icon_success.png +0 -0
- package/assets/imRobotGuess.svg +4 -0
- package/assets/image-uni.png +0 -0
- package/assets/image.png +0 -0
- package/assets/keyboard_icon.png +0 -0
- package/assets/loading.png +0 -0
- package/assets/more-uni.png +0 -0
- package/assets/more_tools.png +0 -0
- package/assets/msg-audio.svg +1 -0
- package/assets/msg-copy.svg +30 -0
- package/assets/msg-del.svg +33 -0
- package/assets/msg-quote.svg +8 -0
- package/assets/msg-revoke.svg +29 -0
- package/assets/radio-check.png +0 -0
- package/assets/radio-uncheck.png +0 -0
- package/assets/radio.svg +6 -0
- package/assets/refresh.svg +4 -0
- package/assets/rotate-left.svg +7 -0
- package/assets/rotate-right.svg +7 -0
- package/assets/star.png +0 -0
- package/assets/starLine.png +0 -0
- package/assets/translate.svg +12 -0
- package/assets/video-play.png +0 -0
- package/assets/video-uni.png +0 -0
- package/assets/video.png +0 -0
- package/assets/zoom-in.svg +9 -0
- package/assets/zoom-out.svg +9 -0
- package/components/CustomerServiceChat/chat-header/index-web.vue +141 -0
- package/components/CustomerServiceChat/emoji-config/custom-emoji.ts +15 -0
- package/components/CustomerServiceChat/emoji-config/default-emoji.ts +114 -0
- package/components/CustomerServiceChat/emoji-config/index.ts +140 -0
- package/components/CustomerServiceChat/emoji-config/locales/en.ts +66 -0
- package/components/CustomerServiceChat/emoji-config/locales/zh_cn.ts +66 -0
- package/components/CustomerServiceChat/index-web.vue +250 -0
- package/components/CustomerServiceChat/message-input/index-web.vue +214 -0
- package/components/CustomerServiceChat/message-input/index.ts +2 -0
- package/components/CustomerServiceChat/message-input/message-input-button.vue +95 -0
- package/components/CustomerServiceChat/message-input/message-input-editor-web.vue +884 -0
- package/components/CustomerServiceChat/message-input/message-input-file-web.ts +38 -0
- package/components/CustomerServiceChat/message-input/message-input-quote/index.vue +204 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-dialog-mobile/emoji-dialog-mobile.vue +145 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/emoji-picker-dialog.vue +180 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/index.vue +90 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/style/h5.scss +26 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/style/index.scss +4 -0
- package/components/CustomerServiceChat/message-input-toolbar/emoji-picker/style/web.scss +55 -0
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/file-upload/index.vue +77 -0
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/image-upload/index.vue +185 -0
- package/components/CustomerServiceChat/message-input-toolbar/index-web.vue +191 -0
- package/components/CustomerServiceChat/message-input-toolbar/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/style/uni.scss +111 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/index.vue +149 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/color.scss +6 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/h5.scss +20 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/index.scss +5 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/uni.scss +36 -0
- package/components/CustomerServiceChat/message-input-toolbar/toolbar-item-container/style/web.scss +19 -0
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.ts +2 -0
- package/components/CustomerServiceChat/message-input-toolbar/video-upload/index.vue +146 -0
- package/components/CustomerServiceChat/message-list/index-web.vue +712 -0
- package/components/CustomerServiceChat/message-list/link/index.ts +23 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-audio-web.vue +223 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-bubble-web.vue +504 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-custom.vue +5 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-face.vue +45 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-file.vue +151 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-image-web.vue +97 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-location.vue +34 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-quote/index-web.vue +286 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-quote/interface.ts +60 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-record/index.vue +139 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-text.vue +94 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-timestamp.vue +76 -0
- package/components/CustomerServiceChat/message-list/message-elements/message-video-web.vue +319 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/index.ts +9 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-customer/index.ts +5 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-customer/message-customer-service.vue +22 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-plugin-layout-web.vue +133 -0
- package/components/CustomerServiceChat/message-list/message-elements/plugins/plugin-components/message-plugin-web.vue +83 -0
- package/components/CustomerServiceChat/message-list/message-elements/read-status/index.vue +193 -0
- package/components/CustomerServiceChat/message-list/message-elements/simple-message-list/index.vue +462 -0
- package/components/CustomerServiceChat/message-list/message-elements/simple-message-list/message-container.vue +105 -0
- package/components/CustomerServiceChat/message-list/message-elements/video-play.vue +59 -0
- package/components/CustomerServiceChat/message-list/message-tool/index-web.vue +312 -0
- package/components/CustomerServiceChat/message-list/message-tool/message-revoked.vue +63 -0
- package/components/CustomerServiceChat/message-list/scroll-button/index.vue +201 -0
- package/components/CustomerServiceChat/message-list/style/color.scss +32 -0
- package/components/CustomerServiceChat/message-list/style/h5.scss +16 -0
- package/components/CustomerServiceChat/message-list/style/index.scss +11 -0
- package/components/CustomerServiceChat/message-list/style/web.scss +180 -0
- package/components/CustomerServiceChat/style/common.scss +59 -0
- package/components/CustomerServiceChat/style/h5.scss +51 -0
- package/components/CustomerServiceChat/style/index.scss +12 -0
- package/components/CustomerServiceChat/style/uni.scss +13 -0
- package/components/CustomerServiceChat/style/web.scss +46 -0
- package/components/CustomerServiceChat/style/wx.scss +5 -0
- package/components/CustomerServiceChat/utils/conversationDraft.ts +86 -0
- package/components/CustomerServiceChat/utils/sendMessage.ts +140 -0
- package/components/common/Avatar/index.vue +148 -0
- package/components/common/BottomPopup/index.ts +3 -0
- package/components/common/BottomPopup/index.vue +160 -0
- package/components/common/BottomPopup/style/h5.scss +62 -0
- package/components/common/BottomPopup/style/index.scss +3 -0
- package/components/common/BottomPopup/style/modal.scss +5 -0
- package/components/common/Dialog/index.ts +3 -0
- package/components/common/Dialog/index.vue +120 -0
- package/components/common/Dialog/style/color.scss +43 -0
- package/components/common/Dialog/style/dialog.scss +4 -0
- package/components/common/Dialog/style/h5.scss +56 -0
- package/components/common/Dialog/style/web.scss +61 -0
- package/components/common/Drawer/index.vue +164 -0
- package/components/common/Icon.vue +83 -0
- package/components/common/ImagePreviewer/image-item-web.vue +42 -0
- package/components/common/ImagePreviewer/index-web.vue +682 -0
- package/components/common/ImagePreviewer/index.ts +3 -0
- package/components/common/Overlay/index.vue +126 -0
- package/components/common/ProgressMessage/index.vue +95 -0
- package/components/common/RadioSelect/index.vue +59 -0
- package/components/common/RichText/LICENSE +21 -0
- package/components/common/RichText/README.md +244 -0
- package/components/common/RichText/dist/mp-alipay/index.acss +1 -0
- package/components/common/RichText/dist/mp-alipay/index.axml +1 -0
- package/components/common/RichText/dist/mp-alipay/index.js +8 -0
- package/components/common/RichText/dist/mp-alipay/index.json +1 -0
- package/components/common/RichText/dist/mp-alipay/node/node.acss +1 -0
- package/components/common/RichText/dist/mp-alipay/node/node.axml +1 -0
- package/components/common/RichText/dist/mp-alipay/node/node.js +1 -0
- package/components/common/RichText/dist/mp-alipay/node/node.json +1 -0
- package/components/common/RichText/dist/mp-alipay/parser.js +1 -0
- package/components/common/RichText/dist/mp-baidu/index.css +1 -0
- package/components/common/RichText/dist/mp-baidu/index.js +8 -0
- package/components/common/RichText/dist/mp-baidu/index.json +1 -0
- package/components/common/RichText/dist/mp-baidu/index.swan +1 -0
- package/components/common/RichText/dist/mp-baidu/node/node.css +1 -0
- package/components/common/RichText/dist/mp-baidu/node/node.js +1 -0
- package/components/common/RichText/dist/mp-baidu/node/node.json +1 -0
- package/components/common/RichText/dist/mp-baidu/node/node.swan +1 -0
- package/components/common/RichText/dist/mp-baidu/parser.js +1 -0
- package/components/common/RichText/dist/mp-qq/index.js +8 -0
- package/components/common/RichText/dist/mp-qq/index.json +1 -0
- package/components/common/RichText/dist/mp-qq/index.qml +1 -0
- package/components/common/RichText/dist/mp-qq/index.qss +1 -0
- package/components/common/RichText/dist/mp-qq/node/node.js +1 -0
- package/components/common/RichText/dist/mp-qq/node/node.json +1 -0
- package/components/common/RichText/dist/mp-qq/node/node.qml +1 -0
- package/components/common/RichText/dist/mp-qq/node/node.qss +1 -0
- package/components/common/RichText/dist/mp-qq/parser.js +1 -0
- package/components/common/RichText/dist/mp-toutiao/index.js +8 -0
- package/components/common/RichText/dist/mp-toutiao/index.json +1 -0
- package/components/common/RichText/dist/mp-toutiao/index.ttml +1 -0
- package/components/common/RichText/dist/mp-toutiao/index.ttss +1 -0
- package/components/common/RichText/dist/mp-toutiao/node/node.js +1 -0
- package/components/common/RichText/dist/mp-toutiao/node/node.json +1 -0
- package/components/common/RichText/dist/mp-toutiao/node/node.ttml +1 -0
- package/components/common/RichText/dist/mp-toutiao/node/node.ttss +1 -0
- package/components/common/RichText/dist/mp-toutiao/parser.js +1 -0
- package/components/common/RichText/dist/mp-weixin/index.js +8 -0
- package/components/common/RichText/dist/mp-weixin/index.json +1 -0
- package/components/common/RichText/dist/mp-weixin/index.wxml +1 -0
- package/components/common/RichText/dist/mp-weixin/index.wxss +1 -0
- package/components/common/RichText/dist/mp-weixin/node/node.js +1 -0
- package/components/common/RichText/dist/mp-weixin/node/node.json +1 -0
- package/components/common/RichText/dist/mp-weixin/node/node.wxml +1 -0
- package/components/common/RichText/dist/mp-weixin/node/node.wxss +1 -0
- package/components/common/RichText/dist/mp-weixin/parser.js +1 -0
- package/components/common/RichText/dist/uni-app/components/mp-html/mp-html.vue +498 -0
- package/components/common/RichText/dist/uni-app/components/mp-html/node/node.vue +587 -0
- package/components/common/RichText/dist/uni-app/components/mp-html/parser.js +1393 -0
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/js/handler.js +1 -0
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/js/uni.webview.min.js +1 -0
- package/components/common/RichText/dist/uni-app/static/app-plus/mp-html/local.html +1 -0
- package/components/common/RichText/docs/.nojekyll +0 -0
- package/components/common/RichText/docs/index.html +50 -0
- package/components/common/RichText/docs/lib/docsify.min.js +1 -0
- package/components/common/RichText/docs/lib/prism-bash.min.js +1 -0
- package/components/common/RichText/docs/lib/search.min.js +1 -0
- package/components/common/RichText/docs/lib/vue.css +858 -0
- package/components/common/RichText/gulpfile.js +113 -0
- package/components/common/RichText/lint.js +63 -0
- package/components/common/RichText/package.json +74 -0
- package/components/common/RichText/plugins/README.md +2 -0
- package/components/common/RichText/plugins/audio/README.md +25 -0
- package/components/common/RichText/plugins/audio/build.js +11 -0
- package/components/common/RichText/plugins/audio/context.js +7 -0
- package/components/common/RichText/plugins/audio/index.js +34 -0
- package/components/common/RichText/plugins/audio/miniprogram/audio.js +189 -0
- package/components/common/RichText/plugins/audio/miniprogram/audio.json +3 -0
- package/components/common/RichText/plugins/audio/miniprogram/audio.wxml +17 -0
- package/components/common/RichText/plugins/audio/miniprogram/audio.wxss +127 -0
- package/components/common/RichText/plugins/audio/miniprogram/build.js +3 -0
- package/components/common/RichText/plugins/audio/uni-app/audio.vue +269 -0
- package/components/common/RichText/plugins/audio/uni-app/build.js +3 -0
- package/components/common/RichText/plugins/card/README.md +30 -0
- package/components/common/RichText/plugins/card/build.js +14 -0
- package/components/common/RichText/plugins/card/index.js +7 -0
- package/components/common/RichText/plugins/card/miniprogram/build.js +3 -0
- package/components/common/RichText/plugins/card/miniprogram/card.js +26 -0
- package/components/common/RichText/plugins/card/miniprogram/card.json +3 -0
- package/components/common/RichText/plugins/card/miniprogram/card.wxml +9 -0
- package/components/common/RichText/plugins/card/miniprogram/card.wxss +55 -0
- package/components/common/RichText/plugins/card/uni-app/build.js +3 -0
- package/components/common/RichText/plugins/card/uni-app/card.vue +122 -0
- package/components/common/RichText/plugins/editable/README.md +137 -0
- package/components/common/RichText/plugins/editable/config.js +15 -0
- package/components/common/RichText/plugins/editable/miniprogram/build.js +813 -0
- package/components/common/RichText/plugins/editable/miniprogram/index.js +551 -0
- package/components/common/RichText/plugins/editable/uni-app/build.js +744 -0
- package/components/common/RichText/plugins/editable/uni-app/index.js +553 -0
- package/components/common/RichText/plugins/emoji/README.md +15 -0
- package/components/common/RichText/plugins/emoji/index.js +203 -0
- package/components/common/RichText/plugins/highlight/README.md +26 -0
- package/components/common/RichText/plugins/highlight/config.js +5 -0
- package/components/common/RichText/plugins/highlight/index.js +96 -0
- package/components/common/RichText/plugins/highlight/miniprogram/build.js +88 -0
- package/components/common/RichText/plugins/highlight/prism.css +125 -0
- package/components/common/RichText/plugins/highlight/prism.min.js +7 -0
- package/components/common/RichText/plugins/highlight/uni-app/build.js +88 -0
- package/components/common/RichText/plugins/img-cache/README.md +24 -0
- package/components/common/RichText/plugins/img-cache/build.js +16 -0
- package/components/common/RichText/plugins/img-cache/index.js +138 -0
- package/components/common/RichText/plugins/latex/README.md +16 -0
- package/components/common/RichText/plugins/latex/build.js +14 -0
- package/components/common/RichText/plugins/latex/index.js +77 -0
- package/components/common/RichText/plugins/latex/katex.css +1070 -0
- package/components/common/RichText/plugins/latex/katex.min.js +1 -0
- package/components/common/RichText/plugins/markdown/README.md +17 -0
- package/components/common/RichText/plugins/markdown/index.js +34 -0
- package/components/common/RichText/plugins/markdown/marked.min.js +6 -0
- package/components/common/RichText/plugins/markdown/miniprogram/build.js +70 -0
- package/components/common/RichText/plugins/markdown/uni-app/build.js +68 -0
- package/components/common/RichText/plugins/search/README.md +46 -0
- package/components/common/RichText/plugins/search/miniprogram/index.js +137 -0
- package/components/common/RichText/plugins/search/uni-app/index.js +132 -0
- package/components/common/RichText/plugins/style/README.md +30 -0
- package/components/common/RichText/plugins/style/index.js +129 -0
- package/components/common/RichText/plugins/style/parser.js +175 -0
- package/components/common/RichText/plugins/template/README.md +2 -0
- package/components/common/RichText/plugins/template/build.js +65 -0
- package/components/common/RichText/plugins/template/index.js +67 -0
- package/components/common/RichText/plugins/txv-video/README.md +18 -0
- package/components/common/RichText/plugins/txv-video/build.js +3 -0
- package/components/common/RichText/plugins/txv-video/index.js +46 -0
- package/components/common/RichText/plugins/txv-video/miniprogram/build.js +6 -0
- package/components/common/RichText/plugins/txv-video/uni-app/build.js +3 -0
- package/components/common/RichText/src/miniprogram/index.js +396 -0
- package/components/common/RichText/src/miniprogram/index.json +6 -0
- package/components/common/RichText/src/miniprogram/index.wxml +7 -0
- package/components/common/RichText/src/miniprogram/index.wxss +13 -0
- package/components/common/RichText/src/miniprogram/node/node.js +247 -0
- package/components/common/RichText/src/miniprogram/node/node.json +6 -0
- package/components/common/RichText/src/miniprogram/node/node.wxml +112 -0
- package/components/common/RichText/src/miniprogram/node/node.wxss +164 -0
- package/components/common/RichText/src/miniprogram/parser.js +1269 -0
- package/components/common/RichText/src/uni-app/components/mp-html/mp-html.vue +498 -0
- package/components/common/RichText/src/uni-app/components/mp-html/node/node.vue +585 -0
- package/components/common/RichText/src/uni-app/components/mp-html/parser.js +1393 -0
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/js/handler.js +254 -0
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/js/uni.webview.min.js +1 -0
- package/components/common/RichText/src/uni-app/static/app-plus/mp-html/local.html +33 -0
- package/components/common/RichText/tools/config.js +82 -0
- package/components/common/RichText/tools/converter.js +205 -0
- package/components/common/RichText/tools/ifdef.js +115 -0
- package/components/common/RichText/tools/minifier.js +40 -0
- package/components/common/RichText/tools/plugin.js +248 -0
- package/components/common/Toast/index-web.ts +122 -0
- package/components/common/Toast/index-web.vue +178 -0
- package/components/common/Toast/type.ts +8 -0
- package/components/common/common.scss +59 -0
- package/components/customer-icon.vue +56 -0
- package/components/message-branch.vue +120 -0
- package/components/message-customer-service.vue +114 -0
- package/components/message-form/form-branch.vue +68 -0
- package/components/message-form/form-input.vue +242 -0
- package/components/message-form/index.vue +80 -0
- package/components/message-multi-branch/branch-pc.vue +79 -0
- package/components/message-multi-branch/index.vue +60 -0
- package/components/message-multi-form/component-mobile/form-popup.vue +37 -0
- package/components/message-multi-form/component-mobile/input-mobile.vue +102 -0
- package/components/message-multi-form/component-mobile/label-mobile.vue +32 -0
- package/components/message-multi-form/component-mobile/radios-mobile.vue +161 -0
- package/components/message-multi-form/component-pc/input-pc.vue +93 -0
- package/components/message-multi-form/component-pc/label-pc.vue +33 -0
- package/components/message-multi-form/component-pc/radio-pc.vue +98 -0
- package/components/message-multi-form/form-mobile.vue +385 -0
- package/components/message-multi-form/form-pc.vue +184 -0
- package/components/message-multi-form/index.vue +61 -0
- package/components/message-product-card.vue +129 -0
- package/components/message-rating/index.vue +56 -0
- package/components/message-rating/message-rating-number.vue +247 -0
- package/components/message-rating/message-rating-star.vue +237 -0
- package/components/message-rich-text.vue +155 -0
- package/components/message-robot-welcome.vue +181 -0
- package/components/message-stream.vue +109 -0
- package/constant.ts +122 -0
- package/excluded-list.txt +6 -0
- package/index.ts +30 -0
- package/index.vue +60 -0
- package/interface.ts +176 -0
- package/logger/index.ts +12 -0
- package/logger/main.ts +120 -0
- package/package.json +62 -0
- package/script/fileCopy.js +60 -0
- package/script/syncVersion.js +35 -0
- package/server.ts +128 -0
- package/styles/common.scss +116 -0
- package/tsconfig.json +34 -0
- package/typings.d.ts +20 -0
- package/utils/chatStorage.ts +70 -0
- package/utils/copy-web.ts +141 -0
- package/utils/enableSampleTaskStatus.ts +8 -0
- package/utils/env.ts +15 -0
- package/utils/index.ts +59 -0
- package/utils/utils.ts +162 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="showDialog"
|
|
4
|
+
class="dialog"
|
|
5
|
+
:class="[!isPC ? 'dialog-h5' : '', center ? 'center' : '']"
|
|
6
|
+
@click.stop.prevent="toggleView(clickType.OUTSIDE)"
|
|
7
|
+
>
|
|
8
|
+
<main
|
|
9
|
+
class="dialog-main"
|
|
10
|
+
:class="[!backgroundDialog ? 'dialog-main-back' : '']"
|
|
11
|
+
@click.stop.prevent="toggleView(clickType.INSIDE)"
|
|
12
|
+
>
|
|
13
|
+
<header
|
|
14
|
+
v-if="isHeaderShowDialog"
|
|
15
|
+
class="dialog-main-header"
|
|
16
|
+
>
|
|
17
|
+
<h1 class="dialog-main-title">
|
|
18
|
+
{{ showTitle }}
|
|
19
|
+
</h1>
|
|
20
|
+
<i
|
|
21
|
+
class="icon icon-close"
|
|
22
|
+
@click="close"
|
|
23
|
+
/>
|
|
24
|
+
</header>
|
|
25
|
+
<div
|
|
26
|
+
class="dialog-main-content"
|
|
27
|
+
:class="[isUniFrameWork && isH5 ? 'dialog-main-content-uniapp' : '']"
|
|
28
|
+
>
|
|
29
|
+
<slot />
|
|
30
|
+
</div>
|
|
31
|
+
<footer
|
|
32
|
+
v-if="isFooterShowDialog"
|
|
33
|
+
class="dialog-main-footer"
|
|
34
|
+
>
|
|
35
|
+
<button
|
|
36
|
+
class="btn btn-cancel"
|
|
37
|
+
@click="close"
|
|
38
|
+
>
|
|
39
|
+
{{ TUITranslateService.t("component.取消") }}
|
|
40
|
+
</button>
|
|
41
|
+
<button
|
|
42
|
+
class="btn btn-default"
|
|
43
|
+
@click="submit"
|
|
44
|
+
>
|
|
45
|
+
{{ TUITranslateService.t("component.确定") }}
|
|
46
|
+
</button>
|
|
47
|
+
</footer>
|
|
48
|
+
</main>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script lang="ts" setup>
|
|
53
|
+
import vue from '../../../adapter-vue';
|
|
54
|
+
import { TUITranslateService } from '@tencentcloud/chat-uikit-engine';
|
|
55
|
+
import { isPC, isH5, isUniFrameWork } from '../../../utils/env';
|
|
56
|
+
const { ref, watchEffect } = vue;
|
|
57
|
+
const clickType = {
|
|
58
|
+
OUTSIDE: 'outside',
|
|
59
|
+
INSIDE: 'inside',
|
|
60
|
+
};
|
|
61
|
+
const props = defineProps({
|
|
62
|
+
show: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
65
|
+
},
|
|
66
|
+
isHeaderShow: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: true,
|
|
69
|
+
},
|
|
70
|
+
isFooterShow: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: true,
|
|
73
|
+
},
|
|
74
|
+
background: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: true,
|
|
77
|
+
},
|
|
78
|
+
title: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: '',
|
|
81
|
+
},
|
|
82
|
+
center: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: false,
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const showDialog = ref(false);
|
|
89
|
+
const isHeaderShowDialog = ref(true);
|
|
90
|
+
const isFooterShowDialog = ref(true);
|
|
91
|
+
const backgroundDialog = ref(true);
|
|
92
|
+
const showTitle = ref('');
|
|
93
|
+
|
|
94
|
+
watchEffect(() => {
|
|
95
|
+
showDialog.value = props.show;
|
|
96
|
+
showTitle.value = props.title;
|
|
97
|
+
isHeaderShowDialog.value = props.isHeaderShow;
|
|
98
|
+
isFooterShowDialog.value = props.isFooterShow;
|
|
99
|
+
backgroundDialog.value = props.background;
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const emit = defineEmits(['update:show', 'submit']);
|
|
103
|
+
|
|
104
|
+
const toggleView = (type: string) => {
|
|
105
|
+
if (type === clickType.OUTSIDE) {
|
|
106
|
+
close();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
const close = () => {
|
|
111
|
+
showDialog.value = !showDialog.value;
|
|
112
|
+
emit('update:show', showDialog.value);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const submit = () => {
|
|
116
|
+
emit('submit');
|
|
117
|
+
close();
|
|
118
|
+
};
|
|
119
|
+
</script>
|
|
120
|
+
<style lang="scss" scoped src="./style/dialog.scss"></style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
.dialog {
|
|
2
|
+
background: rgba(0, 0, 0, .3);
|
|
3
|
+
|
|
4
|
+
&-main {
|
|
5
|
+
background: #FFF;
|
|
6
|
+
|
|
7
|
+
&-header {
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
color: #333;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&-title {
|
|
13
|
+
font-family: PingFangSC-Medium;
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
color: #333;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-back {
|
|
19
|
+
background: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&-content {
|
|
23
|
+
font-weight: 400;
|
|
24
|
+
color: #333;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.btn {
|
|
30
|
+
font-weight: 400;
|
|
31
|
+
color: #FFF;
|
|
32
|
+
letter-spacing: 0;
|
|
33
|
+
|
|
34
|
+
&-cancel {
|
|
35
|
+
border: 1px solid #ddd;
|
|
36
|
+
color: #666;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&-default {
|
|
40
|
+
background: #006EFF;
|
|
41
|
+
border: 1px solid #006EFF;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.dialog-h5 {
|
|
2
|
+
height: 100%;
|
|
3
|
+
top: 0;
|
|
4
|
+
align-items: inherit;
|
|
5
|
+
|
|
6
|
+
.dialog {
|
|
7
|
+
&-main {
|
|
8
|
+
border-radius: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
width: 100%;
|
|
14
|
+
min-height: 80px;
|
|
15
|
+
min-width: 120px;
|
|
16
|
+
|
|
17
|
+
&-content {
|
|
18
|
+
flex: 1;
|
|
19
|
+
min-width: 0;
|
|
20
|
+
min-height: 0;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
text-align: center;
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
margin-bottom: 0;
|
|
27
|
+
|
|
28
|
+
&-uniapp {
|
|
29
|
+
padding: 40px 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&-footer {
|
|
34
|
+
border-top: 1px solid #DDD;
|
|
35
|
+
|
|
36
|
+
.btn {
|
|
37
|
+
flex: 1;
|
|
38
|
+
margin: 0;
|
|
39
|
+
background: none;
|
|
40
|
+
border-right: 1px solid #DDD;
|
|
41
|
+
|
|
42
|
+
&-default {
|
|
43
|
+
color: #FF584C;
|
|
44
|
+
border: none;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.center {
|
|
53
|
+
align-items: center;
|
|
54
|
+
padding: 20px;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.dialog {
|
|
2
|
+
position: fixed;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
left: 0;
|
|
6
|
+
top: 0;
|
|
7
|
+
z-index: 6;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
|
|
12
|
+
&-main {
|
|
13
|
+
min-width: 368px;
|
|
14
|
+
border-radius: 10px;
|
|
15
|
+
padding: 20px 30px;
|
|
16
|
+
|
|
17
|
+
&-header {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
align-items: center;
|
|
21
|
+
font-size: 16px;
|
|
22
|
+
line-height: 30px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&-title {
|
|
26
|
+
font-size: 16px;
|
|
27
|
+
line-height: 30px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&-content {
|
|
31
|
+
font-size: 14px;
|
|
32
|
+
display: flex;
|
|
33
|
+
justify-content: center;
|
|
34
|
+
align-items: center;
|
|
35
|
+
margin-bottom: 20px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&-footer {
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: flex-end;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.btn {
|
|
46
|
+
padding: 8px 20px;
|
|
47
|
+
margin: 0 6px;
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
border: none;
|
|
50
|
+
font-size: 14px;
|
|
51
|
+
text-align: center;
|
|
52
|
+
line-height: 20px;
|
|
53
|
+
|
|
54
|
+
&:disabled {
|
|
55
|
+
opacity: 0.3;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:last-child {
|
|
59
|
+
margin-right: 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Overlay
|
|
3
|
+
ref="overlayDomInstanceRef"
|
|
4
|
+
:visible="props.visible"
|
|
5
|
+
:useMask="props.useMask"
|
|
6
|
+
:maskColor="props.overlayColor"
|
|
7
|
+
:isFullScreen="props.isFullScreen"
|
|
8
|
+
@onOverlayClick="onOverlayClick"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
v-if="isDrawerShow"
|
|
12
|
+
ref="drawerDomRef"
|
|
13
|
+
:class="{
|
|
14
|
+
drawer: true,
|
|
15
|
+
'origin-bottom': props.popDirection === 'bottom',
|
|
16
|
+
'origin-right': props.popDirection === 'right',
|
|
17
|
+
'slide-bottom': visible && props.popDirection === 'bottom',
|
|
18
|
+
'slide-right': visible && props.popDirection === 'right',
|
|
19
|
+
}"
|
|
20
|
+
:style="{
|
|
21
|
+
minHeight: styles.minHeight,
|
|
22
|
+
maxHeight: styles.maxHeight,
|
|
23
|
+
borderRadius: styles.borderRadius,
|
|
24
|
+
boxShadow: styles.boxShadow,
|
|
25
|
+
width: styles.width,
|
|
26
|
+
}"
|
|
27
|
+
>
|
|
28
|
+
<div class="drawer-container">
|
|
29
|
+
<slot />
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</Overlay>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import vue from '../../../adapter-vue';
|
|
37
|
+
import Overlay from '../../common/Overlay/index.vue';
|
|
38
|
+
const { ref, watch } = vue;
|
|
39
|
+
|
|
40
|
+
interface IProps {
|
|
41
|
+
visible: boolean;
|
|
42
|
+
popDirection: 'top' | 'right' | 'bottom' | 'left';
|
|
43
|
+
useMask?: boolean;
|
|
44
|
+
isFullScreen?: boolean | undefined;
|
|
45
|
+
overlayColor?: string | undefined;
|
|
46
|
+
drawerStyle?: {
|
|
47
|
+
bottom?: Record<string, any> | undefined;
|
|
48
|
+
right?: Record<string, any> | undefined;
|
|
49
|
+
left?: Record<string, any> | undefined;
|
|
50
|
+
top?: Record<string, any> | undefined;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface IEmits {
|
|
55
|
+
(e: 'onOverlayClick', event: Event): void;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const emits = defineEmits<IEmits>();
|
|
59
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
60
|
+
visible: true,
|
|
61
|
+
useMask: true,
|
|
62
|
+
isFullScreen: true,
|
|
63
|
+
popDirection: 'bottom',
|
|
64
|
+
drawerStyle: () => ({}),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const drawerDomRef = ref<HTMLElement>();
|
|
68
|
+
const overlayDomInstanceRef = ref<InstanceType<typeof Overlay>>();
|
|
69
|
+
const isDrawerShow = ref<boolean>(false);
|
|
70
|
+
|
|
71
|
+
const styles = ref(props.drawerStyle[props.popDirection] || {});
|
|
72
|
+
|
|
73
|
+
watch(
|
|
74
|
+
() => props.visible,
|
|
75
|
+
(visible: boolean) => {
|
|
76
|
+
if (visible) {
|
|
77
|
+
isDrawerShow.value = true;
|
|
78
|
+
} else {
|
|
79
|
+
setTimeout(() => {
|
|
80
|
+
isDrawerShow.value = false;
|
|
81
|
+
}, 150);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
immediate: true,
|
|
86
|
+
},
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
function onOverlayClick(e: Event) {
|
|
90
|
+
emits('onOverlayClick', e);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
defineExpose({
|
|
94
|
+
drawerDomRef,
|
|
95
|
+
overlayDomRef: overlayDomInstanceRef.value?.overlayDomRef,
|
|
96
|
+
});
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style scoped lang="scss">
|
|
100
|
+
:not(not) {
|
|
101
|
+
display: flex;
|
|
102
|
+
flex-direction: column;
|
|
103
|
+
box-sizing: border-box;
|
|
104
|
+
min-width: 0;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.drawer {
|
|
108
|
+
position: absolute;
|
|
109
|
+
z-index: 1;
|
|
110
|
+
background-color: #fff;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
transition: transform 0.15s ease-out;
|
|
113
|
+
|
|
114
|
+
.drawer-container {
|
|
115
|
+
background-color: #fff;
|
|
116
|
+
height: 100%;
|
|
117
|
+
width: 100%;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.origin-bottom {
|
|
122
|
+
bottom: 0;
|
|
123
|
+
left: 0;
|
|
124
|
+
right: 0;
|
|
125
|
+
transform: translateY(100%);
|
|
126
|
+
animation: slide-from-bottom 0.15s ease-out;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.origin-right {
|
|
130
|
+
top: 0;
|
|
131
|
+
bottom: 0;
|
|
132
|
+
right: 0;
|
|
133
|
+
transform: translateX(100%);
|
|
134
|
+
animation: slide-from-right 0.15s ease-out;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.slide-bottom {
|
|
138
|
+
transform: translateY(0);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.slide-right {
|
|
142
|
+
transform: translateX(0);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@keyframes slide-from-bottom {
|
|
146
|
+
0% {
|
|
147
|
+
transform: translateY(100%);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
100% {
|
|
151
|
+
transform: translateY(0);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@keyframes slide-from-right {
|
|
156
|
+
0% {
|
|
157
|
+
transform: translateX(100%);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
100% {
|
|
161
|
+
transform: translateX(0);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
</style>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<!-- eslint-disable vue/multi-word-component-names -->
|
|
2
|
+
<template>
|
|
3
|
+
<div
|
|
4
|
+
:class="['common-icon-container', !isPC && 'common-icon-container-mobile']"
|
|
5
|
+
:style="{
|
|
6
|
+
padding: iconHotAreaSize,
|
|
7
|
+
}"
|
|
8
|
+
@click="handleImgClick"
|
|
9
|
+
>
|
|
10
|
+
<image
|
|
11
|
+
v-if="isApp"
|
|
12
|
+
class="common-icon"
|
|
13
|
+
:src="props.file"
|
|
14
|
+
:style="{ width: iconWidth, height: iconHeight }"
|
|
15
|
+
/>
|
|
16
|
+
<img
|
|
17
|
+
v-else
|
|
18
|
+
class="common-icon"
|
|
19
|
+
:src="props.file"
|
|
20
|
+
:style="{ width: iconWidth, height: iconHeight }"
|
|
21
|
+
>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import vue from '../../adapter-vue';
|
|
26
|
+
import { isApp, isPC } from '../../utils/env';
|
|
27
|
+
const { withDefaults, computed } = vue;
|
|
28
|
+
|
|
29
|
+
interface IProps {
|
|
30
|
+
file: string;
|
|
31
|
+
size?: string;
|
|
32
|
+
width?: string;
|
|
33
|
+
height?: string;
|
|
34
|
+
hotAreaSize?: number | string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface IEmits {
|
|
38
|
+
(key: 'onClick', e: Event): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const emits = defineEmits<IEmits>();
|
|
42
|
+
const props = withDefaults(defineProps<IProps>(), {
|
|
43
|
+
file: '',
|
|
44
|
+
width: '20px',
|
|
45
|
+
height: '20px',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const iconHotAreaSize = computed<undefined | string>(() => {
|
|
49
|
+
if (!props.hotAreaSize) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
if (isNaN(Number(props.hotAreaSize))) {
|
|
53
|
+
return String(props.hotAreaSize);
|
|
54
|
+
}
|
|
55
|
+
return `${props.hotAreaSize}px`;
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const iconWidth = computed(() => {
|
|
59
|
+
return props.size ? props.size : props.width;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const iconHeight = computed(() => {
|
|
63
|
+
return props.size ? props.size : props.height;
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const handleImgClick = (e: Event) => {
|
|
67
|
+
emits('onClick', e);
|
|
68
|
+
};
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style lang="scss" scoped>
|
|
72
|
+
.common-icon-container {
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
align-items: center;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
-webkit-tap-highlight-color: transparent;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.common-icon-container-mobile {
|
|
81
|
+
cursor: none;
|
|
82
|
+
}
|
|
83
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<img
|
|
3
|
+
class="image-preview"
|
|
4
|
+
:style="{
|
|
5
|
+
transform: `scale(${props.zoom}) rotate(${props.rotate}deg)`,
|
|
6
|
+
}"
|
|
7
|
+
:src="props.src"
|
|
8
|
+
>
|
|
9
|
+
</template>
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
const props = defineProps({
|
|
12
|
+
zoom: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 1,
|
|
15
|
+
},
|
|
16
|
+
rotate: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 0,
|
|
19
|
+
},
|
|
20
|
+
src: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: '',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
<style lang="scss">
|
|
27
|
+
.image-item {
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
overflow: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.image-preview {
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
max-height: 100%;
|
|
39
|
+
transition: transform 0.1s ease 0s;
|
|
40
|
+
pointer-events: auto;
|
|
41
|
+
}
|
|
42
|
+
</style>
|