+时长

add time to chosen one.

目前为 2023-02-19 提交的版本。查看 最新版本

// ==UserScript==
// @name         +时长
// @namespace    http://tampermonkey.net/
// @version      0.1.1
// @description  add time to chosen one.
// @author       zhaiwei
// @match        http://ah.chinavolunteer.mca.gov.cn/volunteer/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=mca.gov.cn
// @grant        none
// @license      GPL license
// ==/UserScript==

(function() {
    'use strict';

    // 生成“+时长”按钮
    var btn = document.createElement('button');
    // 按钮文字
    btn.innerText = '+时长';
    // 添加按钮的样式类名class值为addBtn
    btn.setAttribute('class', 'addBtn');
    // 生成style标签
    var style = document.createElement('style');
    // 把样式写进去
    style.innerText = `.addBtn{position:fixed;top:80%;right:10%;width:75px;height:55px;padding:3px 5px;border:3px solid #0d6efd;cursor:pointer;color:#0d6efd;font-size:20px;background-color:transparent;border-radius:5px;transition:color .15s ease-in-out,background-color .15s ease-in-out;z-index:9999999999999;}.addBtn:hover{background-color:#0d6efd;color:#fff;}`;
    // 在head中添加style标签
    document.head.appendChild(style);
    // 在body中添加button按钮
    document.body.appendChild(btn);
    // 点击按钮去执行函数addTime()
    document.querySelector('.addBtn').addEventListener('click', function () {
        addTime();
    })

    function addTime(){
        setTimeout('document.getElementsByClassName("ant-checkbox-input")[0].click();',10)
        setTimeout('document.getElementsByClassName("ant-btn ant-btn-primary")[8].click();',110)
    setTimeout('document.getElementsByClassName("anticon anticon-calendar ant-calendar-picker-icon")[0].click();',310)
    //15日->[16]
    setTimeout('document.getElementsByClassName("ant-calendar-cell")[16].click();',450)
    setTimeout('document.getElementsByClassName("ant-calendar-ok-btn")[0].click();',600)
    setTimeout('document.getElementsByClassName("anticon anticon-calendar ant-calendar-picker-icon")[1].click();',750)
    setTimeout('document.getElementsByClassName("ant-calendar-cell")[16].click();',900)
    setTimeout('document.getElementsByClassName("ant-calendar-ok-btn")[0].click();',1050)
    //setTimeout('document.getElementsByClassName("ant-btn ant-btn-primary")[20].click();',1200)
    setTimeout('document.getElementsByTagName("div")[245].children[1].click();',1200)
    };
    // Your code here...
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址