forked from dundunnp/auto_xuexiqiangguo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjd_bean.js
41 lines (37 loc) · 1.23 KB
/
jd_bean.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function goMine() {
auto.waitFor();
app.launchApp('京东');
toast("进入京东");
sleep(10000);
while (!className("android.view.View").desc("我的").exists()) {
back();
sleep(200);
}
toast("点击我的");
className("android.view.View").desc("我的").findOnce().click();
sleep(3000);
}
goMine();
if (className("android.widget.TextView").text("京豆").exists()) {
console.info("进入京豆");
let b = className("android.widget.TextView").text("京豆").findOnce().bounds();
console.hide();
click(b.centerX(), b.centerY());
sleep(6000);
if (className("android.widget.TextView").text("去签到领京豆").exists()) {
toast("去签到领京豆");
let b = className("android.widget.TextView").text("去签到领京豆").findOnce().bounds();
click(b.centerX(), b.centerY());
sleep(5000);
if (text("签到领京豆").exists()) {
let b = text("签到领京豆").findOnce().bounds();
click(b.centerX(), b.centerY());
} else {
console.log("查找 点击京豆失败");
}
} else {
console.error("领取京豆失败!");
}
} else {
console.error("领取京豆失败!");
}