ZJU health report

To submit the health report

目前為 2021-05-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name         ZJU health report
// @namespace    https://wfb.ink/
// @version      21.05.11.2
// @description  To submit the health report
// @author       beta/β/贝塔
// @match        https://healthreport.zju.edu.cn/ncov/wap/default/index
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
     /*
     ************************************************************************************
      封装getElementByXpath函数
     ************************************************************************************
     */
    function getElementByXpath(xpath){
     	var element = document.evaluate(xpath,document).iterateNext();
     	return element;
    }
    /*******************************
      封装sleep函数
    *******************************/
    function sleep(numberMillis) {
        var now = new Date();
        var exitTime = now.getTime() + numberMillis;
        while (true) {
            now = new Date();
            if (now.getTime() > exitTime)
                return;
        }
    }

    //选择是否在校
    var not_in_school = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[15]/div/div/div[2]/span[1]")
    not_in_school.setAttribute("class","");
    var in_school = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[15]/div/div/div[1]/span[1]");
    in_school.setAttribute("class","active");
    
    //选择14日进出境情况
    var in_high = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[22]/div/div/div[1]/span[1]");
    in_high.setAttribute("class","");
    var in_low = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[22]/div/div/div[2]/span[1]");
    in_low.setAttribute("class","active");

    //选择承诺
    var credit = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[34]/div/div/div/span[1]");
    credit.setAttribute("class","active");
    
    //点击获取位置
    var location = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[19]/div/input");
    location.click();
    

    //提交表单
    var submit = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[5]/div/a");
    sleep(3);
    submit.click();


})();

QingJ © 2025

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