feat(commission): 支持计奖商品参与设置、独立分成与多规格规则,完善团队中心与微信快捷登录

这个提交包含在:
chen
2026-09-17 19:27:17 +08:00
父节点 3c7df9688b
当前提交 829e88cfa9
共有 54 个文件被更改,包括 3536 次插入 和 666 次删除

查看文件

@@ -12,6 +12,28 @@
</view>
<!-- 账户信息 -->
<account-info />
<!-- 团队作战快捷看板 -->
<view class="team-quick-card ss-flex ss-row-between ss-col-center" @tap="sheep.$router.go('/pages/commission/team')">
<view class="team-quick-left ss-flex ss-col-center">
<view class="icon-wrap ss-flex ss-row-center ss-col-center">
<uni-icons type="staff" size="24" color="#ff6000"></uni-icons>
</view>
<view class="team-quick-info ss-m-l-16">
<view class="team-title ss-flex ss-col-center">
<text class="title-bold">团队作战中心</text>
<text class="active-badge ss-m-l-10" v-if="userInfo?.active_30d !== false && agentInfo?.active_30d !== false">正常活跃</text>
<text class="warn-badge ss-m-l-10" v-else>奖励暂停</text>
</view>
<view class="team-sub ss-m-t-6">
直推 {{ agentInfo?.child_user_count_1 || 0 }} 人 · 团队共 {{ agentInfo?.child_user_count_all || 0 }} 人
</view>
</view>
</view>
<view class="team-quick-right ss-flex ss-col-center">
<text class="manage-text">去管理</text>
<uni-icons type="right" size="14" color="#ff6000"></uni-icons>
</view>
</view>
<!-- 菜单栏 -->
<commission-menu />
<!-- 分销记录 -->
@@ -103,4 +125,62 @@
color: #ffffff;
}
}
.team-quick-card {
width: 694rpx;
margin: 20rpx auto 0;
padding: 22rpx 28rpx;
box-sizing: border-box;
background: linear-gradient(135deg, #ffffff 0%, #fffbf0 100%);
border-radius: 16rpx;
border: 1rpx solid #ffe8c2;
box-shadow: 0 4rpx 16rpx rgba(247, 213, 152, 0.25);
position: relative;
z-index: 3;
.icon-wrap {
width: 72rpx;
height: 72rpx;
border-radius: 36rpx;
background: #fff0e6;
}
.team-quick-info {
.title-bold {
font-size: 28rpx;
font-weight: bold;
color: #692e04;
}
.active-badge {
font-size: 20rpx;
padding: 2rpx 10rpx;
border-radius: 12rpx;
background: #ecfdf5;
color: #059669;
font-weight: 500;
}
.warn-badge {
font-size: 20rpx;
padding: 2rpx 10rpx;
border-radius: 12rpx;
background: #fef2f2;
color: #dc2626;
font-weight: 500;
}
.team-sub {
font-size: 22rpx;
color: #a17545;
font-family: OPPOSANS;
}
}
.team-quick-right {
.manage-text {
font-size: 24rpx;
font-weight: 500;
color: #ff6000;
margin-right: 4rpx;
}
}
}
</style>

查看文件

@@ -12,6 +12,19 @@
</view>
</view>
<!-- 穿透查看成员明细提示条 -->
<view v-if="state.buyerId > 0" class="buyer-filter-bar ss-flex ss-row-between ss-col-center">
<view class="ss-flex ss-col-center">
<uni-icons type="person-filled" size="16" color="#ff6000"></uni-icons>
<text class="filter-tip-text ss-m-l-10">
正在筛选成员:<text class="buyer-highlight">【{{ state.buyerName || ('ID:' + state.buyerId) }}】</text>的贡献
</text>
</view>
<button class="ss-reset-button clear-filter-btn" @tap="onClearBuyerFilter">
查看全部
</button>
</view>
<su-sticky>
<su-tabs
:list="tabMaps"
@@ -139,6 +152,8 @@
loadStatus: '',
showDetail: false,
current: null,
buyerId: 0,
buyerName: '',
overview: {
month_income: '0.00',
skip_count: 0,
@@ -179,11 +194,15 @@
async function getLogList(page = 1, list_rows = 10) {
state.loadStatus = 'loading';
try {
const res = await sheep.$api.partner.rewards({
tab: tabMaps[state.currentTab]?.value || 'all',
const params = {
tab: tabMaps.value[state.currentTab]?.value || 'all',
page,
list_rows,
});
};
if (state.buyerId > 0) {
params.buyer_id = state.buyerId;
}
const res = await sheep.$api.partner.rewards(params);
if (res?.code === 1) {
const pageData = pickList(res.data);
state.pagination = {
@@ -220,7 +239,20 @@
state.showDetail = true;
}
onLoad(() => {
function onClearBuyerFilter() {
state.buyerId = 0;
state.buyerName = '';
state.pagination = { ...emptyPagination };
getLogList(1);
}
onLoad((options) => {
if (options?.buyer_id) {
state.buyerId = Number(options.buyer_id) || 0;
}
if (options?.buyer_name) {
state.buyerName = decodeURIComponent(options.buyer_name);
}
getOverview();
getLogList();
});
@@ -239,6 +271,29 @@
</script>
<style lang="scss" scoped>
.buyer-filter-bar {
margin: 16rpx 24rpx;
padding: 16rpx 24rpx;
background: #fff4e5;
border-radius: 12rpx;
border: 1rpx solid #ffd8a8;
.filter-tip-text {
font-size: 24rpx;
color: #a17545;
}
.buyer-highlight {
font-weight: bold;
color: #ff6000;
}
.clear-filter-btn {
font-size: 22rpx;
padding: 6rpx 18rpx;
border-radius: 20rpx;
background: #ff6000;
color: #ffffff;
}
}
.header-box {
background-color: $white;
padding: 30rpx;

查看文件

@@ -22,6 +22,25 @@
<text class="referrer-name">{{ userInfo.parent_user.nickname }}</text>
</view>
<!-- 专属邀请码与拓展卡片 -->
<view class="invite-action-card ss-flex ss-row-between ss-col-center">
<view class="invite-code-wrap ss-flex ss-col-center">
<text class="invite-label">专属邀请码:</text>
<text class="invite-code">HL{{ userInfo.id || '---' }}</text>
<button class="ss-reset-button copy-code-btn ss-m-l-10" @tap="onCopyInviteCode">复制</button>
</view>
<view class="invite-btn-group ss-flex ss-col-center">
<button class="ss-reset-button invite-btn-poster ss-flex ss-col-center" @tap="onOpenShareModal">
<uni-icons type="image" size="14" color="#ffffff"></uni-icons>
<text class="ss-m-l-6">邀请海报</text>
</button>
<button class="ss-reset-button invite-btn-link ss-m-l-12 ss-flex ss-col-center" @tap="onCopyShareLink">
<uni-icons type="link" size="14" color="#ff6000"></uni-icons>
<text class="ss-m-l-6">复制链接</text>
</button>
</view>
</view>
<!-- 团队核心数据总览卡片 -->
<view class="team-data-box ss-flex ss-col-center ss-row-between">
<!-- 团队总人数卡片 -->
@@ -85,6 +104,20 @@
</view>
</view>
<!-- 团队收益与业绩统计大盘 -->
<view class="team-wealth-box ss-flex ss-col-center ss-row-between">
<view class="wealth-card ss-flex-1 ss-m-r-16">
<view class="wealth-title">团队贡献总收益(元)</view>
<view class="wealth-num text-orange">¥{{ state.summary.team_total_reward || '0.00' }}</view>
<view class="wealth-sub">本月贡献: ¥{{ state.summary.team_month_reward || '0.00' }}</view>
</view>
<view class="wealth-card ss-flex-1">
<view class="wealth-title">团队自购总业绩(元)</view>
<view class="wealth-num text-gold">¥{{ state.summary.team_total_consume || '0.00' }}</view>
<view class="wealth-sub">团队累计订单: {{ state.summary.team_order_count || 0 }} 笔</view>
</view>
</view>
<!-- 30天自购保活健康度胶囊条 -->
<view class="health-bar ss-flex ss-row-between ss-col-center">
<view class="health-title">保活健康度:</view>
@@ -206,6 +239,10 @@
{{ item.team_level === 1 ? '一级直推' : '二级间推' }}
</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>
<text class="member-id-tag ss-m-l-8">ID: {{ item.id }}</text>
</view>
<view class="member-meta-row ss-flex ss-col-center ss-m-t-8">
<!-- 身份徽章 -->
<view v-if="memberLevelName(item)" class="tag-box ss-flex ss-col-center">
@@ -310,13 +347,20 @@
<text class="ss-m-l-6">拨打</text>
</button>
<button
v-if="item.mobile_raw"
v-if="item.mobile_raw || item.mobile_hide"
class="ss-reset-button action-btn btn-copy ss-m-l-12"
@tap.stop="onCopyText(item.mobile_raw, '手机号已复制')"
@tap.stop="onCopyText(item.mobile_raw || item.mobile_hide, '手机号已复制')"
>
<uni-icons type="paperclip" size="14" color="#666666"></uni-icons>
<text class="ss-m-l-6">复制手机</text>
</button>
<button
class="ss-reset-button action-btn btn-reward ss-m-l-12"
@tap.stop="onJumpRewards(item.id, item.nickname)"
>
<uni-icons type="wallet" size="14" color="#ff6000"></uni-icons>
<text class="ss-m-l-6">收益</text>
</button>
<button
class="ss-reset-button action-btn btn-detail ss-m-l-12"
@tap.stop="onOpenMemberDetail(item)"
@@ -387,6 +431,8 @@
<view class="drawer-sub ss-flex ss-col-center ss-m-t-8">
<text class="user-id">ID: {{ state.currentMember.id }}</text>
<text class="dot-split">·</text>
<text class="user-phone">手机: {{ state.currentMember.mobile_hide || '未绑定' }}</text>
<text class="dot-split">·</text>
<text class="join-time">{{ formatTime(state.currentMember.createtime) }} 加入</text>
</view>
</view>
@@ -496,16 +542,16 @@
<text class="ss-m-l-8">呼叫成员</text>
</button>
<button
v-if="state.currentMember.mobile_raw"
v-if="state.currentMember.mobile_raw || state.currentMember.mobile_hide"
class="ss-reset-button drawer-btn drawer-btn-sub ss-flex-1 ss-m-r-16"
@tap="onCopyText(state.currentMember.mobile_raw, '手机号已复制')"
@tap="onCopyText(state.currentMember.mobile_raw || state.currentMember.mobile_hide, '手机号已复制')"
>
<uni-icons type="paperclip" size="16" color="#ff6000"></uni-icons>
<text class="ss-m-l-8">复制电话</text>
</button>
<button
class="ss-reset-button drawer-btn drawer-btn-outline ss-flex-1"
@tap="onJumpRewards(state.currentMember.id)"
@tap="onJumpRewards(state.currentMember.id, state.currentMember.nickname)"
>
<uni-icons type="list" size="16" color="#666666"></uni-icons>
<text class="ss-m-l-8">查收益流水</text>
@@ -577,6 +623,10 @@
expiring_count: 0,
inactive_count: 0,
partner_count: 0,
team_total_consume: '0.00',
team_total_reward: '0.00',
team_month_reward: '0.00',
team_order_count: 0,
},
pagination: {
data: [],
@@ -728,9 +778,32 @@
state.showDetail = true;
}
function onJumpRewards(buyerId) {
function onJumpRewards(buyerId, buyerName = '') {
state.showDetail = false;
sheep.$router.go(`/pages/commission/rewards?buyer_id=${buyerId}`);
const nameParam = buyerName ? `&buyer_name=${encodeURIComponent(buyerName)}` : '';
sheep.$router.go(`/pages/commission/rewards?buyer_id=${buyerId}${nameParam}`);
}
function onCopyInviteCode() {
if (!userInfo.value?.id) {
sheep.$helper.toast('请先登录');
return;
}
const code = `HL${userInfo.value.id}`;
sheep.$helper.copyText(code, '专属邀请码已复制');
}
function onCopyShareLink() {
if (!userInfo.value?.id) {
sheep.$helper.toast('请先登录');
return;
}
const shareQuery = sheep.$platform.share.buildSpmQuery({
page: '1',
query: '0',
});
const shareUrl = sheep.$platform.share.buildSpmPath(shareQuery);
sheep.$helper.copyText(shareUrl, '专属推广链接已复制');
}
function onOpenShareModal() {
@@ -825,6 +898,59 @@
}
}
// 专属邀请码卡片
.invite-action-card {
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px);
border-radius: 16rpx;
padding: 12rpx 20rpx;
margin-bottom: 20rpx;
.invite-code-wrap {
.invite-label {
font-size: 24rpx;
color: #ffffff;
font-weight: 500;
}
.invite-code {
font-size: 28rpx;
font-weight: bold;
color: #ffffff;
font-family: OPPOSANS;
letter-spacing: 1rpx;
}
.copy-code-btn {
font-size: 20rpx;
padding: 4rpx 14rpx;
border-radius: 16rpx;
background: #ffffff;
color: #ff6000;
font-weight: 500;
}
}
.invite-btn-group {
.invite-btn-poster {
height: 48rpx;
padding: 0 16rpx;
border-radius: 24rpx;
background: #ff6000;
color: #ffffff;
font-size: 22rpx;
font-weight: 500;
}
.invite-btn-link {
height: 48rpx;
padding: 0 16rpx;
border-radius: 24rpx;
background: #ffffff;
color: #ff6000;
font-size: 22rpx;
font-weight: 500;
}
}
}
// 团队信息总览
.team-data-box {
.data-card {
@@ -893,6 +1019,41 @@
color: #333333;
font-family: OPPOSANS;
}
// 团队收益与业绩看板
.team-wealth-box {
margin-top: 20rpx;
.wealth-card {
background: #ffffff;
border-radius: 20rpx;
padding: 18rpx 20rpx;
box-sizing: border-box;
.wealth-title {
font-size: 22rpx;
color: #999999;
line-height: 28rpx;
margin-bottom: 6rpx;
}
.wealth-num {
font-size: 32rpx;
font-weight: bold;
font-family: OPPOSANS;
line-height: 38rpx;
margin-bottom: 6rpx;
&.text-orange {
color: #ff6000;
}
&.text-gold {
color: #c48a3a;
}
}
.wealth-sub {
font-size: 20rpx;
color: #888888;
line-height: 24rpx;
}
}
}
@@ -1127,6 +1288,24 @@
}
}
.member-sub-info {
font-size: 20rpx;
color: #999999;
font-family: OPPOSANS;
.member-phone {
color: #666666;
font-size: 22rpx;
}
.member-id-tag {
background: #f3f4f6;
color: #9ca3af;
padding: 2rpx 8rpx;
border-radius: 6rpx;
font-size: 18rpx;
}
}
.member-meta-row {
gap: 8rpx;
}
@@ -1240,6 +1419,10 @@
background: #f3f4f6;
color: #4b5563;
}
&.btn-reward {
background: #fff7ed;
color: #ea580c;
}
&.btn-detail {
background: #ffffff;
color: #666666;