aaaaa
This commit is contained in:
parent
10439f5af1
commit
aa619cd3b4
@ -692,13 +692,34 @@ class WindsurfRegister {
|
|||||||
const cardRadio = await this.page.$('input[type="radio"][value="card"]');
|
const cardRadio = await this.page.$('input[type="radio"][value="card"]');
|
||||||
if (cardRadio) {
|
if (cardRadio) {
|
||||||
await cardRadio.click();
|
await cardRadio.click();
|
||||||
await this.human.randomDelay(1000, 2000);
|
logger.success(this.siteName, ' → ✓ 已点击银行卡选项');
|
||||||
logger.success(this.siteName, ' → ✓ 已选择银行卡');
|
|
||||||
|
// 等待支付表单完全加载(等待骨架屏消失,表单元素出现)
|
||||||
|
logger.info(this.siteName, ' → 等待支付表单加载...');
|
||||||
|
await this.human.randomDelay(3000, 5000);
|
||||||
|
|
||||||
|
// 等待所有必需的支付字段都加载完成
|
||||||
|
try {
|
||||||
|
await this.page.waitForFunction(
|
||||||
|
() => {
|
||||||
|
const cardNumber = document.querySelector('#cardNumber');
|
||||||
|
const cardExpiry = document.querySelector('#cardExpiry');
|
||||||
|
const cardCvc = document.querySelector('#cardCvc');
|
||||||
|
const billingName = document.querySelector('#billingName');
|
||||||
|
// 检查所有字段都存在且可见
|
||||||
|
return cardNumber && cardExpiry && cardCvc && billingName;
|
||||||
|
},
|
||||||
|
{ timeout: 30000 }
|
||||||
|
);
|
||||||
|
logger.success(this.siteName, ' → ✓ 支付表单加载完成');
|
||||||
|
} catch (e) {
|
||||||
|
logger.warn(this.siteName, ` → 等待表单超时: ${e.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 填写卡号
|
// 3. 填写卡号
|
||||||
logger.info(this.siteName, ' → 填写卡号...');
|
logger.info(this.siteName, ' → 填写卡号...');
|
||||||
await this.page.waitForSelector('#cardNumber', { timeout: 10000 });
|
await this.page.waitForSelector('#cardNumber', { visible: true, timeout: 10000 });
|
||||||
await this.page.click('#cardNumber');
|
await this.page.click('#cardNumber');
|
||||||
await this.human.randomDelay(500, 1000);
|
await this.human.randomDelay(500, 1000);
|
||||||
await this.page.type('#cardNumber', card.number, { delay: 100 });
|
await this.page.type('#cardNumber', card.number, { delay: 100 });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user