release: freeze 2026-10-15 validated release baseline
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Canceled after 0s
CI/CD Pipeline / E2E (live stack) (push) Canceled after 0s
CI/CD Pipeline / Backend Build & Test (push) Canceled after 0s
CI/CD Pipeline / Admin Web Build (push) Canceled after 0s
CI/CD Pipeline / Mini Program Compile Check (push) Canceled after 0s
CI/CD Pipeline / Migration Validation (push) Canceled after 0s
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Canceled after 0s
CI/CD Pipeline / UI Contracts (source-structure gates) (push) Canceled after 0s
CI/CD Pipeline / E2E (live stack) (push) Canceled after 0s
CI/CD Pipeline / Backend Build & Test (push) Canceled after 0s
CI/CD Pipeline / Admin Web Build (push) Canceled after 0s
CI/CD Pipeline / Mini Program Compile Check (push) Canceled after 0s
CI/CD Pipeline / Migration Validation (push) Canceled after 0s
CI/CD Pipeline / Test Shell Guard (Phase 23 Gate) (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
const { matchmakerStore, matchStore, appStore } = require('../../stores');
|
||||
const { matchmakerService } = require('../../services');
|
||||
const { ROUTE, to } = require('../../constants');
|
||||
|
||||
Page({
|
||||
data: { loading: true, actionLoadingId: '', recommendations: [] },
|
||||
|
||||
onShow() { this.load(); },
|
||||
|
||||
async load() {
|
||||
this.setData({ loading: true });
|
||||
try {
|
||||
const result = await matchmakerStore.fetchRecommendations();
|
||||
const items = (result && Array.isArray(result) ? result : matchmakerStore.state.recommendations || [])
|
||||
.map((item) => ({
|
||||
...item,
|
||||
userId: item.userId || item.targetUserId,
|
||||
displayName: item.displayName || '红娘推荐对象',
|
||||
recommendationReasons: item.reason ? [item.reason] : [],
|
||||
}));
|
||||
this.setData({ recommendations: items, loading: false });
|
||||
items.filter((item) => item.status === 'pending_view' && item.id).forEach((item) => {
|
||||
matchmakerService.markRecommendationViewed(item.id).catch(() => {});
|
||||
});
|
||||
} catch (error) {
|
||||
this.setData({ loading: false });
|
||||
appStore.toastError(error, '加载红娘推荐失败');
|
||||
}
|
||||
},
|
||||
|
||||
onView(e) {
|
||||
const userId = e.detail && e.detail.userId;
|
||||
if (userId) wx.navigateTo({ url: to.detail(userId) });
|
||||
},
|
||||
|
||||
async onLike(e) {
|
||||
await this.respond(e.detail && e.detail.userId, 'like');
|
||||
},
|
||||
|
||||
async onPass(e) {
|
||||
await this.respond(e.detail && e.detail.userId, 'pass');
|
||||
},
|
||||
|
||||
async respond(userId, action) {
|
||||
if (!userId || this.data.actionLoadingId) return;
|
||||
this.setData({ actionLoadingId: userId });
|
||||
try {
|
||||
const result = action === 'like' ? await matchStore.like(userId) : await matchStore.pass(userId);
|
||||
this.setData({ recommendations: this.data.recommendations.filter((item) => item.userId !== userId) });
|
||||
if (action === 'like' && result && result.mutualMatch && result.matchedConversationId) {
|
||||
wx.navigateTo({ url: to.chat(result.matchedConversationId) });
|
||||
} else {
|
||||
appStore.toastSuccess(action === 'like' ? '已表达喜欢' : '已暂不考虑');
|
||||
}
|
||||
} catch (error) {
|
||||
appStore.toastError(error);
|
||||
} finally {
|
||||
this.setData({ actionLoadingId: '' });
|
||||
}
|
||||
},
|
||||
|
||||
onBack() { wx.navigateBack(); },
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{"navigationBarTitleText":"红娘推荐","usingComponents":{"ui-nav-bar":"/components/nav-bar/index","ui-recommend-card":"/components/recommend-card/index","ui-loading":"/components/loading/index","ui-empty":"/components/empty/index"}}
|
||||
@@ -0,0 +1,9 @@
|
||||
<view class="page">
|
||||
<ui-nav-bar title="红娘推荐" show-back="{{true}}" bind:back="onBack" />
|
||||
<view class="intro">这是红娘根据你的需求提供的候选建议,是否表达喜欢由你本人决定。</view>
|
||||
<ui-loading wx:if="{{loading}}" mode="skeleton" rows="3" />
|
||||
<view wx:elif="{{recommendations.length}}" class="list">
|
||||
<ui-recommend-card wx:for="{{recommendations}}" wx:key="id" recommendation="{{item}}" action-loading="{{actionLoadingId === item.userId}}" bind:view="onView" bind:like="onLike" bind:pass="onPass" />
|
||||
</view>
|
||||
<ui-empty wx:else illustration="heart" title="暂时没有红娘推荐" description="红娘有新的建议后会显示在这里" />
|
||||
</view>
|
||||
@@ -0,0 +1,3 @@
|
||||
.page { min-height: 100vh; padding: 0 24rpx 40rpx; background: var(--color-primary-lighter); box-sizing: border-box; }
|
||||
.intro { margin: 24rpx 0; padding: 24rpx; border-radius: 20rpx; background: var(--color-bg-card); color: var(--color-text-secondary); font-size: 26rpx; line-height: 1.6; }
|
||||
.list { border-radius: 24rpx; overflow: hidden; background: var(--color-bg-card); }
|
||||
Reference in New Issue
Block a user