Browse Source

修复@相关的部分bug

master
xsx 11 months ago
parent
commit
aa073611f2
  1. 4
      im-web/src/components/chat/ChatAtBox.vue
  2. 98
      im-web/src/components/chat/ChatGroupMember.vue
  3. 5
      im-web/src/components/chat/ChatInput.vue

4
im-web/src/components/chat/ChatAtBox.vue

@ -88,13 +88,13 @@ export default {
this.close(); this.close();
}, },
scrollToActive() { scrollToActive() {
if (this.activeIdx * 35 - this.$refs.scrollBox.wrap.clientHeight > this.$refs.scrollBox.wrap.scrollTop) { if (this.activeIdx * 40 - this.$refs.scrollBox.wrap.clientHeight > this.$refs.scrollBox.wrap.scrollTop) {
this.$refs.scrollBox.wrap.scrollTop += 140; this.$refs.scrollBox.wrap.scrollTop += 140;
if (this.$refs.scrollBox.wrap.scrollTop > this.$refs.scrollBox.wrap.scrollHeight) { if (this.$refs.scrollBox.wrap.scrollTop > this.$refs.scrollBox.wrap.scrollHeight) {
this.$refs.scrollBox.wrap.scrollTop = this.$refs.scrollBox.wrap.scrollHeight this.$refs.scrollBox.wrap.scrollTop = this.$refs.scrollBox.wrap.scrollHeight
} }
} }
if (this.activeIdx * 35 < this.$refs.scrollBox.wrap.scrollTop) { if (this.activeIdx * 40 < this.$refs.scrollBox.wrap.scrollTop) {
this.$refs.scrollBox.wrap.scrollTop -= 140; this.$refs.scrollBox.wrap.scrollTop -= 140;
if (this.$refs.scrollBox.wrap.scrollTop < 0) { if (this.$refs.scrollBox.wrap.scrollTop < 0) {
this.$refs.scrollBox.wrap.scrollTop = 0; this.$refs.scrollBox.wrap.scrollTop = 0;

98
im-web/src/components/chat/ChatGroupMember.vue

@ -1,60 +1,64 @@
<template> <template>
<div class="chat-group-member" :class="active ? 'active' : ''" :style="{ 'height': height + 'px' }"> <div class="chat-group-member" :class="active ? 'active' : ''" :style="{ 'height': height + 'px' }">
<div class="member-avatar"> <div class="member-avatar">
<head-image :size="headImageSize" :name="member.showNickName" :url="member.headImage"> </head-image> <head-image :size="headImageSize" :name="member.showNickName" :url="member.headImage"> </head-image>
</div> </div>
<div class="member-name" :style="{ 'line-height': height + 'px' }"> <div class="member-name" :style="{ 'line-height': height + 'px' }">
<div>{{ member.showNickName }}</div> <div>{{ member.showNickName }}</div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import HeadImage from "../common/HeadImage.vue"; import HeadImage from "../common/HeadImage.vue";
export default { export default {
name: "groupMember", name: "groupMember",
components: { HeadImage }, components: { HeadImage },
data() { data() {
return {}; return {};
}, },
props: { props: {
member: { member: {
type: Object, type: Object,
required: true required: true
}, },
height: { height: {
type: Number, type: Number,
default: 50 default: 50
}, },
active: { active: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
computed: { computed: {
headImageSize() { headImageSize() {
return Math.ceil(this.height * 0.75) return Math.ceil(this.height * 0.75)
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.chat-group-member { .chat-group-member {
display: flex; display: flex;
position: relative; position: relative;
padding: 0 5px; padding: 0 5px;
align-items: center; align-items: center;
white-space: nowrap; white-space: nowrap;
box-sizing: border-box; box-sizing: border-box;
.member-name { &.active {
padding-left: 10px; background: #E1EAF7;
height: 100%; }
text-align: left;
white-space: nowrap; .member-name {
overflow: hidden; padding-left: 10px;
font-size: var(--im-font-size); height: 100%;
} text-align: left;
white-space: nowrap;
overflow: hidden;
font-size: var(--im-font-size);
}
} }
</style> </style>

5
im-web/src/components/chat/ChatInput.vue

@ -238,8 +238,9 @@ export default {
}, },
onBlur(e) { onBlur(e) {
this.updateRange(); if(!this.atIng){
this.updateRange();
}
}, },
onMousedown() { onMousedown() {
if (this.atIng) { if (this.atIng) {

Loading…
Cancel
Save