Browse Source

feat: pop out loading modal once register button is clicked

master
kdxcxs 4 years ago
parent
commit
6f2a1c0b1c
  1. 3
      src/Male.js

3
src/Male.js

@ -86,6 +86,7 @@ class Male extends React.Component {
handleClick(program_name) {
const program_type = '男子';
this.openModal('加载中', '');
fetch('/register', {
method: 'Post',
body: JSON.stringify({
@ -96,8 +97,10 @@ class Male extends React.Component {
.then(response => response.json())
.then(json => {
if (json.result === 'success') {
this.handleCloseModal();
this.openModal('成功', '成功报名男子项目' + program_name);
} else {
this.handleCloseModal();
this.openModal('失败', '报名男子项目' + program_name + '时失败');
}
});

Loading…
Cancel
Save