const request = require('../../utils/request') Page({ data: { loading: true, userInfo: null, activityId: null, targetUserId: null }, onLoad(options) { const activityId = options.activity_id ? Number(options.activity_id) : null const targetUserId = options.target_user_id ? Number(options.target_user_id) : null this.setData({ activityId, targetUserId }) if (!activityId || !targetUserId) { wx.showToast({ title: '缺少匹配信息', icon: 'none' }) this.setData({ loading: false }) return } this.loadDetail() }, async loadDetail() { try { const detail = await request({ url: `/activities/${this.data.activityId}/matches/${this.data.targetUserId}/detail` }) const otherUser = detail.other_user || {} const profileImages = Array.isArray(otherUser.profile_images) ? otherUser.profile_images : [] this.setData({ userInfo: { ...otherUser, profileImages, previewImage: profileImages.length ? profileImages[0] : (otherUser.avatar_url || ''), nicknameText: otherUser.nickname || '匿名用户', cityText: otherUser.city || '城市未知', educationText: otherUser.education || '学历未知', hobbiesText: Array.isArray(otherUser.hobbies) && otherUser.hobbies.length ? otherUser.hobbies.join('、') : '未填写爱好', jobIndustryText: otherUser.job_industry || '未填写', jobCompanyText: otherUser.job_company || '未填写', incomeRangeText: otherUser.income_range || '未填写', selfIntroText: otherUser.self_intro || '暂无自我介绍', matchedAt: detail.matched_at } }) } catch (err) { console.error('Load match detail failed:', err) wx.showToast({ title: err.message || '查看信息失败', icon: 'none' }) this.setData({ userInfo: null }) } finally { this.setData({ loading: false }) } } })