handle dialog about /猎头/ during startup chat

This commit is contained in:
geekgeekrun
2025-12-12 22:03:56 +08:00
parent f27ca4145a
commit 056ec7a0a6

View File

@@ -1314,12 +1314,25 @@ async function toRecommendPage (hooks) {
if (res.code === 0) {
await waitAndHandleChatSuccess()
}
else if (res.zpData.bizCode === 1 && res.zpData.bizData?.chatRemindDialog?.blockLevel === 0 && /剩\d+次沟通机会/.test(res.zpData.bizData?.chatRemindDialog?.content)) {
else if (
res.zpData.bizCode === 1 &&
res.zpData.bizData?.chatRemindDialog?.blockLevel === 0 &&
/剩\d+次沟通机会/.test(res.zpData.bizData?.chatRemindDialog?.content)
) {
const confirmButton = await page.waitForSelector('.chat-block-dialog .chat-block-footer .sure-btn')
await confirmButton.click()
const nextRes = await waitAddFriendResponse()
await handleAddFriendResponse(nextRes)
}
else if (
res.zpData.bizCode === 1 &&
/猎头/.test(res.zpData.bizData?.chatRemindDialog?.content)
) {
const confirmButton = await page.waitForSelector(`xpath///*[contains(@class, "chat-block-dialog")]//*[contains(@class, "chat-block-footer")]//*[contains(text(), "继续")]`)
await confirmButton.click()
const nextRes = await waitAddFriendResponse()
await handleAddFriendResponse(nextRes)
}
else if (
res.zpData.bizCode === 1 &&
res.zpData.bizData?.chatRemindDialog?.blockLevel === 0 &&