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}`
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"navigationBarTitleText": "活动缘分",
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<!-- 活动互选结果页 U36 -->
|
||||
<view class="page">
|
||||
<view class="header">
|
||||
<text class="title">活动缘分</text>
|
||||
<text class="activity-name">{{activityTitle}}</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{loading}}" class="loading-state">
|
||||
<text>加载中...</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{!loading && matches.length === 0}}" class="empty-state">
|
||||
<text class="empty-icon">✦</text>
|
||||
<text>暂无双向匹配</text>
|
||||
<text class="empty-hint">活动结束后,与其他参与者互相表达意愿后可在此查看</text>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{!loading && matches.length > 0}}" class="match-list">
|
||||
<view class="match-card" wx:for="{{matches}}" wx:key="targetUserId"
|
||||
bindtap="goToProfile" data-user-id="{{item.targetUserId}}">
|
||||
<image class="match-avatar" src="{{item.fileKey || '/assets/default-avatar.png'}}" mode="aspectFill"/>
|
||||
<view class="match-info">
|
||||
<text class="match-name">{{item.name}}</text>
|
||||
<text class="match-meta">{{item.age}}岁 · {{item.locationName || ''}}</text>
|
||||
</view>
|
||||
<view class="match-actions" catchtap>
|
||||
<button class="btn-chat" bindtap="startChat" data-user-id="{{item.targetUserId}}">聊天</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button class="btn-refresh" bindtap="onRefresh" wx:if="{{!loading}}">刷新</button>
|
||||
</view>
|
||||
@@ -0,0 +1,107 @@
|
||||
.page {
|
||||
padding: 32rpx;
|
||||
background: #FFF8F7;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #1A1A1A;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.activity-name {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.loading-state, .empty-state {
|
||||
text-align: center;
|
||||
padding: 100rpx 32rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
font-size: 80rpx;
|
||||
color: #E96B6B;
|
||||
display: block;
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.empty-hint {
|
||||
font-size: 24rpx;
|
||||
color: #BBB;
|
||||
display: block;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.match-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.match-card {
|
||||
background: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.04);
|
||||
}
|
||||
|
||||
.match-avatar {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 50rpx;
|
||||
background: #F0F0F0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.match-info {
|
||||
flex: 1;
|
||||
margin-left: 24rpx;
|
||||
}
|
||||
|
||||
.match-name {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #1A1A1A;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.match-meta {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
display: block;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.btn-chat {
|
||||
background: #E96B6B;
|
||||
color: #fff;
|
||||
font-size: 24rpx;
|
||||
padding: 12rpx 28rpx;
|
||||
border-radius: 24rpx;
|
||||
border: none;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.btn-refresh {
|
||||
margin-top: 32rpx;
|
||||
background: transparent;
|
||||
color: #999;
|
||||
border: 1rpx solid #DDD;
|
||||
border-radius: 44rpx;
|
||||
height: 72rpx;
|
||||
line-height: 72rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user