no message

This commit is contained in:
kuaifan 2022-05-29 11:27:32 +08:00
parent fb3bf48bbc
commit 38b6a74e3d
5 changed files with 35 additions and 21 deletions

View File

@ -48,10 +48,12 @@ export default {
setInterval(this.searchEnter, 1000);
//
window.addEventListener('resize', this.windowSizeListener);
window.addEventListener('scroll', this.windowScrollListener);
},
beforeDestroy() {
window.removeEventListener('resize', this.windowSizeListener);
window.removeEventListener('scroll', this.windowScrollListener);
},
computed: {
@ -225,6 +227,10 @@ export default {
this.$store.state.windowMax768 = window.innerWidth <= 768
},
windowScrollListener() {
this.$store.state.windowScrollY = window.scrollY
},
electronEvents() {
if (!this.$Electron) {
return;

View File

@ -94,6 +94,7 @@
:data-transfer="true"
class="chat-input-record-transfer"
:class="{cancel: touchLimitY}"
:style="recordTransferStyle"
@click="stopRecord">
<div v-if="recordDuration > 0" class="record-duration">{{recordFormatDuration}}</div>
<div v-else class="record-loading"><Loading/></div>
@ -238,7 +239,7 @@ export default {
}
},
computed: {
...mapState(['dialogInputCache', 'cacheProjects', 'cacheTasks', 'cacheUserBasic', 'userId']),
...mapState(['dialogInputCache', 'cacheProjects', 'cacheTasks', 'cacheUserBasic', 'userId', 'windowScrollY']),
editorStyle() {
const {wrapperWidth, editorHeight} = this;
@ -253,6 +254,13 @@ export default {
}
},
recordTransferStyle() {
const {windowScrollY} = this;
return windowScrollY > 0 ? {
marginTop: (windowScrollY / 2) + 'px'
} : null
},
boxClass() {
const array = [];
if (this.recordState === 'ing') {

View File

@ -226,15 +226,11 @@ export default {
},
mounted() {
if ($A.isIos()) {
window.addEventListener('scroll', this.onWindowScroll);
}
},
beforeDestroy() {
if ($A.isIos()) {
window.removeEventListener('scroll', this.onWindowScroll);
}
},
computed: {
@ -243,6 +239,7 @@ export default {
'cacheDialogs',
'dialogMsgs',
'wsOpenNum',
'windowScrollY'
]),
isReady() {
@ -387,6 +384,20 @@ export default {
}
})
},
windowScrollY(val) {
if ($A.isIos()) {
const {scrollE} = this.scrollInfo();
this.wrapperStyle = {
top: val + 'px'
}
if (scrollE <= 10) {
this.$nextTick(_ => {
this.onToBottom();
})
}
}
}
},
methods: {
@ -686,18 +697,6 @@ export default {
this.msgNew = 0;
}
}, 100)
},
onWindowScroll() {
const {scrollE} = this.scrollInfo();
this.wrapperStyle = {
top: window.scrollY + 'px'
}
if (scrollE <= 10) {
this.$nextTick(_ => {
this.onToBottom();
})
}
}
}
}

View File

@ -1,7 +1,8 @@
const stateData = {
// 浏览器宽高
// 浏览器尺寸信息
windowWidth: window.innerWidth,
windowHeight: window.innerHeight,
windowScrollY: 0,
// 浏览器宽度≤768返回true
windowMax768: window.innerWidth <= 768,

View File

@ -335,7 +335,7 @@
color: $primary-title-color;
background-color: #ffffff;
border-radius: 8px;
box-shadow: 0 0 12px 0 #c8c8c8;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
align-items: center;