统一控制延时

This commit is contained in:
2026-07-30 15:29:24 +08:00
parent bfe13d300b
commit 66bca74267
11 changed files with 148 additions and 113 deletions
+3 -3
View File
@@ -17,7 +17,7 @@
import type { MatchedFormField, UILibPickerConfig } from "./types"
import { UI_LIB_PICKER_CONFIGS } from "./constants"
import { delay } from "./autofill"
import { delay } from "~utils/delay"
/** 通过提示文字判断是否为选择器 */
function hasPickerHintText(field: MatchedFormField, lang: "zh" | "en"): boolean {
@@ -109,7 +109,7 @@ async function dismissPopup() {
document.activeElement.blur()
}
document.body.click()
await delay(200)
await delay("mid")
}
/**
@@ -142,7 +142,7 @@ async function detectByClick(field: MatchedFormField): Promise<boolean> {
for (const target of clickTargets) {
const before = snapshotDOM()
target.click()
await delay(200)
await delay("mid")
if (hasNewPopup(before)) {
console.log(`OfferPie: [${field.key}] 点击 ${target.tagName}.${(target.className || "").toString().split(" ")[0]} 后检测到弹出层`)