refactor: GetScreenTextsByOCR returns image path and ocr texts

This commit is contained in:
lilong.129
2023-05-04 00:39:43 +08:00
parent 0d8d53d431
commit 8330e6ccf6
5 changed files with 12 additions and 12 deletions

View File

@@ -150,7 +150,7 @@ func NewWorldCupLive(device uixt.Device, matchName, bundleID string, duration, i
func (wc *WorldCupLive) getCurrentLiveTime(utcTime time.Time) error {
utcTimeStr := utcTime.Format("15:04:05")
ocrTexts, err := wc.driver.GetScreenTextsByOCR()
_, ocrTexts, err := wc.driver.GetScreenTextsByOCR()
if err != nil {
log.Error().Err(err).Msg("get ocr texts failed")
return err
@@ -212,7 +212,7 @@ func (wc *WorldCupLive) EnterLive(bundleID string) error {
time.Sleep(5 * time.Second)
// 青少年弹窗处理
if ocrTexts, err := wc.driver.GetScreenTextsByOCR(); err == nil {
if _, ocrTexts, err := wc.driver.GetScreenTextsByOCR(); err == nil {
if points, err := ocrTexts.FindTexts([]string{"青少年模式", "我知道了"}); err == nil {
point := points[1].Center()
_ = wc.driver.TapAbsXY(point.X, point.Y)