File was renamed from rpa/src/message/dy_deviceUserMessage.js |
| | |
| | | */ |
| | | function isHome() { |
| | | let result = false; |
| | | while (true) { |
| | | var home_selectors = text("首页").getOneNodeInfo(3000); //首页按钮 |
| | | var message_selectors = text("消息").getOneNodeInfo(3000); //消息按钮 |
| | | //判断是否在首页 |
| | | if (home_selectors && message_selectors) { |
| | | var follow_selectors = text("关注"); //关注按钮 |
| | | var recommend_selectors = text("推荐"); //推荐按钮 |
| | | if (has(follow_selectors) && has(recommend_selectors)) { |
| | | toast('已定位首页'); |
| | | randomSleep("已定位到首页", "", "", "", "", ""); |
| | | result = true; |
| | | break; |
| | | } else { |
| | | home_selectors.click(); |
| | | sleep(3000); |
| | | } |
| | | } else { |
| | | toast('返回首页...'); |
| | | //返回上一页 |
| | | go_back(1); |
| | | } |
| | | |
| | | let map = { "uri": "snssdk1128://feed/" }; |
| | | if (utils.openActivity(map)) { |
| | | toast('已定位首页'); |
| | | randomSleep("已定位到首页", "", "", "", "", ""); |
| | | result = true; |
| | | } else { |
| | | // home_selectors.click(); |
| | | // sleep(3000); |
| | | } |
| | | // while (true) { |
| | | // var home_selectors = text("首页").getOneNodeInfo(3000); //首页按钮 |
| | | // var message_selectors = text("消息").getOneNodeInfo(3000); //消息按钮 |
| | | // //判断是否在首页 |
| | | // if (home_selectors && message_selectors) { |
| | | // var follow_selectors = text("关注"); //关注按钮 |
| | | // var recommend_selectors = text("推荐"); //推荐按钮 |
| | | // if (has(follow_selectors) && has(recommend_selectors)) { |
| | | // toast('已定位首页'); |
| | | // randomSleep("已定位到首页", "", "", "", "", ""); |
| | | // result = true; |
| | | // break; |
| | | // } else { |
| | | // home_selectors.click(); |
| | | // sleep(3000); |
| | | // } |
| | | // } else { |
| | | // toast('返回首页...'); |
| | | // //返回上一页 |
| | | // go_back(1); |
| | | // } |
| | | // } |
| | | return result; |
| | | } |
| | | |