New script xiangdian.com

2024/9/27 15:58:40

As of 2024-09-27. See the latest version.

// ==UserScript==
// @name        New script xiangdian.com
// @namespace   Violentmonkey Scripts
// @match       https://m.xiangdian.com/*
// @grant       none
// @version     1.0.1
// @author      -
// @description 2024/9/27 15:58:40
// @require https://scriptcat.org/lib/513/2.0.0/ElementGetter.js#sha256=KbLWud5OMbbXZHRoU/GLVgvIgeosObRYkDEbE/YanRU=
// @license MIT
// ==/UserScript==


(function() {


    elmGetter.get('.container--pay').then(div => {
      console.log(div)
      setInterval(()=>{
        window.document.getElementsByClassName('container--pay')[0].click()
      },10)
    })

    //检测全选是否选中
    let startCheck  =  false
    let selectAllEle = null
    const myCheck  = setInterval(function(){
      if(startCheck){
          const btn = selectAllEle.querySelector('.van-checkbox__icon--checked');
           console.log(btn)
          if (btn) {
            startCheck = false
            clearInterval(myCheck);
            //已经全选 点击结算
            window.document.getElementsByClassName('bottombar--right-btn')[0].click()
          }else{
            startCheck  = true
            window.document.getElementsByClassName('bottombar__checkbox--cover')[0].click()
          };
      }

    }, 10);

    //全选
    elmGetter.get('.select-all').then(div => {
          selectAllEle = div
          const btn = div.querySelector('.van-checkbox__icon--checked');
           console.log(btn)
          if (btn) {
            //已经全选 点击结算
            window.document.getElementsByClassName('bottombar--right-btn')[0].click()
          }else{
            startCheck  = true
          };

    });

})();