| | |
| | | items { |
| | | id |
| | | name |
| | | description |
| | | maxScore |
| | | weight |
| | | sortOrder |
| | | orderNo |
| | | } |
| | | } |
| | | } |
| | |
| | | videos: detail.submissionFiles ? detail.submissionFiles |
| | | .filter(file => file.mediaType === 2) |
| | | .map(file => file.fullUrl || file.url) : [], |
| | | mediaList: (detail.submissionFiles || []).map(file => { |
| | | const mt = file.mediaType |
| | | let typeStr = '' |
| | | if (mt === 1 || mt === 'image' || (typeof mt === 'string' && mt.startsWith('image'))) typeStr = 'image' |
| | | else if (mt === 2 || mt === 'video' || (typeof mt === 'string' && mt.startsWith('video'))) typeStr = 'video' |
| | | else if ((file.fileExt || '').toLowerCase().includes('pdf')) typeStr = 'pdf' |
| | | else if ((file.fileExt || '').toLowerCase().includes('doc')) typeStr = 'word' |
| | | else typeStr = 'file' |
| | | return { |
| | | id: file.id, |
| | | name: file.name, |
| | | size: file.fileSize, |
| | | mediaType: typeStr, |
| | | thumbUrl: file.fullThumbUrl || file.thumbUrl || file.fullUrl || file.url, |
| | | url: file.fullUrl || file.url |
| | | } |
| | | }), |
| | | participant: { |
| | | id: detail.playerInfo.id, |
| | | name: detail.playerInfo.name, |
| | | school: detail.regionInfo ? detail.regionInfo.name : '', |
| | | major: detail.playerInfo.education || '', |
| | | phone: detail.playerInfo.phone || '', |
| | | gender: this.getGenderText(detail.playerInfo.gender), |
| | | birthday: detail.playerInfo.birthday || '', |
| | | region: detail.regionInfo ? detail.regionInfo.name : '', |
| | | education: detail.playerInfo.education || '', |
| | | avatar: detail.playerInfo.userInfo?.avatarUrl || '/images/default-avatar.svg' |
| | | }, |
| | | status: detail.state === 1 ? 'APPROVED' : detail.state === 2 ? 'REJECTED' : 'PENDING' |
| | |
| | | currentJudgeRating(activityPlayerId: $activityPlayerId) { |
| | | id |
| | | totalScore |
| | | comment |
| | | remark |
| | | status |
| | | ratedAt |
| | | items { |
| | | ratingItemId |
| | | ratingItemName |
| | | score |
| | | maxScore |
| | | weightedScore |
| | | } |
| | | } |
| | | } |
| | |
| | | this.setData({ |
| | | scores, |
| | | totalScore, |
| | | comment: rating.comment || '', |
| | | comment: rating.remark || '', |
| | | existingReview: rating, |
| | | reviewStatus: rating.status || 'COMPLETED' |
| | | }) |
| | |
| | | |
| | | criteria.forEach(criterion => { |
| | | const score = scores[criterion.id] || 0 |
| | | totalScore += score * (criterion.weight || 1) |
| | | totalScore += score |
| | | }) |
| | | |
| | | this.setData({ totalScore }) |
| | |
| | | }) |
| | | }, |
| | | |
| | | // 媒体点击 |
| | | // 媒体点击(通过 index 定位 mediaList 项) |
| | | onMediaTap(e) { |
| | | const { url, type } = e.currentTarget.dataset |
| | | |
| | | if (type === 'image') { |
| | | const { index } = e.currentTarget.dataset |
| | | const item = this.data.submission?.mediaList?.[index] |
| | | if (!item) return |
| | | if (item.mediaType === 'image') { |
| | | const imgs = (this.data.submission.mediaList || []) |
| | | .filter(it => it.mediaType === 'image') |
| | | .map(it => it.url) |
| | | wx.previewImage({ |
| | | current: url, |
| | | urls: this.data.submission.images || [] |
| | | current: item.url, |
| | | urls: imgs.length ? imgs : [item.url] |
| | | }) |
| | | } else if (type === 'video') { |
| | | } else if (item.mediaType === 'video') { |
| | | this.setData({ |
| | | showMediaPreview: true, |
| | | currentMedia: url, |
| | | currentMedia: item.url, |
| | | mediaType: 'video' |
| | | }) |
| | | } else { |
| | | wx.downloadFile({ |
| | | url: item.url, |
| | | success: (res) => { |
| | | if (res.statusCode === 200) { |
| | | wx.openDocument({ |
| | | filePath: res.tempFilePath, |
| | | showMenu: true |
| | | }) |
| | | } else { |
| | | wx.showToast({ title: '预览失败', icon: 'none' }) |
| | | } |
| | | }, |
| | | fail: () => wx.showToast({ title: '下载失败', icon: 'none' }) |
| | | }) |
| | | } |
| | | }, |
| | |
| | | showMediaPreview: false, |
| | | currentMedia: null |
| | | }) |
| | | }, |
| | | |
| | | // 点击预览按钮:图片/视频用 wx.previewMedia,文档用 openDocument |
| | | onPreviewTap(e) { |
| | | const { index } = e.currentTarget.dataset |
| | | const list = this.data.submission?.mediaList || [] |
| | | const item = list[index] |
| | | if (!item) return |
| | | |
| | | if (item.mediaType === 'image' || item.mediaType === 'video') { |
| | | const mediaList = list |
| | | .filter(m => m.mediaType === 'image' || m.mediaType === 'video') |
| | | .map(m => ({ |
| | | url: m.url, |
| | | type: m.mediaType === 'video' ? 'video' : 'image', |
| | | poster: m.thumbUrl || m.url |
| | | })) |
| | | const current = Math.max(0, mediaList.findIndex(m => m.url === item.url)) |
| | | wx.previewMedia({ |
| | | sources: mediaList, |
| | | current |
| | | }) |
| | | } else { |
| | | wx.downloadFile({ |
| | | url: item.url, |
| | | success: (res) => { |
| | | if (res.statusCode === 200) { |
| | | wx.openDocument({ |
| | | filePath: res.tempFilePath, |
| | | showMenu: true |
| | | }) |
| | | } else { |
| | | wx.showToast({ title: '预览失败', icon: 'none' }) |
| | | } |
| | | }, |
| | | fail: () => wx.showToast({ title: '下载失败', icon: 'none' }) |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 下载文件 |
| | |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | if (comment.trim().length < 10) { |
| | | wx.showToast({ |
| | | title: '评审意见至少10个字符', |
| | | icon: 'error' |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | |
| | | return true |
| | | }, |
| | | |
| | |
| | | |
| | | // 构建评分项数组 |
| | | const ratings = criteria.map(criterion => ({ |
| | | itemId: criterion.id, |
| | | score: scores[criterion.id] || 0 |
| | | itemId: parseInt(criterion.id), |
| | | score: parseFloat(scores[criterion.id] || 0) |
| | | })) |
| | | |
| | | const mutation = ` |
| | |
| | | ` |
| | | |
| | | const input = { |
| | | activityPlayerId, |
| | | stageId: activity.stageId, |
| | | activityPlayerId: parseInt(activityPlayerId), |
| | | stageId: parseInt(activity.id), |
| | | ratings, |
| | | comment: comment.trim() |
| | | } |
| | |
| | | |
| | | const input = { |
| | | activityPlayerId, |
| | | stageId: activity.stageId, |
| | | stageId: activity.id, |
| | | ratings, |
| | | comment: comment.trim() |
| | | } |
| | |
| | | } |
| | | }, |
| | | |
| | | // 查看其他评审 |
| | | // 查看其他评审 - 已隐藏功能 |
| | | /* |
| | | onViewOtherReviews() { |
| | | wx.navigateTo({ |
| | | url: `/pages/judge/reviews?activityPlayerId=${this.data.activityPlayerId}` |
| | | }) |
| | | }, |
| | | */ |
| | | |
| | | // 联系参赛者 |
| | | // 联系参赛者:直接拨打电话 |
| | | onContactParticipant() { |
| | | const { submission } = this.data |
| | | |
| | | if (submission.participant) { |
| | | wx.showActionSheet({ |
| | | itemList: ['发送消息', '查看详情'], |
| | | success: (res) => { |
| | | switch (res.tapIndex) { |
| | | case 0: |
| | | // 发送消息功能 |
| | | wx.navigateTo({ |
| | | url: `/pages/chat/chat?userId=${submission.participant.id}` |
| | | }) |
| | | break |
| | | case 1: |
| | | // 查看用户详情 |
| | | wx.navigateTo({ |
| | | url: `/pages/user/profile?userId=${submission.participant.id}` |
| | | }) |
| | | break |
| | | } |
| | | } |
| | | }) |
| | | const phone = |
| | | this.data.submission?.participant?.phone || |
| | | this.data.submission?.participant?.userInfo?.phone |
| | | if (phone) { |
| | | wx.makePhoneCall({ phoneNumber: String(phone) }) |
| | | } else { |
| | | wx.showToast({ title: '无联系电话', icon: 'none' }) |
| | | } |
| | | }, |
| | | |
| | |
| | | } |
| | | }, |
| | | |
| | | // 性别转换函数 |
| | | getGenderText(gender) { |
| | | if (gender === 0) return '男' |
| | | if (gender === 1) return '女' |
| | | return '未填写' |
| | | }, |
| | | |
| | | // 格式化日期 |
| | | formatDate(dateString) { |
| | | return formatDate(dateString, 'YYYY-MM-DD HH:mm') |
| | |
| | | // 分享页面 |
| | | onShareAppMessage() { |
| | | return { |
| | | title: '蓉易创 - 评审作品', |
| | | title: '蓉e创 - 评审作品', |
| | | path: '/pages/index/index' |
| | | } |
| | | } |