Files
danyang-match/miniapp/pages/activity-matches/activity-matches.js
T

54 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-09-09 22:05:00 +08:00
/**
* 活动互选结果页 U36
* 展示活动中双方互相表达的意向结果
*/
const api = require('../../utils/api');
Page({
data: {
activityId: '',
activityTitle: '',
matches: [],
loading: true
},
onLoad(options) {
if (options.activityId) {
this.setData({ activityId: options.activityId });
this.loadMatches();
}
},
async loadMatches() {
this.setData({ loading: true });
try {
const token = wx.getStorageSync('accessToken');
const res = await api.get(`/activities/${this.data.activityId}/interests/mutual`, {}, {
Authorization: `Bearer ${token}`
});
// 获取活动标题
const actRes = await api.get(`/activities/${this.data.activityId}`, {}, {
Authorization: `Bearer ${token}`
});
this.setData({
activityTitle: actRes.title,
matches: res || [],
loading: false
});
} catch (err) {
this.setData({ loading: false });
}
},
onRefresh() {
this.loadMatches();
},
goToProfile(userId) {
wx.navigateTo({
url: `/pages/profile-detail/profile-detail?id=${userId}&activityId=${this.data.activityId}`
});
},
});