From 6f2a1c0b1c71250d1484793c926e930e61338d9c Mon Sep 17 00:00:00 2001 From: kdxcxs Date: Wed, 4 Nov 2020 13:40:13 +0800 Subject: [PATCH] feat: pop out loading modal once register button is clicked --- src/Male.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Male.js b/src/Male.js index 4df3616..ecdccbf 100644 --- a/src/Male.js +++ b/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 + '时失败'); } });