@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 class="branch-card">
|
|
3
|
+
<div
|
|
4
|
+
v-if="content.header || content.title"
|
|
5
|
+
class="branch-body branch-bubble"
|
|
6
|
+
>
|
|
7
|
+
<Icon :src="iconQuestion" class="branch-title-icon"/>
|
|
8
|
+
{{ content.header || content.title }}
|
|
9
|
+
</div>
|
|
10
|
+
<div
|
|
11
|
+
v-if="!isSelected"
|
|
12
|
+
v-for="(item, index) in content.items"
|
|
13
|
+
:key="index"
|
|
14
|
+
class="branch-body branch-bubble branch-item"
|
|
15
|
+
:style="{ borderWidth: content.header ? '1px 0 0px 0' : '' }"
|
|
16
|
+
@click="handleContentListItemClick(item)"
|
|
17
|
+
>
|
|
18
|
+
{{ item.content }}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import vue from '../adapter-vue';
|
|
25
|
+
import { customerServicePayloadType } from '../interface';
|
|
26
|
+
import iconRight from '../assets/iconRight.svg';
|
|
27
|
+
import iconQuestion from '../assets/icon_question.png'
|
|
28
|
+
import Icon from './customer-icon.vue';
|
|
29
|
+
const { computed, ref} = vue;
|
|
30
|
+
// const { computed,ref } = vue;
|
|
31
|
+
|
|
32
|
+
interface Props {
|
|
33
|
+
payload: customerServicePayloadType;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface branchItem {
|
|
37
|
+
content: string;
|
|
38
|
+
desc: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
components: {
|
|
43
|
+
Icon,
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
payload: {
|
|
47
|
+
type: Object as () => customerServicePayloadType,
|
|
48
|
+
default: () => ({}),
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
emits: ['sendMessage'],
|
|
52
|
+
setup(props: Props, { emit }) {
|
|
53
|
+
const isSelected = ref<boolean>(false);
|
|
54
|
+
const content = computed(() => {
|
|
55
|
+
return (
|
|
56
|
+
props?.payload?.content || {
|
|
57
|
+
header: undefined,
|
|
58
|
+
items: [],
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const handleContentListItemClick = (branch: branchItem) => {
|
|
64
|
+
isSelected.value = true;
|
|
65
|
+
emit('sendMessage', { text: branch.content });
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
content,
|
|
70
|
+
handleContentListItemClick,
|
|
71
|
+
iconRight,
|
|
72
|
+
iconQuestion,
|
|
73
|
+
isSelected,
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="scss">
|
|
80
|
+
.branch-body {
|
|
81
|
+
display: flex;
|
|
82
|
+
min-width: 0;
|
|
83
|
+
box-sizing: border-box;
|
|
84
|
+
padding: 12px 14px;
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
color: #000;
|
|
87
|
+
letter-spacing: 0;
|
|
88
|
+
word-wrap: break-word;
|
|
89
|
+
word-break: break-all;
|
|
90
|
+
position: relative;
|
|
91
|
+
|
|
92
|
+
.branch-main {
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
align-content: flex-start;
|
|
98
|
+
border: 0 solid black;
|
|
99
|
+
margin: 0;
|
|
100
|
+
padding: 0;
|
|
101
|
+
min-width: 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
.branch-bubble {
|
|
105
|
+
background: #f3f4f7;
|
|
106
|
+
border-radius: 0 10px 10px;
|
|
107
|
+
margin-bottom: 8px;
|
|
108
|
+
}
|
|
109
|
+
.branch-item {
|
|
110
|
+
color:#1c66e5;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
.branch-card {
|
|
114
|
+
min-width: 250px;
|
|
115
|
+
max-width: 350px;
|
|
116
|
+
display:flex;
|
|
117
|
+
flex-direction:column;
|
|
118
|
+
align-items: flex-start;
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="custom">
|
|
3
|
+
<div
|
|
4
|
+
v-if="
|
|
5
|
+
payload.src === CUSTOM_MESSAGE_SRC.BRANCH ||
|
|
6
|
+
payload.src === CUSTOM_MESSAGE_SRC.BRANCH_NUMBER ||
|
|
7
|
+
(payload.src === CUSTOM_MESSAGE_SRC.ROBOT_MSG &&
|
|
8
|
+
payload.subtype !== 'welcome_msg')
|
|
9
|
+
"
|
|
10
|
+
>
|
|
11
|
+
<MessageBranch
|
|
12
|
+
:payload="payload"
|
|
13
|
+
@sendMessage="sendTextMessage"
|
|
14
|
+
/>
|
|
15
|
+
</div>
|
|
16
|
+
<div
|
|
17
|
+
v-if="
|
|
18
|
+
payload.src === CUSTOM_MESSAGE_SRC.ROBOT_MSG
|
|
19
|
+
"
|
|
20
|
+
>
|
|
21
|
+
<MessageIMRobotWelcome
|
|
22
|
+
:payload="payload"
|
|
23
|
+
@sendMessage="sendTextMessage"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.FROM_INPUT">
|
|
27
|
+
<MessageForm
|
|
28
|
+
:payload="payload"
|
|
29
|
+
@sendMessage="sendTextMessage"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.PRODUCT_CARD">
|
|
33
|
+
<MessageProductCard :payload="payload" />
|
|
34
|
+
</div>
|
|
35
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.RICH_TEXT">
|
|
36
|
+
<MessageRichText :payload="payload" />
|
|
37
|
+
</div>
|
|
38
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.STREAM_TEXT">
|
|
39
|
+
<MessageStream :payload="payload" />
|
|
40
|
+
</div>
|
|
41
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.MULTI_BRANCH">
|
|
42
|
+
<MessageMultiBranch :payload="payload"
|
|
43
|
+
@sendMessage="sendTextMessage"/>
|
|
44
|
+
</div>
|
|
45
|
+
<div v-if="payload.src === CUSTOM_MESSAGE_SRC.MULTI_FORM && message.flow == 'in'">
|
|
46
|
+
<MessageMultiForm :payload="payload"
|
|
47
|
+
@sendMessage="sendCustomMessage"
|
|
48
|
+
@showFormPopup="handleShowFormPopup"
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script lang="ts">
|
|
55
|
+
import vue from '../adapter-vue';
|
|
56
|
+
import { JSONToObject } from '../utils/index';
|
|
57
|
+
import { CUSTOM_MESSAGE_SRC } from '../constant';
|
|
58
|
+
import { customerServicePayloadType, IMessageModel } from '../interface';
|
|
59
|
+
import MessageBranch from './message-branch.vue';
|
|
60
|
+
import MessageForm from './message-form/index.vue';
|
|
61
|
+
import MessageIMRobotWelcome from './message-robot-welcome.vue';
|
|
62
|
+
import MessageProductCard from './message-product-card.vue';
|
|
63
|
+
import MessageRichText from './message-rich-text.vue';
|
|
64
|
+
import MessageStream from './message-stream.vue';
|
|
65
|
+
import MessageMultiBranch from './message-multi-branch/index.vue';
|
|
66
|
+
import MessageMultiForm from './message-multi-form/index.vue';
|
|
67
|
+
const { computed } = vue;
|
|
68
|
+
|
|
69
|
+
interface Props {
|
|
70
|
+
message: IMessageModel;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default {
|
|
74
|
+
components: {
|
|
75
|
+
MessageBranch,
|
|
76
|
+
MessageForm,
|
|
77
|
+
MessageProductCard,
|
|
78
|
+
MessageRichText,
|
|
79
|
+
MessageIMRobotWelcome,
|
|
80
|
+
MessageStream,
|
|
81
|
+
MessageMultiBranch,
|
|
82
|
+
MessageMultiForm
|
|
83
|
+
},
|
|
84
|
+
props: {
|
|
85
|
+
message: {
|
|
86
|
+
type: Object as () => IMessageModel,
|
|
87
|
+
default: () => ({}),
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
emits: ['sendMessage','sendCustomMessage','showFormPopup'],
|
|
91
|
+
setup(props: Props, { emit }) {
|
|
92
|
+
const payload = computed<customerServicePayloadType>(() => {
|
|
93
|
+
return props.message && JSONToObject(props.message?.payload?.data);
|
|
94
|
+
});
|
|
95
|
+
const sendTextMessage = (text: string) => {
|
|
96
|
+
emit('sendMessage', text);
|
|
97
|
+
};
|
|
98
|
+
const sendCustomMessage = (data: any) => {
|
|
99
|
+
emit('sendCustomMessage', data);
|
|
100
|
+
};
|
|
101
|
+
const handleShowFormPopup = (data: boolean) => {
|
|
102
|
+
emit('showFormPopup', data);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
payload,
|
|
107
|
+
sendTextMessage,
|
|
108
|
+
CUSTOM_MESSAGE_SRC,
|
|
109
|
+
sendCustomMessage,
|
|
110
|
+
handleShowFormPopup
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
</script>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="form-branch-container">
|
|
3
|
+
<p
|
|
4
|
+
v-if="props.title"
|
|
5
|
+
class="card-title"
|
|
6
|
+
>
|
|
7
|
+
{{ props.title }}
|
|
8
|
+
</p>
|
|
9
|
+
<div
|
|
10
|
+
v-for="(item, index) in props.list"
|
|
11
|
+
:key="index"
|
|
12
|
+
class="form-branch-item"
|
|
13
|
+
@click="listItemClick(item)"
|
|
14
|
+
>
|
|
15
|
+
{{ item.content }}
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
interface branchItem {
|
|
22
|
+
content: string;
|
|
23
|
+
desc: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface Props {
|
|
27
|
+
title: string;
|
|
28
|
+
list: branchItem[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
props: {
|
|
33
|
+
title: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: '',
|
|
36
|
+
},
|
|
37
|
+
list: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: () => [],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
emits: ['input-click'],
|
|
43
|
+
setup(props: Props, { emit }) {
|
|
44
|
+
const listItemClick = (branch: branchItem): void => {
|
|
45
|
+
emit('input-click', branch);
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
props,
|
|
49
|
+
listItemClick,
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
<style lang="scss">
|
|
55
|
+
.form-branch-container {
|
|
56
|
+
.card-title {
|
|
57
|
+
margin-bottom: 8px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.form-branch-item {
|
|
61
|
+
font-weight: 400;
|
|
62
|
+
color: rgba(54, 141, 255, 1);
|
|
63
|
+
padding-top: 5px;
|
|
64
|
+
cursor: pointer;
|
|
65
|
+
padding-bottom: 5px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="form-container" v-if="!isShowForm && !isFinish">
|
|
3
|
+
<Icon :src="iconForm" width="65px" height="65px"/>
|
|
4
|
+
|
|
5
|
+
<div class="right-container">
|
|
6
|
+
<div class="card-title">
|
|
7
|
+
{{ props.title }}
|
|
8
|
+
</div>
|
|
9
|
+
<div class="form-button" @click="showForm">
|
|
10
|
+
立即填写
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
<div class="form-input-container" v-else-if="isShowForm && !isFinish">
|
|
16
|
+
<div class="card-title">
|
|
17
|
+
<!-- {{ props.title }} -->
|
|
18
|
+
title
|
|
19
|
+
</div>
|
|
20
|
+
<div class="form-input-box">
|
|
21
|
+
<div class="form-input-line">
|
|
22
|
+
<div class="form-label">
|
|
23
|
+
<span class="required-icon" v-if="true" >{{'*'}}</span>
|
|
24
|
+
<label>label</label>
|
|
25
|
+
</div>
|
|
26
|
+
<input
|
|
27
|
+
v-model="text"
|
|
28
|
+
class="form-input"
|
|
29
|
+
placeholder="请输入内容"
|
|
30
|
+
>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="form-finish-container" v-else-if="isFinish">
|
|
35
|
+
<div class="card-title">
|
|
36
|
+
<div>
|
|
37
|
+
{{ props.title }}
|
|
38
|
+
</div>
|
|
39
|
+
<div class="form-finish-title-right">
|
|
40
|
+
<Icon :src="iconSucess" style="margin:0px 4px"/>
|
|
41
|
+
已提交
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
<div>
|
|
45
|
+
{{ text }}
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script lang="ts">
|
|
51
|
+
import vue from '../../adapter-vue';
|
|
52
|
+
import iconForm from '../../assets/icon_form.png';
|
|
53
|
+
import Icon from '../customer-icon.vue';
|
|
54
|
+
import iconSucess from '../../assets/icon_success.png';
|
|
55
|
+
const { computed, ref} = vue;
|
|
56
|
+
|
|
57
|
+
interface Props {
|
|
58
|
+
title: string;
|
|
59
|
+
}
|
|
60
|
+
export default {
|
|
61
|
+
components: {
|
|
62
|
+
Icon,
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
title: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: '',
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
emits: ['input-submit'],
|
|
71
|
+
setup(props: Props, { emit }) {
|
|
72
|
+
const disabled = ref<boolean>(false);
|
|
73
|
+
const text = ref<string>('');
|
|
74
|
+
const isShowForm = ref<boolean>(false);
|
|
75
|
+
const isFinish = ref<boolean>(false);
|
|
76
|
+
|
|
77
|
+
const listItemClick = (): void => {
|
|
78
|
+
disabled.value = true;
|
|
79
|
+
isShowForm.value = false;
|
|
80
|
+
isFinish.value = true;
|
|
81
|
+
// emit('input-submit', text.value);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const showForm = (): void => {
|
|
85
|
+
isShowForm.value = true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
disabled,
|
|
90
|
+
text,
|
|
91
|
+
listItemClick,
|
|
92
|
+
props,
|
|
93
|
+
iconForm,
|
|
94
|
+
isShowForm,
|
|
95
|
+
showForm,
|
|
96
|
+
iconSucess,
|
|
97
|
+
isFinish
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
</script>
|
|
102
|
+
<style lang="scss">
|
|
103
|
+
.form-container {
|
|
104
|
+
display:flex;
|
|
105
|
+
.right-container {
|
|
106
|
+
display:flex;
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
justify-content: space-between;
|
|
109
|
+
margin-left: 10px;
|
|
110
|
+
.form-button {
|
|
111
|
+
background-color: #1c66e5;
|
|
112
|
+
color:#ffffff;
|
|
113
|
+
padding:2px 12px;
|
|
114
|
+
border-radius: 12px;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
.form-input-container {
|
|
119
|
+
.card-title {
|
|
120
|
+
font-size:14px;
|
|
121
|
+
margin-bottom: 8px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.form-input-box {
|
|
125
|
+
button:disabled {
|
|
126
|
+
background: #d8d8d8;
|
|
127
|
+
}
|
|
128
|
+
.form-input-line {
|
|
129
|
+
display:flex;
|
|
130
|
+
margin-bottom: 10px;
|
|
131
|
+
}
|
|
132
|
+
.form-label {
|
|
133
|
+
align-self: center;
|
|
134
|
+
display:flex;
|
|
135
|
+
width:66px;
|
|
136
|
+
label {
|
|
137
|
+
text-overflow: ellipsis;
|
|
138
|
+
overflow: hidden;
|
|
139
|
+
white-space: nowrap;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.required-icon {
|
|
143
|
+
color: #e54545;
|
|
144
|
+
font-size: 16px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
.form-input {
|
|
148
|
+
flex:1;
|
|
149
|
+
margin-left:10px;
|
|
150
|
+
height: 27px;
|
|
151
|
+
border-radius: 8px;
|
|
152
|
+
border: 0px;
|
|
153
|
+
}
|
|
154
|
+
.form-input-radio {
|
|
155
|
+
margin-left:10px;
|
|
156
|
+
display:flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
flex-flow: wrap;
|
|
159
|
+
label {
|
|
160
|
+
margin-right: 5px;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.form-radio {
|
|
164
|
+
margin:0px 5px 0px 0px;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.form-button {
|
|
170
|
+
position: relative;
|
|
171
|
+
height: 40px;
|
|
172
|
+
width: 42px;
|
|
173
|
+
font-size: 16px;
|
|
174
|
+
border-radius: 0 8px 8px 0;
|
|
175
|
+
border: 0 rgba(221, 221, 221, 1) solid;
|
|
176
|
+
background: #006eff;
|
|
177
|
+
color: white;
|
|
178
|
+
cursor: pointer;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.form-button::before {
|
|
182
|
+
content: "";
|
|
183
|
+
position: absolute;
|
|
184
|
+
width: 10px;
|
|
185
|
+
height: 10px;
|
|
186
|
+
top: 50%;
|
|
187
|
+
right: 40%;
|
|
188
|
+
border-left: 2px solid #fff;
|
|
189
|
+
border-bottom: 2px solid #fff;
|
|
190
|
+
transform: translate(0, -50%) rotate(-135deg);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.form-finish-container {
|
|
195
|
+
.card-title {
|
|
196
|
+
display:flex;
|
|
197
|
+
justify-content: space-between;
|
|
198
|
+
margin-bottom: 10px;
|
|
199
|
+
}
|
|
200
|
+
.form-finish-title-right {
|
|
201
|
+
display:flex;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
input[type="radio"] {
|
|
205
|
+
+label {
|
|
206
|
+
position: relative;
|
|
207
|
+
cursor: pointer;
|
|
208
|
+
margin-left: 20px;
|
|
209
|
+
&::before {
|
|
210
|
+
content: "";
|
|
211
|
+
position: absolute;
|
|
212
|
+
left: -20px;
|
|
213
|
+
top:2px;
|
|
214
|
+
border-radius: 50%;
|
|
215
|
+
// border: 1px solid #6f686a;
|
|
216
|
+
width: 16px;
|
|
217
|
+
height: 16px;
|
|
218
|
+
background-image: url('../../assets/radio-uncheck.png');
|
|
219
|
+
background-size: cover;
|
|
220
|
+
background-position: center;
|
|
221
|
+
}
|
|
222
|
+
&::after {
|
|
223
|
+
content: "";
|
|
224
|
+
position: absolute;
|
|
225
|
+
left: -20px;
|
|
226
|
+
top: 2px;
|
|
227
|
+
border-radius: 50%;
|
|
228
|
+
width: 16px;
|
|
229
|
+
height: 16px;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
&:checked {
|
|
233
|
+
+ label::after {
|
|
234
|
+
background-image: url('../../assets/radio-check.png');
|
|
235
|
+
background-size: cover;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="content.type === 1"
|
|
4
|
+
class="message-form"
|
|
5
|
+
>
|
|
6
|
+
<div class="message-form">
|
|
7
|
+
<FormBranch
|
|
8
|
+
:title="content.header"
|
|
9
|
+
:list="content.items"
|
|
10
|
+
@input-click="handleContentListItemClick"
|
|
11
|
+
/>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div
|
|
15
|
+
v-else
|
|
16
|
+
class="message-form"
|
|
17
|
+
>
|
|
18
|
+
<FormInput
|
|
19
|
+
:title="content.header"
|
|
20
|
+
@input-submit="handleFormSaveInputSubmit"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import vue from '../../adapter-vue';
|
|
27
|
+
import FormBranch from './form-branch.vue';
|
|
28
|
+
import FormInput from './form-input.vue';
|
|
29
|
+
const { computed} = vue;
|
|
30
|
+
|
|
31
|
+
interface branchItem {
|
|
32
|
+
content: string;
|
|
33
|
+
desc: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
interface Props {
|
|
37
|
+
payload: any;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default {
|
|
41
|
+
components: {
|
|
42
|
+
FormBranch,
|
|
43
|
+
FormInput,
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
payload: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: () => ({}),
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
emits: ['sendMessage'],
|
|
52
|
+
setup(props: Props, { emit }) {
|
|
53
|
+
const content = computed(() => {
|
|
54
|
+
return props.payload?.content || {
|
|
55
|
+
type: 0,
|
|
56
|
+
header: '',
|
|
57
|
+
items: [],
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const handleContentListItemClick = (branch: branchItem) => {
|
|
62
|
+
emit('sendMessage', { text: branch.content });
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const handleFormSaveInputSubmit = (text: string) => {
|
|
66
|
+
emit('sendMessage', { text });
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
content,
|
|
70
|
+
handleContentListItemClick,
|
|
71
|
+
handleFormSaveInputSubmit,
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
</script>
|
|
76
|
+
<style lang="scss">
|
|
77
|
+
.message-form {
|
|
78
|
+
max-width: 300px;
|
|
79
|
+
}
|
|
80
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="form-branch-container">
|
|
3
|
+
<div
|
|
4
|
+
v-if="props.payload.content.header"
|
|
5
|
+
class="card-title"
|
|
6
|
+
>
|
|
7
|
+
{{ props.payload.content.header }}
|
|
8
|
+
</div>
|
|
9
|
+
<div
|
|
10
|
+
v-if="props.payload.status == 0 && !isClicked"
|
|
11
|
+
v-for="(item, index) in props.payload.content.items"
|
|
12
|
+
:key="index"
|
|
13
|
+
class="form-branch-item"
|
|
14
|
+
@click="listItemClick(item)"
|
|
15
|
+
>
|
|
16
|
+
{{ item.content }}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { customerServicePayloadType } from '../../interface';
|
|
23
|
+
interface branchItem {
|
|
24
|
+
content: string;
|
|
25
|
+
desc: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface Props {
|
|
29
|
+
payload: customerServicePayloadType;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
props: {
|
|
34
|
+
payload: {
|
|
35
|
+
type: Object as () => customerServicePayloadType,
|
|
36
|
+
default: () => ({content: { header: '', items: [] },status:0}),
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
emits: ['input-click'],
|
|
40
|
+
setup(props: Props, { emit }) {
|
|
41
|
+
let isClicked = false;
|
|
42
|
+
const listItemClick = (branch: branchItem): void => {
|
|
43
|
+
emit('input-click', branch);
|
|
44
|
+
isClicked = true;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
props,
|
|
49
|
+
isClicked,
|
|
50
|
+
listItemClick,
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
<style lang="scss">
|
|
56
|
+
.form-branch-container {
|
|
57
|
+
.card-title {
|
|
58
|
+
background-color: #fbfbfb;
|
|
59
|
+
padding: 12px;
|
|
60
|
+
border-radius: 0 10px 10px;
|
|
61
|
+
width:fit-content;
|
|
62
|
+
font-family: PingFangSC-Regular;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.form-branch-item {
|
|
66
|
+
font-weight: 500;
|
|
67
|
+
color: rgba(54, 141, 255, 1);
|
|
68
|
+
background-color: #fbfbfb;
|
|
69
|
+
border: 1px solid rgba(0, 110, 255, 0.3);
|
|
70
|
+
padding: 12px;
|
|
71
|
+
border-radius: 25px;
|
|
72
|
+
margin-top: 8px;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
width:fit-content;
|
|
75
|
+
font-family: PingFangSC-Regular;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
</style>
|
|
79
|
+
|