1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-21 00:43:03 +08:00

refactor(pages): 拆分 _dialogs 为独立组件文件,解耦 Service 构造函数,消除 PageObject 重复逻辑

- 将 _dialogs.py 拆分为 pages/components/ 下的独立文件,Overlay 基类同步移入
- CaptchaHandler / RecordChecker 构造函数不再持有 PageObject,改为方法参数注入
- LoginPage.login() 直接接收 auto_captcha 参数,简化 captcha_solver 调用链
- SeatMapOverlay.selectSeat 引入两层查找:先按 ID 直查,失败后遍历匹配
- 移除 ReserveView 中与 Dialog/Overlay 重复的方法(selectSeat、getAvailableTimeOptions)
- AutoLibPages 拆分 __initPagesServices / __initPagesFlows
- 修复 RecordsView.MORE_BTN 选择器被错误 snake_case 化(more_btn → moreBtn)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 13:41:55 +08:00
parent 2226e8ac90
commit a6bc103c73
19 changed files with 608 additions and 580 deletions
+3 -2
View File
@@ -175,7 +175,8 @@ class LoginPage:
self,
username: str,
password: str,
captcha_solver: Callable[[], str],
captcha_solver: Callable[["LoginPage", bool], str],
auto_captcha: bool,
tracer: Callable[..., None],
log_level: type,
max_attempts: int = 5,
@@ -189,7 +190,7 @@ class LoginPage:
)
if not self.fillCredentials(username, password):
continue
captcha_text = captcha_solver()
captcha_text = captcha_solver(self, auto_captcha)
if not captcha_text:
continue
if not self.fillCaptcha(captcha_text):