-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathchina-unicom.js
More file actions
37 lines (36 loc) · 1.25 KB
/
china-unicom.js
File metadata and controls
37 lines (36 loc) · 1.25 KB
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
// ----------------------------
// 脚本信息设定
let task_name = "中国联通签到"
let app_name = "中国联通"
// ----------------------------
let common = require('common.js')
common.startLog(task_name)
common.runApp(app_name)
// ----------------------------
// 脚本自定义函数
dailySign()
// ----------------------------
common.stopApp(app_name)
common.endLog(task_name)
home()
exit()
function dailySign() {
let detect_my_button = common.detectWidgetItem("id", "com.sinovatech.unicom.ui:id/main_tab_user_layout", "error", "normal")
if (detect_my_button) {
detect_my_button.click()
let detect_in_my_page = common.detectWidgetItem("text", "我的套餐", "error", "normal")
if (detect_in_my_page) {
console.log("已进入「我的」页面")
let detect_sign_button = common.detectWidgetItem("id", "com.sinovatech.unicom.ui:id/user_login_qiandao", "error", "normal")
if(detect_sign_button){
detect_sign_button.click()
if (common.detectSuccessInfo("textContains", "话费红包")) {
console.log("已完成「每日签到」")
}
}
}
}
else {
console.error("未检测到「我的」按钮")
}
}