Browse Source

培训导师

tiaosheng-ds
xuesinan 4 years ago
parent
commit
91ee8b49da
  1. 96
      index.html

96
index.html

@ -49,8 +49,8 @@
<div class="flex justify-between">
<div class="text-sm">培训委派</div>
<div class="btn-group">
<button class="nightClockBtn mr-2 text-sm text-gray-400 border border-gray-400 rounded w-12 h-6" onclick="p1449944565271502848.refuse()">拒绝</button>
<button class="nightClockBtn bg-blue-500 text-sm rounded py-1 px-3 text-white" onclick="p1449944565271502848.submit(1)">接受</button>
<button class="nightClockBtn mr-2 px-2.5 h-6 text-sm text-gray-400 border border-gray-400 rounded" onclick="p1449944565271502848.refuse()">拒绝</button>
<button class="nightClockBtn px-2.5 h-6 bg-blue-500 text-sm rounded text-white" onclick="p1449944565271502848.submit(1)">接受</button>
</div>
<div class="refuse-status text-yellow-500" style="display: none;">已拒绝</div>
</div>
@ -62,13 +62,13 @@
<div class="mt-2.5 px-2 flex justify-between items-center w-full h-8 border border-gray-200 rounded-sm text-sm">
<p style="color: #999999;">报名人员</p>
<!-- <button class="check-btn text-xs text-blue-400 border border-blue-400 rounded-full w-10 h-5" style="display: none;">查看</button> -->
<button class="check-btn-disabled text-xs text-blue-400 border border-blue-400 rounded-full w-10 h-5" onclick="p1449944565271502848.peopleList()">查看</button>
<button class="check-btn-disabled text-xs text-gray-400 border border-gray-400 rounded-full w-10 h-5" disabled>查看</button>
<button class="check-btn text-xs text-blue-400 border border-blue-400 rounded-full w-10 h-5" style="display: none;" onclick="p1449944565271502848.peopleList()">查看</button>
</div>
<div class="refuse-reason mt-2.5 px-2 py-1 flex justify-between w-full border border-gray-200 rounded-sm text-sm" style="display: none;">
<p class="w-20 flex-shrink-0 text-gray-400">拒绝原因</p>
<div>时间原因已拒绝</div>
<div class="reason-text">时间原因已拒绝</div>
</div>
<div class="pl-7 pr-7 pt fixed z-10 statusChoose bg-black bg-opacity-50" style="display:none;top: 0;bottom: 0;left: 0;right: 0; padding-top: calc((100vh - 250px) / 2);">
@ -99,6 +99,12 @@
</div>
<script>
let btns = document.querySelector('.btn-group'); // 通过拒绝按钮
let refuse = document.querySelector('.refuse-status'); // 已拒绝
let refuseReason = document.querySelector('.refuse-reason'); // 拒绝原因
let checkBtnDisabled = document.querySelector('.check-btn-disabled'); // 查看 -- 不可点击
let checkBtn = document.querySelector('.check-btn'); // 查看
var p1449944565271502848 = {
token: '',
projectId: '',
@ -108,6 +114,8 @@
planTeacherId: '',
remark: '',
status: 0,
isStu: 0, // 是否已有学员报名
isAccept: 0, // 是否接受委派
init() {
this.dom = document.querySelector("div[data-root=p1449944565271502848]");
@ -174,7 +182,10 @@
// 查询委派信息
getAppointStatus() {
var that = this;
var teacherTitle = that.dom.querySelector('.teacher-title');
var teacherBox = that.dom.querySelector('.teacher-box');
teacherTitle.style.display = 'none';
teacherBox.style.display = 'block';
fetch(`https://test.tall.wiki/gateway/sports/teacher/getAppoint`, {
headers: new Headers({
'Authorization': 'Bearer ' + that.token,
@ -197,6 +208,28 @@
that.planTeacherId = data.planTeacherId;
that.remark = data.remark;
that.status = data.status;
if (that.status == 0) {
// 未接受
isAccept = 0;
btns.style.display = 'block';
refuse.style.display = 'none';
refuseReason.style.display = 'none';
} else if (that.status === 1) {
// 已接受
isAccept = 1;
btns.style.display = 'none';
refuse.style.display = 'block';
refuseReason.style.display = 'none';
} else {
// 已拒绝
isAccept = 0;
btns.style.display = 'none';
refuse.style.display = 'none';
refuseReason.style.display = 'block';
refuseReason.innerHTML = data.remark;
}
var teacherTitle = that.dom.querySelector('.teacher-title');
var teacherBox = that.dom.querySelector('.teacher-box');
teacherTitle.style.display = 'none';
@ -247,12 +280,14 @@
.then(function(res) {
const { success, code, data, msg } = res;
if (success && code === 200) {
var reasonBox = that.dom.querySelector('.refuse-reason');
reasonBox.style.display = 'flex';
var btnGroup = that.dom.querySelector('.btn-group');
var refuseText = that.dom.querySelector('.refuse-status');
btnGroup.style.display = 'none';
refuseText.style.display = 'block';
btns.style.display = 'none';
if (type === 1) {
refuseReason.style.display = 'none';
refuse.style.display = 'none';
} else {
refuseReason.style.display = 'flex';
refuse.style.display = 'block';
}
} else {
console.log('msg: ', msg);
}
@ -265,6 +300,43 @@
statusChoose.style.display='none';
},
// 报名学员
getStrudentList() {
fetch(`https://test.tall.wiki/gateway/sports/player/query`, {
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) {
isStu = 1;
}
if (isStu === 1 && isAccept === 1) {
checkBtnDisabled.style.display = 'none';
checkBtn.style.display = 'block';
} else {
checkBtnDisabled.style.display = 'block';
checkBtn.style.display = 'none';
}
} else {
console.log('msg: ', msg);
}
});
},
// 查看红头文件
lookFile() {
const pId = this.dom.parentNode.getAttribute('data-pid');

Loading…
Cancel
Save