mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
perf: 兼容iPad键盘
This commit is contained in:
parent
9771e1e741
commit
7aa44b8623
@ -297,6 +297,13 @@ export default {
|
||||
this.$store.dispatch("getBasicData", 600)
|
||||
}
|
||||
}
|
||||
// 键盘状态
|
||||
window.__onKeyboardStatus = (data) => {
|
||||
const message = $A.jsonParse(decodeURIComponent(data));
|
||||
this.$store.state.keyboardType = message.keyboardType;
|
||||
this.$store.state.keyboardHeight = message.keyboardHeight;
|
||||
this.$store.state.safeAreaBottom = message.safeAreaBottom;
|
||||
}
|
||||
// 通知权限
|
||||
window.__onNotificationPermissionStatus = (ret) => {
|
||||
this.$store.state.appNotificationPermission = $A.runNum(ret) == 1;
|
||||
|
||||
@ -179,7 +179,7 @@
|
||||
</VirtualList>
|
||||
|
||||
<!--底部输入-->
|
||||
<div ref="footer" class="dialog-footer" :class="footerClass" @click="onActive">
|
||||
<div ref="footer" class="dialog-footer" :class="footerClass" :style="footerStyle" @click="onActive">
|
||||
<div class="dialog-newmsg" @click="onToBottom">{{$L(`有${msgNew}条新消息`)}}</div>
|
||||
<div class="dialog-goto" @click="onToBottom"><i class="taskfont"></i></div>
|
||||
<DialogUpload
|
||||
@ -661,7 +661,11 @@ export default {
|
||||
'dialogIns',
|
||||
'cacheUserBasic',
|
||||
'fileLinks',
|
||||
'cacheEmojis'
|
||||
'cacheEmojis',
|
||||
|
||||
'keyboardType',
|
||||
'keyboardHeight',
|
||||
'safeAreaBottom'
|
||||
]),
|
||||
|
||||
...mapGetters(['isLoad']),
|
||||
@ -828,6 +832,18 @@ export default {
|
||||
return null
|
||||
},
|
||||
|
||||
footerStyle() {
|
||||
const {keyboardType, keyboardHeight, safeAreaBottom, windowScrollY} = this
|
||||
const style = {};
|
||||
if (windowScrollY === 0
|
||||
&& keyboardType === "show"
|
||||
&& keyboardHeight > 0
|
||||
&& keyboardHeight < 120) {
|
||||
style.paddingBottom = (keyboardHeight + safeAreaBottom) + 'px';
|
||||
}
|
||||
return style;
|
||||
},
|
||||
|
||||
msgUnreadOnly() {
|
||||
let num = 0;
|
||||
this.cacheDialogs.some(dialog => {
|
||||
|
||||
5
resources/assets/js/store/state.js
vendored
5
resources/assets/js/store/state.js
vendored
@ -28,6 +28,11 @@ export default {
|
||||
formLabelPosition: windowWidth > 576 ? 'right' : 'top',
|
||||
formLabelWidth: windowWidth > 576 ? 'auto' : '',
|
||||
|
||||
// 键盘状态(仅iOS)
|
||||
keyboardType: null, // show|hide
|
||||
keyboardHeight: 0, // 键盘高度
|
||||
safeAreaBottom: 0, // 安全区域底部高度
|
||||
|
||||
// App通知权限
|
||||
appNotificationPermission: true,
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit d7ded42bf291f9ada70850f68ea16a7f7c7bcb0d
|
||||
Subproject commit 057b1c4d1a02d72a403f31c4bbf2c97ba7084c3d
|
||||
Loading…
x
Reference in New Issue
Block a user