Browse Source

审核

tiaosheng-zx
xuesinan 4 years ago
parent
commit
8d1de21fc2
  1. 82
      index.html

82
index.html

@ -145,12 +145,11 @@
</div> </div>
<script> <script>
let preview = document.querySelector('.img-preview'); // 预览 document.querySelector('.img-preview').onclick = function(e){
preview.onclick = function(e){
e = window.event || e; e = window.event || e;
let parentApp = document.getElementById('img'); let parentApp = document.getElementById('img');
if(!parentApp.contains(e.target)){ if(!parentApp.contains(e.target)){
preview.style.display = 'none'; document.querySelector('.img-preview').style.display = 'none';
} }
} }
@ -252,46 +251,41 @@
return false; return false;
} }
fetch(`https://test.tall.wiki/gateway/sports/training/audit`, { that.dom.querySelector('.btn-group').style.display = 'none';
headers: new Headers({ if (type == 2) {
'Authorization': 'Bearer ' + that.token, that.dom.querySelector('.reason-box').style.display = 'flex';
'Content-Type': 'application/json; charset=utf-8' that.dom.querySelector('.reason-content').innerHTML = reason;
}), }
method: 'POST',
body: JSON.stringify({ // fetch(`https://test.tall.wiki/gateway/sports/training/audit`, {
param: { // headers: new Headers({
id: that.planId, // 'Authorization': 'Bearer ' + that.token,
type: type, // 'Content-Type': 'application/json; charset=utf-8'
remark: type === 1 ? '' : reason // }),
} // method: 'POST',
}) // body: JSON.stringify({
}) // param: {
.then(function(response) { // id: that.planId,
return response.json(); // type: type,
}) // remark: type === 1 ? '' : reason
.then(function(res) { // }
const { success, code, data, msg } = res; // })
if (success && code === 200) { // })
// var trainPlanReject = that.dom.querySelector('.train-plan-reject'); // .then(function(response) {
// var trainPlanCheck = that.dom.querySelector('.train-plan-check'); // return response.json();
that.dom.querySelector('.btn-group').style.display = 'none'; // })
if (type == 2) { // .then(function(res) {
that.dom.querySelector('.reason-box').style.display = 'flex'; // const { success, code, data, msg } = res;
that.dom.querySelector('.reason-content').innerHTML = reason; // if (success && code === 200) {
// trainPlanReject.style.display = 'block'; // that.dom.querySelector('.btn-group').style.display = 'none';
// trainPlanCheck.style.display = 'none'; // if (type == 2) {
} else { // that.dom.querySelector('.reason-box').style.display = 'flex';
// trainPlanReject.style.display = 'none'; // that.dom.querySelector('.reason-content').innerHTML = reason;
// trainPlanCheck.style.display = 'block'; // }
// let pass = that.dom.querySelector('.train-pass-status'); // } else {
// let btns = that.dom.querySelector('.train-pass-btn'); // console.log('msg: ', msg);
// pass.style.display = 'block'; // }
// btns.style.display = 'none'; // });
}
} else {
console.log('msg: ', msg);
}
});
}, },
// 取消 // 取消
@ -302,7 +296,7 @@
// 预览 // 预览
bigImg() { bigImg() {
preview.style.display = 'flex'; document.querySelector('.img-preview').style.display = 'flex';
}, },
} }
p1449944565028233216.init() p1449944565028233216.init()

Loading…
Cancel
Save