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:
@@ -33,6 +33,17 @@ Page({
|
||||
contactAuths: [],
|
||||
contactAuthCount: 0,
|
||||
submittingAuth: false,
|
||||
referralTasks: [],
|
||||
recommendations: [],
|
||||
referralDialogVisible: false,
|
||||
referralTargetIndex: 0,
|
||||
referralTargetLabels: [],
|
||||
referralTypeIndex: 0,
|
||||
referralTypes: ['服务站', '公益活动'],
|
||||
referralTypeCodes: ['service_station', 'activity'],
|
||||
referralTargetId: '',
|
||||
referralNote: '',
|
||||
submittingReferral: false,
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
@@ -64,26 +75,28 @@ Page({
|
||||
}
|
||||
|
||||
// 加载工作台数据 + 本人服务对象分配(ZC-MM-002:不再调用 /pending,普通红娘无该权限)
|
||||
const [dashRes, assignmentRes] = await Promise.all([
|
||||
const [dashRes, assignmentRes, referralRes, recommendationRes] = await Promise.all([
|
||||
api.get('/operator/matchmaker/dashboard', {}, { Authorization: `Bearer ${token}` }),
|
||||
api.get('/operator/matchmaker/assignments/my', {}, { Authorization: `Bearer ${token}` }),
|
||||
api.get('/referrals/operator/history', {}, { Authorization: `Bearer ${token}` }),
|
||||
api.get('/operator/matchmaker/recommendations', {}, { Authorization: `Bearer ${token}` }),
|
||||
]);
|
||||
|
||||
if (dashRes.success) {
|
||||
if (dashRes) {
|
||||
this.setData({
|
||||
pendingCount: dashRes.data.pendingCount || 0,
|
||||
inProgressCount: dashRes.data.inProgressCount || 0,
|
||||
todayCount: dashRes.data.todayCount || 0,
|
||||
completedCount: dashRes.data.completedCount || 0,
|
||||
pendingCount: dashRes.pendingCount || 0,
|
||||
inProgressCount: dashRes.inProgressCount || 0,
|
||||
todayCount: dashRes.todayCount || 0,
|
||||
completedCount: dashRes.completedCount || 0,
|
||||
});
|
||||
}
|
||||
|
||||
if (assignmentRes.success) {
|
||||
const assignments = assignmentRes.data || [];
|
||||
if (assignmentRes) {
|
||||
const assignments = assignmentRes || [];
|
||||
// 联系授权申请目标 = 本人生效中的分配对象(B1:只能对分配对象发起)
|
||||
const targets = assignments.map((a) => ({
|
||||
userId: a.userId,
|
||||
label: '用户 ' + String(a.userId).slice(0, 8) + '…(' + (a.assignmentReason || '服务对象') + ')',
|
||||
label: (a.userDisplayNumber || '待实名编号') + '(' + (a.userDisplayName || '服务对象') + ')',
|
||||
}));
|
||||
this.setData({
|
||||
myAssignments: assignments,
|
||||
@@ -93,6 +106,25 @@ Page({
|
||||
});
|
||||
this.loadContactAuthorizations();
|
||||
}
|
||||
if (referralRes) {
|
||||
this.setData({
|
||||
referralTasks: (referralRes || []).map((item) => ({
|
||||
...item,
|
||||
typeLabel: item.type === 'activity' ? '公益活动' : '服务站',
|
||||
targetLabel: item.type === 'activity'
|
||||
? '公益活动转介'
|
||||
: this.serviceTypeLabel(item.serviceType),
|
||||
statusLabel: item.userConfirmedAt ? '用户已确认' : '待用户确认',
|
||||
timeText: this.formatTime(item.createdAt || item.registeredAt),
|
||||
})),
|
||||
});
|
||||
}
|
||||
if (recommendationRes) {
|
||||
this.setData({ recommendations: (recommendationRes || []).map((item) => ({
|
||||
...item,
|
||||
statusLabel: this.recommendationStatusLabel(item.status),
|
||||
})) });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('加载工作台数据失败:', err);
|
||||
} finally {
|
||||
@@ -103,12 +135,66 @@ Page({
|
||||
onViewService(e) {
|
||||
const serviceId = e.currentTarget.dataset.id;
|
||||
if (!serviceId) {
|
||||
// 纯用户级分配(无关联服务单)无处可跳,不拼空参数
|
||||
const index = Number(e.currentTarget.dataset.index);
|
||||
const item = this.data.myAssignments[index] || {};
|
||||
wx.showModal({
|
||||
title: item.userDisplayNumber || '服务对象',
|
||||
content: `${item.userDisplayName || '未设置姓名'}${item.userAge ? `,${item.userAge}岁` : ''}${item.userRegionName ? `,${item.userRegionName}` : ''}\n当前分配未关联服务单,请联系组长补建服务记录。`,
|
||||
showCancel: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({ url: `/pages/matchmaker-service-detail/matchmaker-service-detail?id=${serviceId}` });
|
||||
},
|
||||
|
||||
openReferral() {
|
||||
if (!this.data.myAssignments.length) {
|
||||
wx.showToast({ title: '暂无可转介的服务对象', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
referralDialogVisible: true,
|
||||
referralTargetIndex: 0,
|
||||
referralTargetLabels: this.data.myAssignments.map((item) =>
|
||||
`${item.userDisplayNumber || '待实名编号'}(${item.userDisplayName || '服务对象'})`),
|
||||
referralTypeIndex: 0,
|
||||
referralTargetId: '',
|
||||
referralNote: '',
|
||||
});
|
||||
},
|
||||
|
||||
closeReferral() { this.setData({ referralDialogVisible: false }); },
|
||||
noop() {},
|
||||
onReferralTargetChange(e) { this.setData({ referralTargetIndex: Number(e.detail.value) }); },
|
||||
onReferralTypeChange(e) { this.setData({ referralTypeIndex: Number(e.detail.value) }); },
|
||||
onReferralTargetIdInput(e) { this.setData({ referralTargetId: e.detail.value }); },
|
||||
onReferralNoteInput(e) { this.setData({ referralNote: e.detail.value }); },
|
||||
|
||||
async submitReferral() {
|
||||
if (this.data.submittingReferral) return;
|
||||
const assignment = this.data.myAssignments[this.data.referralTargetIndex];
|
||||
const targetId = (this.data.referralTargetId || '').trim();
|
||||
if (!assignment || !assignment.userId) { wx.showToast({ title: '请选择服务对象', icon: 'none' }); return; }
|
||||
if (!targetId) { wx.showToast({ title: '请填写活动或服务站编号', icon: 'none' }); return; }
|
||||
this.setData({ submittingReferral: true });
|
||||
try {
|
||||
const token = wx.getStorageSync('operatorToken');
|
||||
const type = this.data.referralTypeCodes[this.data.referralTypeIndex];
|
||||
const path = type === 'activity' ? '/referrals/activity' : '/referrals/service-station';
|
||||
const payload = type === 'activity'
|
||||
? { userId: assignment.userId, activityId: targetId }
|
||||
: { userId: assignment.userId, locationId: targetId, serviceType: 'counselor_consultation', note: this.data.referralNote.trim() };
|
||||
await api.post(path, payload, { Authorization: `Bearer ${token}` }, api.idempotencyKey(`matchmaker-referral:${assignment.userId}:${targetId}`));
|
||||
wx.showToast({ title: '转介已提交,等待用户确认', icon: 'none' });
|
||||
this.setData({ referralDialogVisible: false });
|
||||
await this.loadDashboard();
|
||||
} catch (error) {
|
||||
wx.showToast({ title: (error && error.message) || '转介提交失败', icon: 'none' });
|
||||
} finally {
|
||||
this.setData({ submittingReferral: false });
|
||||
}
|
||||
},
|
||||
|
||||
// ==================== ZC-MM-003 / B1:受控联系授权 ====================
|
||||
|
||||
/** 本人授权列表(GET /operator/matchmaker/contact-authorizations/my) */
|
||||
@@ -117,8 +203,8 @@ Page({
|
||||
const token = wx.getStorageSync('operatorToken');
|
||||
const res = await api.get('/operator/matchmaker/contact-authorizations/my',
|
||||
{}, { Authorization: `Bearer ${token}` });
|
||||
if (res.success) {
|
||||
const items = (res.data.list || []).map((item) => Object.assign({}, item, {
|
||||
if (res) {
|
||||
const items = ((res.list || [])).map((item) => Object.assign({}, item, {
|
||||
channelLabel: this.contactChannelLabel(item.channel),
|
||||
statusLabel: this.contactStatusLabel(item.status),
|
||||
expireText: item.expiresAt ? this.formatTime(item.expiresAt) : '',
|
||||
@@ -145,6 +231,20 @@ Page({
|
||||
return labels[code] || code || '';
|
||||
},
|
||||
|
||||
serviceTypeLabel(code) {
|
||||
const labels = {
|
||||
counselor_consultation: '婚恋咨询',
|
||||
premarital_counseling: '婚前辅导',
|
||||
legal_consultation: '法律咨询',
|
||||
};
|
||||
return labels[code] || '服务站服务';
|
||||
},
|
||||
|
||||
recommendationStatusLabel(code) {
|
||||
const labels = { pending_view: '待用户查看', viewed: '用户已查看', liked: '用户已喜欢', passed: '用户已跳过', confirmed_mutual: '已双向确认', expired: '已过期' };
|
||||
return labels[code] || code || '未知状态';
|
||||
},
|
||||
|
||||
onContactTargetChange(e) { this.setData({ contactTargetIndex: Number(e.detail.value) }); },
|
||||
onContactChannelChange(e) { this.setData({ contactChannelIndex: Number(e.detail.value) }); },
|
||||
onContactPurposeInput(e) { this.setData({ contactPurpose: e.detail.value }); },
|
||||
@@ -163,7 +263,7 @@ Page({
|
||||
const res = await api.post('/operator/matchmaker/contact-authorizations', {
|
||||
userId: target.userId, channel: channel, purpose: purpose,
|
||||
}, { Authorization: `Bearer ${token}` });
|
||||
if (res.success) {
|
||||
if (res) {
|
||||
wx.showToast({ title: '申请已提交,等待审批', icon: 'none' });
|
||||
this.setData({ contactPurpose: '' });
|
||||
this.loadContactAuthorizations();
|
||||
@@ -190,7 +290,7 @@ Page({
|
||||
const token = wx.getStorageSync('operatorToken');
|
||||
const resp = await api.post(`/operator/matchmaker/contact-authorizations/${id}/revoke`,
|
||||
{ reason: reason }, { Authorization: `Bearer ${token}` });
|
||||
if (resp.success) {
|
||||
if (resp) {
|
||||
wx.showToast({ title: '已撤销', icon: 'none' });
|
||||
this.loadContactAuthorizations();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user