This commit is contained in:
HuangHai
2026-01-12 20:11:18 +08:00
parent f4b398227e
commit ac79e44282
18 changed files with 155 additions and 85 deletions

View File

@@ -27,18 +27,9 @@ async def open_mini_program():
await asyncio.sleep(5)
# 2. 确保在消息列表页并点击搜索
logger.info("尝试查找并点击 '搜索按钮'...")
# 优先尝试从 XinDianTu 的模板中复用 SearchButton.jpg (如果存在)
search_template = os.path.join(os.path.dirname(BASE_DIR), "XinDianTu", "Templates", "SearchButton.jpg")
if not os.path.exists(search_template):
search_template = os.path.join(BASE_DIR, "Templates", "SearchButton.jpg")
if click_image_template(d, search_template):
logger.info("点击了搜索按钮")
else:
logger.warning("未找到搜索按钮,使用坐标点击 (84%, 8%)")
w, h = d.window_size()
d.click(int(w * 0.84), int(h * 0.08))
logger.info("直接使用坐标点击 '搜索按钮' (84%, 8%)...")
w, h = d.window_size()
d.click(int(w * 0.84), int(h * 0.08))
await asyncio.sleep(2)