From 7293619ab7101498bcc8e69aacea63b09ed1348e Mon Sep 17 00:00:00 2001 From: xuesinan <1404152492@qq.com> Date: Sat, 23 Oct 2021 22:27:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 115 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 93 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index a0334de..da49a6a 100644 --- a/index.html +++ b/index.html @@ -42,26 +42,35 @@ -
+
-
-
-
培训报名
-
- - - + -
-

山西跳协**培训红头文件

- +
-
@@ -72,12 +81,8 @@ projectId: '', roleId: '', dom: '', - lists: [], - currentIndex: '', - memberId: '', // 打卡人id - checkerId: '', // 审核员id - checkerName: '', // 审核员 - id: '', // 记录id + planId: '', // 培训计划ID + playerId: '', // 报名学员ID init() { this.dom = document.querySelector("div[data-root=p1449996929974149120]"); @@ -103,6 +108,10 @@ const { success, code, data, msg } = res; if (success && code === 200) { that.token = data.token; + // 查看培训计划 + that.getTrainPlan(); + // 查询委派导师 + that.getAppointStatus(); // 获取报名信息 that.getPersonInfo(); } else { @@ -111,6 +120,68 @@ }); }, + /** + * 查询当前培训计划 + */ + getTrainPlan(){ + var that = this; + fetch(`https://test.tall.wiki/gateway/sports/training/get`, { + headers: new Headers({ + 'Authorization': 'Bearer ' + that.token, + 'Content-Type': 'application/json; charset=utf-8' + }), + method: 'POST', + body: JSON.stringify({ + param: {projectId: that.projectId} + }) + }) + .then(function(response) { + return response.json(); + }) + .then(function(res) { + const { success, code, data, msg } = res; + if (success && code === 200) { + that.planId = data.id; + that.dom.querySelector('.file-name').innerHTML = data.name; + } else { + console.log('msg: ', msg); + } + }); + }, + + // 查询委派信息 + getAppointStatus() { + var that = this; + + // that.dom.querySelector('.student-box').style.display = 'block'; + // that.dom.querySelector('.student-load').style.display = 'none'; + + fetch(`https://test.tall.wiki/gateway/sports/teacher/getAppoint`, { + headers: new Headers({ + 'Authorization': 'Bearer ' + that.token, + 'Content-Type': 'application/json; charset=utf-8' + }), + method: 'POST', + body: JSON.stringify({ + param: { projectId: that.projectId } + }) + }) + .then(function(response) { + return response.json(); + }) + .then(function(res) { + const { success, code, data, msg } = res; + if (success && code === 200) { + if (!data) { + that.dom.querySelector('.student-box').style.display = 'block'; + that.dom.querySelector('.student-load').style.display = 'none'; + } + } else { + console.log('msg: ', msg); + } + }); + }, + // 获取报名信息 getPersonInfo() { var that = this; @@ -123,6 +194,7 @@ method: 'POST', body: JSON.stringify({ param: { + playerId: that.playerId, projectId: that.projectId } }) @@ -133,7 +205,6 @@ .then(function(res) { const { success, code, data, msg } = res; if (success && code === 200) { - console.log(data); if (data) { var personInfo = that.dom.querySelector('.person-info'); personInfo.style.display = 'flex';