Meituan grocery shopping / Dingdong grocery shopping / Hema / Taoxianda / Bailian Daojia autojs script learning case

The mobile phone needs to install autojs (download at the end of the article), and then download the script to import and run. The script function mainly realizes the automatic settlement of shopping cart items until the payment can be made, and a vibrating prompt will be displayed before payment. It is recommended that the Android version of the mobile phone >=7.0.

part of the code

        /**
         * 要等待一会,否则结算按钮点击后没有反应
         */
        sleep(1000);
        console.log("点击结算按钮");
        jsBtn.parent().click();
        // console.log(2221,jsBtn.parent())
        let hasModal = className("android.widget.TextView").filter(function(w){
            return ["配送运力已约满","订单已约满"].indexOf(w.text())>=0;
        });
        
        if(hasModal){console.log("发现弹出框");
            // 关闭配送运力已满按钮
            className("android.widget.TextView").text('我知道了').findOne().parent().click();
            console.log("关闭弹出框");
            return jiesuan();
        }else{
            console.log("完成");
            stop();
        }

Meituan grocery shopping script (you can also request it from me on the site) https://download.csdn.net/download/keyiis_sh/85098528

let jsBtn = className("android.widget.TextView").textStartsWith('去结算(').findOne(2000);
    if(jsBtn){
        jsBtn.click();
        sleep(1000);
        jiesuan();
    }else{
        sleep(500);
        let back = text("返回购物车").findOnce();
        if(back){
            // 点击返回购物车
            back.parent().click();
            jiesuan();
        }else{
            // 成功后进入下一步
            // device.vibrate(2000);
            selectTime();
        }
    }

Dingdong grocery shopping script (you can also get it from me on the website) https://download.csdn.net/download/keyiis_sh/85098534

console.log("搜索提交订单按钮");
        sleep(500);
        let sbbtn = className("android.widget.TextView").text("提交订单").findOne();
        // 判断是否有运力不足
        if(textContains("运力不足").exists()){
            console.log("发现运力不足提示");
            // 返回购物车
            className("android.widget.ImageView").clickable(true).findOne().click();
            console.log("返回购物车重新结算");
            jiesuan();
        }else{
            console.log("提交订单");
            // 提交订单
            sbbtn.click();
            device.vibrate(2000);
        }

Hema script (you can also get it from me on the website) https://download.csdn.net/download/keyiis_sh/85098543

console.log("未发现结算按钮");
        let yym = text("已约满").findOne(3000);
        if(yym){
            console.log("发现已约满");
            id("b6g").findOne().click();
            console.log("返回购物车");
            jiesuan();
        }else{
            console.log("未发现已约满");
            if(text("提交订单").exists()){
                console.log("提交订单");
                pay();
            }else{
                console.log("未发现提交订单按钮");
                jiesuan();
            }
        }

 Bailian Daojia script (you can also request it from me on the website) https://download.csdn.net/download/keyiis_sh/85098551

Taoxianda script (you can also request it from me in the website) https://download.csdn.net/download/keyiis_sh/85170462

autojs4.1 download https://download.csdn.net/download/keyiis_sh/85100001

Autojs basic tutorial https://blog.csdn.net/keyiis_sh/article/details/124266006

If you have other app needs, please contact me.

Guess you like

Origin blog.csdn.net/keyiis_sh/article/details/124057431