Codex Assistant
昨天 afeeed281e60466b576fbe74d339634cc5d07b82
wx/pages/project/detail.js
@@ -43,8 +43,6 @@
        if (projectDetail.submissionFiles) {
          projectDetail.submissionFiles.forEach(file => {
            file.fileSizeText = this.formatFileSize(file.fileSize)
            // 字段已经是正确的名称,无需映射
            // fullUrl, fullThumbUrl, fileSize, fileExt 都是正确的字段名
          })
        }
@@ -87,62 +85,42 @@
      query GetProjectDetail($id: ID!) {
        activityPlayerDetail(id: $id) {
          id
          playerInfo {
            id
            name
            phone
            gender
            birthday
            education
            introduction
            description
            avatarUrl
            avatar {
              id
              fullUrl
              fullThumbUrl
              name
              fileSize
              fileExt
            }
            userInfo {
              userId
              name
              phone
              avatarUrl
            }
          }
          regionInfo {
            id
            name
            fullPath
          }
          activityName
          activityId
          playerId
          playerName
          playerGender
          playerPhone
          playerEducation
          playerBirthDate
          playerIdCard
          playerAddress
          projectName
          description
          feedback
          state
          stageId
          submissionFiles {
          projectDescription
          projectCategory
          projectTags
          projectFiles {
            id
            fullUrl
            fullThumbUrl
            name
            fileName
            fileUrl
            fileSize
            fileExt
            mediaType
            fileType
            uploadTime
          }
          ratingForm {
            schemeId
            schemeName
            items {
          submitTime
          reviewTime
          reviewerId
          reviewerName
          score
          rating {
              id
              name
              maxScore
              orderNo
            judgeId
            judgeName
            score
            feedback
            ratingTime
            }
            totalMaxScore
          }
          state
          feedback
        }
      }
    `
@@ -157,14 +135,22 @@
  // 获取评分统计
  async getRatingStatsFromAPI(projectId) {
    // 暂时返回空的评分数据,避免GraphQL查询错误
    // TODO: 需要后端提供合适的评分统计查询接口
    try {
      return {
        averageScore: null,
        ratingCount: 0,
        judgeRatings: []
    const query = `
      query GetRatingStats($activityPlayerId: ID!) {
        ratingStats(activityPlayerId: $activityPlayerId) {
          averageScore
          totalRatings
          scoreDistribution {
            score
            count
      }
        }
      }
    `
    try {
      const result = await app.graphqlRequest(query, { activityPlayerId: projectId })
      return result.ratingStats
    } catch (error) {
      throw error
    }