Giter Club home page Giter Club logo

Comments (14)

georgehuan1994 avatar georgehuan1994 commented on May 13, 2024

看下你的脚本,第275行是什么?

from dingding-automatic-clock-in.

chenzhujin avatar chenzhujin commented on May 13, 2024

8d8a19b755289cdd99fad12286b95bd
应该是这部分代码出错了, btn_sure.click() // 找到 "确定" 按钮,并点击 这句257,会不会是 BUNDLE_ID_DD 包名的问题啊?钉钉版本 V6.0.5

from dingding-automatic-clock-in.

chenzhujin avatar chenzhujin commented on May 13, 2024

ee9ce261e3ac2f67a8144dd1b278f9c

钉钉软件没有调用出来,每次接收到短信解锁后,就进入到这个界面不动了

from dingding-automatic-clock-in.

georgehuan1994 avatar georgehuan1994 commented on May 13, 2024

有两个问题
1、同时运行了多个脚本。修改脚本之后,记得先在VS Code里按Shift+F5,停止运行脚本;或者在AutoJs里把正在运行的脚本关掉。不然会有很多个进程,而且报错的位置不对,很难定位问题。
2、能打开钉钉的设置界面,说明BUNDLE_ID是正确的,报错的原因可能是没有找到结束运行这个控件,或是点击了结束运行控件但没有找到确认按钮。你先把

let btn_finish = textMatches(/(.*结束.*)|(.*停止.*)|(.*运行.*)/).clickable(true).findOne()

改为:

let btn_finish = textMatches("结束运行").clickable(true).findOne()

或者

let btn_finish =  descMatches("结束运行").clickable(true).findOne()

试一下

from dingding-automatic-clock-in.

georgehuan1994 avatar georgehuan1994 commented on May 13, 2024

替换这个方法在尝试一下,如果还有报错的话再把报错截图和相关代码块发一下

/**
 * @description 结束钉钉进程
 */
function stopApp() {

    console.log("结束钉钉进程")

    // Root
    // shell('am force-stop ' + BUNDLE_ID_DD, true) 

    // No Root
    app.openAppSetting(BUNDLE_ID_DD)
    let btn_finish = textMatches(/(.*结束.*)|(.*停止.*)/).clickable(true).findOne() // 直到找到 "结束运行" 按钮,并点击
    if (btn_finish.enabled()) {
        btn_finish.click()
        console.log("点击了结束按钮")  

        if (null != textMatches("确定").clickable(true).findOne(1000)) { // 点击弹出的对话框中的 "确定" 按钮
            btn_sure = textMatches("确定").clickable(true).findOnce()
            btn_sure.click() 
            console.log("点击了确定按钮")  
        }
        if (null != descMatches("确定").clickable(true).findOne(1000)) {
            btn_sure = descMatches("确定").clickable(true).findOnce()
            btn_sure.click() 
            console.log("点击了确定按钮")  
        }
        console.info(app.getAppName(BUNDLE_ID_DD) + "已被关闭")
    } 
    else {
        console.info(app.getAppName(BUNDLE_ID_DD) + "未在运行")
    }
    sleep(1000)
    home()
    sleep(1000)
}

from dingding-automatic-clock-in.

chenzhujin avatar chenzhujin commented on May 13, 2024

现在不会报错,但是应该出现跟第一个同样的问题 《小米获取不到控件名称或者ID #14》 ,一直卡在那个应用详情界面。

from dingding-automatic-clock-in.

georgehuan1994 avatar georgehuan1994 commented on May 13, 2024

代码已更新,移除了 结束钉钉 这个过程

from dingding-automatic-clock-in.

chenzhujin avatar chenzhujin commented on May 13, 2024

经过一天的努力,终于可以调出打卡界面,但问题如下: 1.手机在熄屏情况下,无法正常解锁,手机常亮才行。
2:进入打卡界面,不会点击 下班打卡,上班打卡按钮。(一直卡在打卡界面中)

from dingding-automatic-clock-in.

georgehuan1994 avatar georgehuan1994 commented on May 13, 2024

https://github.com/georgehuan1994/DingDing-Automatic-Clock-in#%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9
按注意事项里的说明操作一下,看看是否能解决你的问题。
另外你说的无法正常解锁,是指无法点亮屏幕?还是上滑动作无法解锁屏幕?

卡在打卡界面这个问题,可以看看日志,如果是卡在“等待连接到考勤机”,请在脚本开头的常量中修改考勤机名称

from dingding-automatic-clock-in.

chenzhujin avatar chenzhujin commented on May 13, 2024

无上滑,解锁操作,现在可以点击打卡了。只是不能,熄屏解锁。

from dingding-automatic-clock-in.

georgehuan1994 avatar georgehuan1994 commented on May 13, 2024

swipe(360, 600, 360, 0, 100)
把解锁方法中的上滑动作改为这个试试

from dingding-automatic-clock-in.

chenzhujin avatar chenzhujin commented on May 13, 2024

ED053621C6B0F7C73076D7230510BDAF 显示如图:
7}JMGX 94GH9FVRH8Q${202

打开那些都成功了。

from dingding-automatic-clock-in.

georgehuan1994 avatar georgehuan1994 commented on May 13, 2024

gesture(320, [device.width * 0.5, device.height * 0.7], [device.width * 0.5, device.height * 0.2])
gesture(320, [0, 0], [500, 1000]) 为模拟一个从(0, 0)到(500, 1000)的手势操作,时长为320毫秒

根据平时的上滑位置来校正参数吧,device.width * 0.5这个可以不动,主要调整Y轴的滑动区间

from dingding-automatic-clock-in.

chenzhujin avatar chenzhujin commented on May 13, 2024

设备解锁后,是不是也看不到,手机跳转到钉钉界面的啊?我看日记,是有解锁成功的,钉钉也正常的调用起来。但是看手机界面却还是锁屏界面.

from dingding-automatic-clock-in.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.