-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpreload.js
29 lines (28 loc) · 1.11 KB
/
preload.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
const { handleSearchUser, handleUserChatLog, handleChatLog } = require('./src/action/wx/user')
// 微信搜索
window.exports = {
"wx": {
mode: "list", // 列表模式
args: {
// 进入插件时调用(可选)
enter: (action, callbackSetList) => {
handleSearchUser(action, callbackSetList)
},
// 子输入框内容变化时被调用 可选 (未设置则无搜索)
search: (action, searchWord, callbackSetList) => {
handleSearchUser(action, callbackSetList, searchWord)
},
// 用户选择列表中某个条目时被调用
select: (action, itemData, callbackSetList) => {
let type = itemData.type
if (type === 'user') {
handleUserChatLog(action, callbackSetList, itemData)
} else if (type === 'chatlog') {
handleChatLog(action, callbackSetList, itemData)
}
},
// 子输入框为空时的占位符
placeholder: "搜索微信用户"
}
}
}