ZJU Health Report

To submit the health report

目前为 2021-05-14 提交的版本。查看 最新版本

// ==UserScript==
// @name         ZJU Health Report
// @namespace    https://wfb.ink/
// @version      21.05.12.05
// @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 in_school = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[15]/div/div/div[1]/span[1]");
    in_school.click();
    
    //选择14日进出境情况
    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.click();

    //选择承诺
    var credit = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[34]/div/div/div/span[1]");
    credit.click();
    
    //点击获取位置
    var location = getElementByXpath("/html/body/div[1]/div[1]/div/section/div[4]/ul/li[19]/div/input");
    location.click();
    
    ///如果提示未获取到地理位置
    var not_locate = getElementByXpath("/html/body/div[4]/div/div[2]/div");
    if(not_locate.length)
    {
        alert(not_locate.length);
        not_locate.click();
    }
    sleep(10);
    alert("wwwwwwwww");

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

})();

QingJ © 2025

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