| | |
| | | console.log('📋 使用Player信息显示:', userInfo.player) |
| | | displayUserInfo.name = userInfo.player.name || userInfo.name || '' |
| | | displayUserInfo.phone = userInfo.player.phone || userInfo.phone || '' |
| | | displayUserInfo.avatarUrl = userInfo.player.avatarUrl || userInfo.avatarUrl || '' |
| | | displayUserInfo.avatarUrl = userInfo.avatarUrl || '' |
| | | |
| | | // 处理性别信息:0=男,1=女 |
| | | if (userInfo.player.gender !== undefined && userInfo.player.gender !== null) { |
| | |
| | | const updateData = { |
| | | 'formData.name': userInfo.name || '', |
| | | 'formData.phone': userInfo.phone || '', |
| | | 'formData.email': userInfo.email || '' |
| | | 'formData.email': userInfo.email || '', |
| | | 'formData.avatarUrl': userInfo.avatarUrl || '' |
| | | } |
| | | |
| | | // 如果用户有Player信息,优先使用Player的详细信息 |
| | |
| | | console.log('📋 使用Player信息预填充:', userInfo.player) |
| | | updateData['formData.name'] = userInfo.player.name || userInfo.name || '' |
| | | updateData['formData.phone'] = userInfo.player.phone || userInfo.phone || '' |
| | | updateData['formData.avatarUrl'] = userInfo.avatarUrl || '' |
| | | |
| | | // 处理性别信息:0=男,1=女 |
| | | if (userInfo.player.gender !== undefined && userInfo.player.gender !== null) { |
| | |
| | | } |
| | | |
| | | console.log('✅ 预填充数据:', updateData) |
| | | console.log('🖼️ 设置头像URL:', updateData['formData.avatarUrl']) |
| | | this.setData(updateData) |
| | | } else { |
| | | console.log('⚠️ 未找到用户信息,无法预填充') |
| | |
| | | success: (res) => { |
| | | wx.hideLoading() |
| | | if (res.statusCode === 200) { |
| | | // 根据实际文件扩展名确定文件类型 |
| | | const fileName = attachment.name || '' |
| | | const fileExt = fileName.split('.').pop().toLowerCase() |
| | | const fileTypeMap = { |
| | | 'word': 'doc', |
| | | 'excel': 'xls', |
| | | 'ppt': 'ppt' |
| | | 'doc': 'doc', |
| | | 'docx': 'docx', |
| | | 'xls': 'xls', |
| | | 'xlsx': 'xlsx', |
| | | 'ppt': 'ppt', |
| | | 'pptx': 'pptx' |
| | | } |
| | | |
| | | wx.openDocument({ |
| | | filePath: res.tempFilePath, |
| | | fileType: fileTypeMap[fileType] || 'doc', |
| | | fileType: fileTypeMap[fileExt] || 'doc', |
| | | success: () => { |
| | | console.log('文档打开成功') |
| | | }, |
| | | fail: (err) => { |
| | | console.error('文档打开失败:', err) |
| | | wx.showToast({ |
| | | title: '文档打开失败', |
| | | icon: 'none' |
| | | wx.showModal({ |
| | | title: '打开失败', |
| | | content: '文档打开失败,可能是文件格式不支持或文件损坏', |
| | | showCancel: false, |
| | | confirmText: '确定' |
| | | }) |
| | | } |
| | | }) |
| | |
| | | activityPlayerId: result.activityPlayerId |
| | | }) |
| | | |
| | | // 第三步:报名成功后强制调用wxlogin获取新的JWT token |
| | | console.log('📱 报名成功,开始强制调用wxlogin获取新的JWT token') |
| | | try { |
| | | await app.wxLogin() |
| | | console.log('✅ 报名成功后wxlogin调用成功,已获取新的JWT token') |
| | | } catch (wxLoginError) { |
| | | console.error('❌ 报名成功后wxlogin调用失败:', wxLoginError) |
| | | // wxlogin失败不影响报名成功的提示,只记录错误 |
| | | } |
| | | |
| | | wx.showToast({ |
| | | title: '报名成功', |
| | | icon: 'success' |