style(commission): 顶部卡片精简为直推人数与团队总人数并清除所有一级二级字样
这个提交包含在:
@@ -161,11 +161,14 @@ class Agent extends Commission
|
||||
}
|
||||
|
||||
$targetUserId = $drillUserId;
|
||||
$targetAgent = AgentModel::where('user_id', $targetUserId)->find();
|
||||
$drillUser = [
|
||||
'id' => $targetUser->id,
|
||||
'nickname' => $targetUser->nickname ?: '微信用户',
|
||||
'avatar' => $targetUser->avatar,
|
||||
'parent_user_id' => $targetUser->parent_user_id,
|
||||
'child_user_count_1' => intval($targetAgent->child_user_count_1 ?? 0),
|
||||
'child_user_count_all' => intval($targetAgent->child_user_count_all ?? ($targetAgent->child_user_count_1 ?? 0)),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -328,8 +331,13 @@ class Agent extends Commission
|
||||
if (empty($teamUserIds)) {
|
||||
$selfAgent = AgentModel::where('user_id', $targetUserId)->find();
|
||||
$selfUser = UserModel::where('id', $targetUserId)->find();
|
||||
$teamCount = isset($selfAgent->child_user_count_all) && intval($selfAgent->child_user_count_all) > 0
|
||||
? intval($selfAgent->child_user_count_all)
|
||||
: intval($selfAgent->child_user_count_1 ?? 0);
|
||||
return [
|
||||
'total_count' => 0,
|
||||
'direct_count' => 0,
|
||||
'team_count' => $teamCount,
|
||||
'active_count' => 0,
|
||||
'expiring_count' => 0,
|
||||
'inactive_count' => 0,
|
||||
@@ -397,8 +405,15 @@ class Agent extends Commission
|
||||
->where('createtime', '>=', $monthStart)
|
||||
->sum('amount');
|
||||
|
||||
$directCount = count($teamUserIds);
|
||||
$teamCount = isset($selfAgent->child_user_count_all) && intval($selfAgent->child_user_count_all) > 0
|
||||
? intval($selfAgent->child_user_count_all)
|
||||
: $directCount;
|
||||
|
||||
return [
|
||||
'total_count' => count($teamUserIds),
|
||||
'total_count' => $directCount,
|
||||
'direct_count' => $directCount,
|
||||
'team_count' => $teamCount,
|
||||
'active_count' => $activeCount,
|
||||
'expiring_count' => $expiringCount,
|
||||
'inactive_count' => $inactiveCount,
|
||||
|
||||
@@ -109,7 +109,15 @@ assert(teamVueContent.includes('drill-breadcrumb'), 'team.vue 必须包含层级
|
||||
assert(teamVueContent.includes('btn-drill'), 'team.vue 成员卡片必须包含下钻团队按钮');
|
||||
assert(teamVueContent.includes('drawer-drill-card'), 'team.vue 详情抽屉必须包含下钻团队卡片');
|
||||
|
||||
console.log('✅ 测试点 3 通过: 前端 team.vue 状态管理、下钻面包屑导航与交互按钮规范');
|
||||
// 3.5 验证顶部卡片只展示直推人数与团队总人数,且无任何一级/二级
|
||||
assert(teamVueContent.includes('直推人数(人)'), 'team.vue 顶部必须展示直推人数(人)卡片');
|
||||
assert(teamVueContent.includes('团队总人数(人)'), 'team.vue 顶部必须展示团队总人数(人)卡片');
|
||||
assert(teamVueContent.includes('getDirectCount()'), 'team.vue 必须调用 getDirectCount 计算直推人数');
|
||||
assert(teamVueContent.includes('getTeamCount()'), 'team.vue 必须调用 getTeamCount 计算团队总人数');
|
||||
assert(!teamVueContent.includes('一级直推'), 'team.vue 顶部卡片严禁出现“一级直推”字样');
|
||||
assert(!teamVueContent.includes('一级成员'), 'team.vue 顶部卡片严禁出现“一级成员”字样');
|
||||
|
||||
console.log('✅ 测试点 3 通过: 前端 team.vue 状态管理、下钻面包屑导航与顶部纯直推/团队总人数卡片规范');
|
||||
|
||||
// 4. 模拟前端下钻堆栈业务状态机流转测试
|
||||
class MockTeamDrillController {
|
||||
|
||||
@@ -41,47 +41,25 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 团队核心数据总览卡片(一级直推与合伙人看板) -->
|
||||
<!-- 团队核心数据总览卡片(直推人数 与 团队总人数) -->
|
||||
<view class="team-data-box ss-flex ss-col-center ss-row-between">
|
||||
<!-- 直推成员总数卡片 -->
|
||||
<view
|
||||
class="data-card ss-flex-1 ss-m-r-16"
|
||||
:class="{ 'card-active': state.currentFilter === 'all' }"
|
||||
@tap="onSelectHeaderTab('all')"
|
||||
>
|
||||
<view class="total-item">
|
||||
<view class="item-title">
|
||||
{{ currentDrillUser ? (currentDrillUser.nickname + '的直推(人)') : '直推成员总数(人)' }}
|
||||
</view>
|
||||
<view class="total-num">
|
||||
{{ currentDrillUser ? (state.summary.total_count || currentDrillUser.child_user_count_1 || 0) : headerNum('child_user_count_1') }}
|
||||
</view>
|
||||
<!-- 直推人数卡片 -->
|
||||
<view class="data-card ss-flex-1 ss-m-r-16">
|
||||
<view class="item-title">
|
||||
{{ currentDrillUser ? (currentDrillUser.nickname + '的直推(人)') : '直推人数(人)' }}
|
||||
</view>
|
||||
<view class="category-item ss-flex ss-col-center ss-row-between">
|
||||
<text class="category-label">活跃保活:</text>
|
||||
<text class="category-val text-green">{{ state.summary.active_count || 0 }} 人</text>
|
||||
<view class="total-num text-orange">
|
||||
{{ getDirectCount() }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 直推分销合伙人卡片 -->
|
||||
<view
|
||||
class="data-card ss-flex-1"
|
||||
:class="{ 'card-active': state.currentFilter === 'partner' }"
|
||||
@tap="onSelectHeaderTab('partner')"
|
||||
>
|
||||
<view class="total-item">
|
||||
<view class="item-title">
|
||||
{{ currentDrillUser ? (currentDrillUser.nickname + '的合伙人') : '直推合伙股东(人)' }}
|
||||
</view>
|
||||
<view class="total-num text-gold">
|
||||
{{ currentDrillUser ? (state.summary.partner_count || 0) : headerNum('child_agent_count_1') }}
|
||||
</view>
|
||||
<!-- 团队总人数卡片 -->
|
||||
<view class="data-card ss-flex-1">
|
||||
<view class="item-title">
|
||||
{{ currentDrillUser ? (currentDrillUser.nickname + '的团队(人)') : '团队总人数(人)' }}
|
||||
</view>
|
||||
<view class="category-item ss-flex ss-col-center ss-row-between">
|
||||
<text class="category-label">临期/暂停:</text>
|
||||
<text class="category-val text-yellow">
|
||||
{{ Number(state.summary.expiring_count || 0) + Number(state.summary.inactive_count || 0) }} 人
|
||||
</text>
|
||||
<view class="total-num">
|
||||
{{ getTeamCount() }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -241,9 +219,7 @@
|
||||
<view class="member-profile ss-m-l-16">
|
||||
<view class="member-name-row ss-flex ss-col-center">
|
||||
<text class="member-name ss-line-1">{{ item.nickname || '微信用户' }}</text>
|
||||
<text class="level-badge badge-direct">
|
||||
{{ state.drillStack.length > 0 ? '直推成员' : '一级直推' }}
|
||||
</text>
|
||||
<text class="level-badge badge-direct">直推成员</text>
|
||||
</view>
|
||||
<view class="member-sub-info ss-flex ss-col-center ss-m-t-4" v-if="item.mobile_hide || item.id">
|
||||
<text class="member-phone" v-if="item.mobile_hide">{{ item.mobile_hide }}</text>
|
||||
@@ -662,19 +638,41 @@
|
||||
return state.drillStack[state.drillStack.length - 1];
|
||||
});
|
||||
|
||||
function headerNum(field) {
|
||||
const stored = Number(agentInfo.value?.[field] || 0);
|
||||
if (stored > 0) {
|
||||
return stored;
|
||||
// 获取直推人数(支持当前团队与多级下钻)
|
||||
function getDirectCount() {
|
||||
if (currentDrillUser.value) {
|
||||
return (
|
||||
state.summary.direct_count ??
|
||||
state.summary.total_count ??
|
||||
currentDrillUser.value.child_user_count_1 ??
|
||||
0
|
||||
);
|
||||
}
|
||||
const listTotal = Number(state.pagination.total || 0);
|
||||
if (
|
||||
listTotal > 0 &&
|
||||
['child_user_count_1', 'child_user_count_all', 'child_agent_count_1', 'child_agent_count_all'].includes(field)
|
||||
) {
|
||||
return listTotal;
|
||||
const count = Number(agentInfo.value?.child_user_count_1 || 0);
|
||||
if (count > 0) return count;
|
||||
if (state.summary.direct_count !== undefined && state.summary.direct_count > 0) {
|
||||
return state.summary.direct_count;
|
||||
}
|
||||
return 0;
|
||||
return Number(state.pagination.total || 0);
|
||||
}
|
||||
|
||||
// 获取团队总人数(支持当前团队与多级下钻)
|
||||
function getTeamCount() {
|
||||
if (currentDrillUser.value) {
|
||||
return (
|
||||
state.summary.team_count ??
|
||||
currentDrillUser.value.child_user_count_all ??
|
||||
state.summary.direct_count ??
|
||||
state.summary.total_count ??
|
||||
0
|
||||
);
|
||||
}
|
||||
const count = Number(agentInfo.value?.child_user_count_all || 0);
|
||||
if (count > 0) return count;
|
||||
if (state.summary.team_count !== undefined && state.summary.team_count > 0) {
|
||||
return state.summary.team_count;
|
||||
}
|
||||
return getDirectCount();
|
||||
}
|
||||
|
||||
function memberLevelName(item) {
|
||||
@@ -1015,62 +1013,29 @@
|
||||
// 团队信息总览
|
||||
.team-data-box {
|
||||
.data-card {
|
||||
width: 340rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx 22rpx;
|
||||
padding: 22rpx 24rpx;
|
||||
box-sizing: border-box;
|
||||
border: 2rpx solid transparent;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.card-active {
|
||||
border-color: #ff6000;
|
||||
box-shadow: 0 4rpx 16rpx rgba(255, 96, 0, 0.15);
|
||||
}
|
||||
box-shadow: 0 4rpx 14rpx rgba(0, 0, 0, 0.03);
|
||||
|
||||
.item-title {
|
||||
font-size: 22rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #999999;
|
||||
line-height: 30rpx;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.total-item {
|
||||
margin-bottom: 22rpx;
|
||||
line-height: 32rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.total-num {
|
||||
font-size: 40rpx;
|
||||
font-size: 44rpx;
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
font-family: OPPOSANS;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
line-height: 48rpx;
|
||||
|
||||
.text-gold {
|
||||
color: #c48a3a !important;
|
||||
}
|
||||
|
||||
.category-item {
|
||||
border-top: 1rpx solid #f2f2f2;
|
||||
padding-top: 14rpx;
|
||||
|
||||
.category-label {
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.category-val {
|
||||
font-size: 24rpx;
|
||||
font-weight: bold;
|
||||
font-family: OPPOSANS;
|
||||
|
||||
&.text-green {
|
||||
color: #10b981;
|
||||
}
|
||||
&.text-yellow {
|
||||
color: #f59e0b;
|
||||
}
|
||||
&.text-orange {
|
||||
color: #ff6000;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户