Skip to content

Commit

Permalink
fix: 修复支付宝报错的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Oct 31, 2017
1 parent af6b691 commit 9557a9a
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions app/providers/支付宝.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,17 @@ module.exports = class extends Provider {
const options = ctx.options;
const page = ctx.page;

await utils.sleep(1000 * 2);

await page.type('#J-accName', options.phone, { delay: 50 });
await page.type('#J-mobCode', '123456', { delay: 50 });

await utils.sleep(200);

try {
const subPages = await page.frames();
while (subPages.length) {
const subPage = subPages.shift();
// 点击统一隐私条款
await subPage.click('[seed="content-JAgreeButton"]');
}
} catch (err) {}
// 这里不知道发什么颠
// 选择符选择不到这个元素
// 只能执行js脚本
await page.evaluate(() => {
const btn = document.querySelector('#J-resend-mobile');
btn.click();
});

await page.click('#J-resend-mobile');
await page.waitForSelector('#J-resend-mobile button[disabled]', { timeout: 1000 * 3 });
}
};

0 comments on commit 9557a9a

Please sign in to comment.