20250904-初步功能已完成

This commit is contained in:
2025-09-17 22:24:16 +08:00
parent db67024157
commit 5d63cc7961
75 changed files with 267 additions and 461 deletions

View File

@@ -361,10 +361,12 @@ class ScriptManager():
else:
print(f"找不到输入框")
input.clear_text()
time.sleep(1)
# 输入主播id
input.set_text(f"{aid or '暂无数据'}\n")
input = session.xpath('//XCUIElementTypeSearchField')
if input.exists:
input.clear_text()
time.sleep(1)
# 输入主播id
input.set_text(f"{aid or '暂无数据'}\n")
# 定位 "关注" 按钮 通过关注按钮的位置点击主播首页
@@ -449,11 +451,11 @@ class ScriptManager():
time.sleep(2)
msgButton = AiUtils.getSendMesageButton(session)
time.sleep(2)
if msgButton is not None:
LogManager.method_info("找到发消息按钮了", "关注打招呼", udid)
print("找到发消息按钮了")
if msgButton.exists:
# 进入聊天页面
msgButton.click()
LogManager.method_info("找到发消息按钮了", "关注打招呼", udid)
print("找到发消息按钮了")
else:
LogManager.method_info("没有识别出发消息按钮", "关注打招呼", udid)
print("没有识别出发消息按钮")
@@ -494,10 +496,12 @@ class ScriptManager():
LogManager.method_info(f"即将发送的私信内容:{msg}", "关注打招呼", udid)
# 准备发送一条信息
chatInput.click()
time.sleep(2)
# 发送消息
chatInput.set_text(f"{msg or '暂无数据'}\n")
chatInput = session.xpath("//TextView")
if chatInput.exists:
chatInput.click()
time.sleep(2)
# 发送消息
chatInput.set_text(f"{msg or '暂无数据'}\n")
# input.set_text(f"{aid or '暂无数据'}\n")