20250904-初步功能已完成

This commit is contained in:
2025-09-18 21:45:31 +08:00
38 changed files with 186 additions and 299 deletions

View File

@@ -60,8 +60,6 @@ class ScriptManager():
# 设置手机的节点深度为15,判断该页面是否正确
session.appium_settings({"snapshotMaxDepth": 15})
# 判断当前页面上是否有推荐按钮
el = session.xpath(
'//XCUIElementTypeButton[@name="top_tabs_recomend" or @name="推荐" or @label="推荐"]'
)
@@ -274,7 +272,6 @@ class ScriptManager():
retries = 0
while not event.is_set():
try:
self.greetNewFollowers(udid, needReply, event)
except Exception as e:
@@ -294,13 +291,11 @@ class ScriptManager():
LogManager.method_info(f"是否要自动回复消息:{needReply}", "关注打招呼", udid)
# 先关闭Tik Tok
ControlUtils.closeTikTok(session, udid)
time.sleep(1)
# 重新打开Tik Tok
ControlUtils.openTikTok(session, udid)
time.sleep(3)
LogManager.method_info(f"重启tiktok", "关注打招呼", udid)
# 设置查找深度
@@ -374,6 +369,7 @@ class ScriptManager():
input.set_text(f"{aid or '暂无数据'}\n")
# 定位 "关注" 按钮 通过关注按钮的位置点击主播首页
session.appium_settings({"snapshotMaxDepth": 25})
try:
@@ -606,7 +602,6 @@ class ScriptManager():
time.sleep(3)
continue # 重新进入 while 循环,调用 monitorMessages
# 检查未读消息并回复
def monitorMessages(self, session, udid):