From d735dbc72c245e16b7e9b4a724390c1168474078 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sat, 4 Jun 2022 12:32:20 +0800 Subject: [PATCH] no message --- resources/assets/js/directives/longpress.js | 4 +- resources/assets/js/functions/common.js | 16 +++++ .../js/pages/manage/components/DialogView.vue | 49 ++++++++++++-- .../pages/manage/components/DialogWrapper.vue | 1 + resources/assets/sass/dark.scss | 9 +++ .../sass/pages/components/dialog-wrapper.scss | 64 +++++++++++-------- 6 files changed, 109 insertions(+), 34 deletions(-) diff --git a/resources/assets/js/directives/longpress.js b/resources/assets/js/directives/longpress.js index 0c159b129..33932ad9b 100644 --- a/resources/assets/js/directives/longpress.js +++ b/resources/assets/js/directives/longpress.js @@ -2,10 +2,10 @@ const isSupportTouch = "ontouchend" in document; // 长按或右键指令 const longpress = { bind: function (el, binding) { - let delay = 501, + let delay = 500, callback = binding.value; if ($A.isJson(binding.value)) { - delay = binding.value.delay || 501; + delay = binding.value.delay || 500; callback = binding.value.callback; } if (typeof callback !== 'function') { diff --git a/resources/assets/js/functions/common.js b/resources/assets/js/functions/common.js index abb322ea7..21c656820 100755 --- a/resources/assets/js/functions/common.js +++ b/resources/assets/js/functions/common.js @@ -599,6 +599,22 @@ } }, + /** + * 获取数组长度(处理数组不存在) + * @param array + * @returns {number|*} + */ + arrayLength(array) { + if (array) { + try { + return array.length; + } catch (e) { + return 0 + } + } + return 0; + }, + /** * 将数组或对象内容部分拼成字符串 * @param obj diff --git a/resources/assets/js/pages/manage/components/DialogView.vue b/resources/assets/js/pages/manage/components/DialogView.vue index 18e76c3f7..829fb4ee3 100644 --- a/resources/assets/js/pages/manage/components/DialogView.vue +++ b/resources/assets/js/pages/manage/components/DialogView.vue @@ -5,7 +5,13 @@ -
+
@@ -34,7 +40,7 @@
-
    +
    • {{$L('会议主题')}} {{msgData.msg.name}} @@ -47,7 +53,7 @@ {{$L('频道ID')}} {{msgData.msg.meetingid.replace(/^(.{3})(.{3})(.*)$/, '$1 $2 $3')}}
    • -
    • +
    • {{$L('点击加入会议')}}
    • @@ -59,9 +65,11 @@
{{$L("未知的消息类型")}}
+ +
-
    +
    • !read_at) }, + headClass() { + const {type, msg, emoji} = this.msgData; + const array = []; + if ($A.arrayLength(emoji) === 0) { + if (type === 'text') { + if (/^]*?>$/.test(msg.text) + || /^\s*

      \s*([\uD800-\uDBFF][\uDC00-\uDFFF]){1,3}\s*<\/p>\s*$/.test(msg.text)) { + array.push('transparent') + } + } + } + return array; + }, + contentClass() { const {type, msg} = this.msgData; const classArray = []; @@ -216,6 +243,14 @@ export default { this.msgRead(); }, immediate: true, + }, + operateAction(val) { + this.operateEnter = false; + if (val) { + setTimeout(_ => { + this.operateEnter = true; + }, 400) + } } }, diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index 123cf1712..9fb4a14c0 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -186,6 +186,7 @@ v-for="(emoji, key) in operateEmojis" :key="key" v-html="emoji" + class="no-dark-content" @click="onOperate('emoji', emoji)">

    diff --git a/resources/assets/sass/dark.scss b/resources/assets/sass/dark.scss index 34656fe18..47225aa3f 100644 --- a/resources/assets/sass/dark.scss +++ b/resources/assets/sass/dark.scss @@ -445,6 +445,15 @@ body.dark-mode-reverse { } } } + .chat-toolbar { + > li { + &.chat-send { + .taskfont { + color: #000000; + } + } + } + } } } } diff --git a/resources/assets/sass/pages/components/dialog-wrapper.scss b/resources/assets/sass/pages/components/dialog-wrapper.scss index 5e9768242..be6b95f9f 100644 --- a/resources/assets/sass/pages/components/dialog-wrapper.scss +++ b/resources/assets/sass/pages/components/dialog-wrapper.scss @@ -241,16 +241,14 @@ border-radius: 2px 8px 8px 8px; transition: box-shadow 0.3s ease; + &.transparent { + background-color: transparent !important; + } + .dialog-content { display: flex; align-items: flex-start; - - &.an-emoticon, - &.an-emoji, - &.two-emoji, - &.three-emoji { - background-color: transparent !important; - } + position: relative; &.an-emoji { .content-text { @@ -266,6 +264,7 @@ > pre { font-size: 52px; line-height: 1; + letter-spacing: 4px; } } } @@ -275,6 +274,7 @@ > pre { font-size: 32px; line-height: 1; + letter-spacing: 4px; } } } @@ -438,7 +438,6 @@ max-width: 220px; max-height: 220px; border-radius: 6px; - background-color: transparent; overflow: hidden; .file-img { @@ -501,7 +500,6 @@ padding: 4px 6px; color: $primary-title-color; .dialog-meeting { - cursor: pointer; min-width: 220px; > li { list-style: none; @@ -517,6 +515,12 @@ align-items: center; font-size: 12px; position: relative; + cursor: pointer; + &:hover { + .taskfont { + padding-left: 4px; + } + } &:before { content: ""; position: absolute; @@ -531,6 +535,7 @@ font-size: 12px; padding-left: 2px; transform: scale(0.8); + transition: all 0.2s; } } > em { @@ -555,6 +560,17 @@ .content-unknown { text-decoration: underline; } + + .content-cover { + display: none; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 1; + user-select: none; + } } .dialog-emoji { @@ -721,17 +737,6 @@ } } - .content-file { - &.file { - background-color: #F4F5F7; - } - - &.img { - border-radius: 6px; - background-color: transparent; - } - } - .content-record { color: #ffffff; @@ -1117,11 +1122,20 @@ .dialog-item { .dialog-view { - user-select: none; - - &.operate-action { - .content-text { - user-select: text; + .dialog-head { + .dialog-content { + .content-cover { + display: block; + } + } + } + &.operate-enter { + .dialog-head { + .dialog-content { + .content-cover { + display: none; + } + } } } }