后端: - V056 matchmaker_contact_authorizations 表:channel CHECK(phone/offline_meeting/full_contact)、六态状态机(pending_approval→pending_consent→active→expired/revoked, →rejected)、部分唯一索引 uq_mm_contact_auth_active 防同红娘-同用户-同渠道多 ACTIVE、双态惰性收敛(active 过期 + pending_consent 超同意窗口) - ContactAuthorizationConfig 五 canonical key(matchmaker.contact.*):enabled 代码缺省 false fail-safe(yml 显式 true)/approver-authorities 双岗并列/consent-deadline-hours 72/default-validity-days 7/retention-days 365,全部 DEFAULT+CONFIG 待产品+法务终审 - ContactAuthorizationPolicy.assertContactAllowed(404 化 deny 先审计后 404) + canContact 徽标查询 - ContactAuthorizationService:request(须有效分配+purpose 必填)/approve(权限码动态判定∈配置+组长组织范围)/consent(用户本人,仅 pending_consent)/decline/revoke(reason 必填)/disclose(唯一披露出口:enabled fail-safe→assertActiveAssignment→assertContactAllowed→仅返回 phone/disclosedAt/authorizationId 三键,每次落 SensitiveAccessLog user_phone_disclosure,phone 不落应用日志) - 双控制器:运营端 /operator/matchmaker/contact-authorizations + C 端 /contact-authorizations(UserPrincipal 归属校验,独立端点无预同意参数),不碰 SecurityConfig 守卫翻转(机械锁强制复审机制按设计生效): - MatchmakerContactGuardTest 由「锁不存在」翻转为「锁新契约」五条:回显白名单类收敛/端点前缀收敛(受治理三包)/到期语义/consent 独立性三端扫描(后端+miniapp+admin-web,修复原只扫后端的预同意参数逃逸缺口)/ReferralService 白名单与无 @Scheduled 保留 - run-backend-contracts CURATED 18→20 前端: - miniapp 新页 pages/contact-consent(目的/渠道/窗口明示+独立同意拒绝按钮无预勾选,app.json 第 64 页) + 红娘工作台申请/列表/撤销 - admin-web「联系授权审批」tab(审批岗队列+本人授权撤销,枚举码中文映射) 验证:mvn verify 895/895(3 skip)、UI 契约 24/24(64 页)、后端契约门禁 228/CURATED 20、小程序真编译 87 WXML 0 失败;负向注入 5(工程师)+2(QA 不同落点)判红→还原复绿;QA 抓 disclose 键数收敛断言缺口已补并回归;QA fresh eyes PASS 0 P0/P1
137 lines
5.6 KiB
Plaintext
137 lines
5.6 KiB
Plaintext
<!-- 红娘工作台(ZC-MM-002:普通红娘仅见本人有效分配,无接单) -->
|
|
<view class="page">
|
|
<!-- 欢迎区 -->
|
|
<view class="header">
|
|
<view class="header-top">
|
|
<view class="avatar">👩</view>
|
|
<view class="greeting-wrap">
|
|
<view class="greeting">您好,{{operatorName}}</view>
|
|
<view class="date">{{currentDate}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="header-badge">公益红娘</view>
|
|
|
|
<!-- 数据概览 -->
|
|
<view class="stats-container">
|
|
<view class="stat-card" hover-class="stat-hover">
|
|
<view class="stat-icon pending">📋</view>
|
|
<view class="stat-value">{{pendingCount}}</view>
|
|
<view class="stat-label">待分配</view>
|
|
</view>
|
|
<view class="stat-card" hover-class="stat-hover">
|
|
<view class="stat-icon progress">⏳</view>
|
|
<view class="stat-value">{{inProgressCount}}</view>
|
|
<view class="stat-label">进行中</view>
|
|
</view>
|
|
<view class="stat-card" hover-class="stat-hover">
|
|
<view class="stat-icon completed">✅</view>
|
|
<view class="stat-value">{{completedCount}}</view>
|
|
<view class="stat-label">已完成</view>
|
|
</view>
|
|
<view class="stat-card" hover-class="stat-hover">
|
|
<view class="stat-icon today">📅</view>
|
|
<view class="stat-value">{{todayCount}}</view>
|
|
<view class="stat-label">今日</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 我的服务对象分配 -->
|
|
<view class="section" wx:if="{{!loading}}">
|
|
<view class="section-header">
|
|
<view class="section-title-wrap">
|
|
<text class="section-dot"></text>
|
|
<text class="section-title">我的服务对象分配</text>
|
|
</view>
|
|
<text class="section-count" wx:if="{{assignmentCount > 0}}">共{{assignmentCount}}人</text>
|
|
</view>
|
|
|
|
<view class="service-list" wx:if="{{myAssignments.length > 0}}">
|
|
<view
|
|
wx:for="{{myAssignments}}"
|
|
wx:key="id"
|
|
class="service-card"
|
|
data-id="{{item.serviceId}}"
|
|
bindtap="onViewService"
|
|
>
|
|
<view class="service-left">
|
|
<view class="service-header">
|
|
<view class="service-tag">{{assignmentScopeLabel(item.assignmentScope)}}</view>
|
|
<view class="service-tag">{{assignmentStatusLabel(item.status)}}</view>
|
|
<view class="service-time">{{formatTime(item.assignedAt)}}</view>
|
|
</view>
|
|
<view class="service-desc">{{item.assignmentReason}}</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="empty-state" wx:else>
|
|
<view class="empty-illustration">📭</view>
|
|
<view class="empty-text">暂无服务对象分配</view>
|
|
<view class="empty-hint">分配给你的服务对象将在这里展示</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 联系授权(ZC-MM-003 / B1:受控联系,用户单独同意后才可生效) -->
|
|
<view class="section" wx:if="{{!loading}}">
|
|
<view class="section-header">
|
|
<view class="section-title-wrap">
|
|
<text class="section-dot"></text>
|
|
<text class="section-title">联系授权(受控联系)</text>
|
|
</view>
|
|
<text class="section-count" wx:if="{{contactAuthCount > 0}}">共{{contactAuthCount}}条</text>
|
|
</view>
|
|
|
|
<!-- 申请入口:对本人分配对象发起,purpose 必填 -->
|
|
<view class="contact-form" wx:if="{{contactTargets.length > 0}}">
|
|
<picker mode="selector" range="{{contactTargets}}" range-key="label" value="{{contactTargetIndex}}" bindchange="onContactTargetChange">
|
|
<view class="form-row">
|
|
<text class="form-label">服务对象</text>
|
|
<text class="form-value">{{contactTargets[contactTargetIndex].label}}</text>
|
|
</view>
|
|
</picker>
|
|
<picker mode="selector" range="{{contactChannelLabels}}" value="{{contactChannelIndex}}" bindchange="onContactChannelChange">
|
|
<view class="form-row">
|
|
<text class="form-label">联系渠道</text>
|
|
<text class="form-value">{{contactChannelLabels[contactChannelIndex]}}</text>
|
|
</view>
|
|
</picker>
|
|
<view class="form-row">
|
|
<text class="form-label">授权目的</text>
|
|
<input class="form-input" value="{{contactPurpose}}" bindinput="onContactPurposeInput"
|
|
placeholder="必填:说明为何需要联系该用户" maxlength="200" />
|
|
</view>
|
|
<view class="form-hint">提交后须经平台审批,并由用户单独确认同意后授权方可生效</view>
|
|
<button class="submit-btn" size="mini" bindtap="submitContactRequest" disabled="{{submittingAuth}}">提交申请</button>
|
|
</view>
|
|
<view class="empty-state" wx:else>
|
|
<view class="empty-hint">暂无服务对象分配,无法发起联系授权</view>
|
|
</view>
|
|
|
|
<!-- 本人授权列表 -->
|
|
<view class="auth-list" wx:if="{{contactAuths.length > 0}}">
|
|
<view class="auth-card" wx:for="{{contactAuths}}" wx:key="id">
|
|
<view class="auth-row">
|
|
<text class="auth-channel">{{item.channelLabel}}</text>
|
|
<text class="auth-status">{{item.statusLabel}}</text>
|
|
</view>
|
|
<view class="auth-purpose">{{item.purpose}}</view>
|
|
<view class="auth-meta" wx:if="{{item.expireText}}">有效期至 {{item.expireText}}</view>
|
|
<button class="revoke-btn" size="mini" wx:if="{{item.revocable}}"
|
|
data-id="{{item.id}}" bindtap="revokeContactAuth">撤销</button>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 加载中 -->
|
|
<view class="loading-wrap" wx:if="{{loading}}">
|
|
<view class="loading-spinner"></view>
|
|
<text class="loading-text">加载中...</text>
|
|
</view>
|
|
|
|
<!-- 退出登录 -->
|
|
<view class="footer">
|
|
<button class="logout-btn" bindtap="onLogout">退出登录</button>
|
|
</view>
|
|
</view>
|