From c4a9cad1c50e89365e2a58b50e259af642ed3b8c Mon Sep 17 00:00:00 2001 From: Codex Assistant <codex@example.com> Date: 星期二, 07 十月 2025 16:12:20 +0800 Subject: [PATCH] feat(review): 调整评审详情展示顺序与样式,描述支持多行,项目信息列宽40/60 fix(auth): 登录页与首页循环跳转保护;api.ts 在登录页不再重定向;401分支在登录页不跳转 fix(router): /login 放行策略优化,避免死循环;评审列表跳转到 /project-review/:id/detail fix(frontend): 补齐 utils/appConfig.ts,避免启动白屏 fix(review): 详情页提交评分缺少stageId时回退使用项目详情的stageId feat(backend): ActivityPlayerDetailResponse.playerInfo 补充 avatarUrl/avatar,服务组装时填充用户头像 chore(dev): 启动脚本注入本地JWT密钥,重启前后端 --- wx/pages/profile/profile.js | 74 ++++++++++++++++++++++++++++++++++++ 1 files changed, 73 insertions(+), 1 deletions(-) diff --git a/wx/pages/profile/profile.js b/wx/pages/profile/profile.js index 15cedc9..99de718 100644 --- a/wx/pages/profile/profile.js +++ b/wx/pages/profile/profile.js @@ -27,6 +27,14 @@ isJudge: false, isOrganizer: false, hasPlayer: false, + isEmployee: false, + + // 鍛樺伐瀹℃牳缁熻 + employeeReviewStats: { + pendingCount: 0, + approvedCount: 0, + rejectedCount: 0 + }, // 璇勫鐩稿叧鏁版嵁 judgeStats: { @@ -198,6 +206,12 @@ grade roles createdAt + employee { + id + name + roleId + description + } player { id name @@ -218,6 +232,7 @@ const isJudge = userRoles.includes('JUDGE') const isOrganizer = userRoles.includes('ORGANIZER') const hasPlayer = userInfo.player && userInfo.player.id + const isEmployee = !!(userInfo.employee && userInfo.employee.id) // 澶勭悊澶村儚鏂囧瓧 const avatarText = (userInfo.name || '鐢ㄦ埛').substring(0, 1) @@ -228,7 +243,8 @@ userRoles, isJudge, isOrganizer, - hasPlayer + hasPlayer, + isEmployee }) // 鏇存柊鍏ㄥ眬鐢ㄦ埛淇℃伅 @@ -241,6 +257,18 @@ if (isOrganizer) { this.loadOrganizerStats() + } + + if (isEmployee) { + this.loadEmployeeReviewStats() + } else { + this.setData({ + employeeReviewStats: { + pendingCount: 0, + approvedCount: 0, + rejectedCount: 0 + } + }) } } } catch (error) { @@ -358,6 +386,39 @@ } }, + // 鍔犺浇鍛樺伐瀹℃牳缁熻 + async loadEmployeeReviewStats(keyword = null) { + if (!this.data.isEmployee) { + return + } + + try { + const query = ` + query EmployeeReviewStats($keyword: String) { + employeeReviewStats(keyword: $keyword) { + pendingCount + approvedCount + rejectedCount + } + } + ` + + const variables = {} + if (keyword && typeof keyword === 'string' && keyword.trim()) { + variables.keyword = keyword.trim() + } + + const result = await graphqlRequest(query, variables) + + if (result && result.employeeReviewStats) { + this.setData({ + employeeReviewStats: result.employeeReviewStats + }) + } + } catch (error) { + console.error('鍔犺浇鍛樺伐瀹℃牳缁熻澶辫触:', error) + } + }, // 鍔犺浇璇勫缁熻鏁版嵁 async loadJudgeStats() { try { @@ -465,6 +526,17 @@ }) }, + // 璺宠浆鍒板憳宸ュ鏍搁〉闈� + goToEmployeeReviewPage() { + if (!this.data.isEmployee) { + return + } + + wx.navigateTo({ + url: '/pages/profile/employee-review' + }) + }, + // 鏌ョ湅鎶ュ悕璇︽儏 -- Gitblit v1.8.0