ZJU health report

To submit the health report

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         ZJU health report
// @namespace    https://wfb.ink/
// @version      05.10
// @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;
    }

    //选择是否在校
    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");
    alert(location.getAttribute("readonly"));
    location.click();
         

})();