diff --git a/miniprogram/pages/match/challenge-detail/index.js b/miniprogram/pages/match/challenge-detail/index.js index ea88d8b4..7a600d27 100644 --- a/miniprogram/pages/match/challenge-detail/index.js +++ b/miniprogram/pages/match/challenge-detail/index.js @@ -405,10 +405,8 @@ Page({ icon: 'success' }) - // 刷新数据 - setTimeout(() => { - this.loadMatchDetail() - }, 1500) + // 接口执行成功后刷新当前比赛详情 + await this.loadMatchDetail() } catch (e) { wx.hideLoading() console.error('响应挑战失败:', e) @@ -491,10 +489,8 @@ Page({ wx.showToast({ title: '比分已提交,等待对方确认', icon: 'success' }) this.closeScoreModal() - // 刷新数据 - setTimeout(() => { - this.loadMatchDetail() - }, 1500) + // 接口执行成功后刷新当前比赛详情 + await this.loadMatchDetail() } catch (e) { wx.hideLoading() console.error('提交比分失败:', e) @@ -523,14 +519,13 @@ Page({ icon: 'success' }) - // 刷新数据 - setTimeout(() => { - this.loadMatchDetail() - }, 1500) + // 接口执行成功后刷新当前比赛详情 + await this.loadMatchDetail() } catch (e) { wx.hideLoading() console.error('确认比分失败:', e) - wx.showToast({ title: '操作失败', icon: 'none' }) + // 显示后端返回的具体错误信息,便于排查 + wx.showToast({ title: e.message || '操作失败', icon: 'none' }) } },