chore: establish V1.1 recovery baseline
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* 活动互选结果页 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}`
|
||||
});
|
||||
},
|
||||
|
||||
startChat(userId) {
|
||||
wx.navigateTo({
|
||||
url: `/pages/chat/chat?userId=${userId}&activityId=${this.data.activityId}`
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user