mirror of
https://github.com/kuaifan/dootask.git
synced 2026-03-07 09:57:37 +00:00
perf: 移动端搜索消息支持滑动取消搜索
This commit is contained in:
parent
16717b0acd
commit
7a7d97fd17
@ -44,7 +44,7 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['fileLists']),
|
||||
...mapState(['fileLists', 'messengerSearchKey']),
|
||||
|
||||
style() {
|
||||
const offset = 135;
|
||||
@ -119,6 +119,17 @@ export default {
|
||||
if (this.fileFolderId > 0) {
|
||||
return true;
|
||||
}
|
||||
if (this.routeName === 'manage-messenger') {
|
||||
if (this.$route.params.dialogAction === 'contacts') {
|
||||
if (this.messengerSearchKey.contacts) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.messengerSearchKey.dialog) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
@ -138,6 +149,19 @@ export default {
|
||||
this.goForward({name: 'manage-file'});
|
||||
return;
|
||||
}
|
||||
if (this.routeName === 'manage-messenger') {
|
||||
if (this.$route.params.dialogAction === 'contacts') {
|
||||
if (this.messengerSearchKey.contacts) {
|
||||
this.$store.state.messengerSearchKey.contacts = ""
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (this.messengerSearchKey.dialog) {
|
||||
this.$store.state.messengerSearchKey.dialog = ""
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.goBack();
|
||||
},
|
||||
|
||||
|
||||
@ -257,7 +257,7 @@ export default {
|
||||
},
|
||||
|
||||
computed: {
|
||||
...mapState(['cacheDialogs', 'loadDialogs', 'dialogId', 'appNotificationPermission']),
|
||||
...mapState(['cacheDialogs', 'loadDialogs', 'dialogId', 'messengerSearchKey', 'appNotificationPermission']),
|
||||
|
||||
routeName() {
|
||||
return this.$route.name
|
||||
@ -456,13 +456,22 @@ export default {
|
||||
immediate: true
|
||||
},
|
||||
|
||||
messengerSearchKey: {
|
||||
handler(obj) {
|
||||
this.dialogSearchKey = obj.dialog
|
||||
this.contactsKey = obj.contacts
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
|
||||
dialogSearchKey(val) {
|
||||
this.$store.state.messengerSearchKey.dialog = val
|
||||
switch (val) {
|
||||
case 'log.o':
|
||||
$A.IDBSet("logOpen", "open").then(_ => $A.reloadUrl());
|
||||
$A.IDBSet("logOpen", "open").then($A.reloadUrl);
|
||||
break;
|
||||
case 'log.c':
|
||||
$A.IDBSet("logOpen", "close").then(_ => $A.reloadUrl());
|
||||
$A.IDBSet("logOpen", "close").then($A.reloadUrl);
|
||||
break;
|
||||
}
|
||||
//
|
||||
@ -477,6 +486,7 @@ export default {
|
||||
},
|
||||
|
||||
contactsKey(val) {
|
||||
this.$store.state.messengerSearchKey.contacts = val
|
||||
if (val == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
3
resources/assets/js/store/state.js
vendored
3
resources/assets/js/store/state.js
vendored
@ -86,6 +86,9 @@ export default {
|
||||
dialogInputCache: [],
|
||||
dialogMsgTransfer: {time: 0},
|
||||
|
||||
// 搜索关键词(主要用于移动端判断滑动返回)
|
||||
messengerSearchKey: {dialog: '', contacts: ''},
|
||||
|
||||
// 文件
|
||||
fileLists: [],
|
||||
fileLinks: [],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user