-
培训报名
-
-
-
-
+
+
+
+
培训报名
+
+
+
+
+
+
+
+
-
-
-
山西跳协**培训红头文件
-
+
+ 报名信息
+
+
-
@@ -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';