feat(closed-loop): complete end-to-end closed loops across miniapp, backend, and admin

这个提交包含在:
xcbyy
2026-10-14 10:13:50 +08:00
父节点 f8e81d2df4
当前提交 51c19d6063
共有 14 个文件被更改,包括 996 次插入 和 134 次删除

查看文件

@@ -85,6 +85,14 @@
<button class="btn-poster-action secondary btn-active" @click="copyInviteLink">复制邀请链接</button>
<button class="btn-poster-action primary btn-active" @click="savePosterImage">保存海报至相册</button>
</view>
<view class="bind-inviter-card" style="margin-top: 24rpx; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 20rpx; padding: 20rpx 24rpx; display: flex; align-items: center; justify-content: space-between;">
<text style="font-size: 24rpx; color: #94A3B8;">{{ user.inviterId ? ('已绑定上级邀请人:PW' + user.inviterId) : '填写好友邀请码绑定上下级关系' }}</text>
<view v-if="!user.inviterId" style="display: flex; align-items: center; gap: 12rpx;">
<input v-model="bindCodeInput" placeholder="如 PW2001" placeholder-class="field-placeholder" style="width: 180rpx; height: 56rpx; background: rgba(0,0,0,0.25); border-radius: 12rpx; padding: 0 16rpx; font-size: 24rpx; color: #F8FAFC;" />
<button class="btn-active" style="margin: 0; height: 56rpx; line-height: 56rpx; padding: 0 24rpx; font-size: 24rpx; border-radius: 12rpx; background: #6366F1; color: #FFFFFF;" @click="handleBindInviteCode">绑定</button>
</view>
</view>
</view>
<!-- Tab 2: 下级团队列表 -->
@@ -209,7 +217,8 @@ import {
getUserProfile,
getDistributionTeam,
getDistributionRecords,
withdrawCommission
withdrawCommission,
bindInviteCode
} from '@/common/api.js';
import { ICONS } from '@/common/icons.js';
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
@@ -218,6 +227,7 @@ import { getNavBarInfo } from '@/common/nav.js';
const currentThemeKey = ref(getCurrentThemeKey());
const navInfo = ref(getNavBarInfo());
const isRefreshing = ref(false);
const bindCodeInput = ref('');
const defaultAvatar = 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=200';
@@ -324,6 +334,24 @@ const savePosterImage = () => {
uni.showToast({ title: '海报已保存至相册', icon: 'success' });
};
const handleBindInviteCode = async () => {
const code = bindCodeInput.value.trim();
if (!code) {
uni.showToast({ title: '请输入好友邀请码', icon: 'none' });
return;
}
try {
const uid = user.value.id || 2006;
const res = await bindInviteCode(uid, code);
user.value.inviterId = res.inviterId;
bindCodeInput.value = '';
uni.showToast({ title: `成功绑定上级:${res.inviterName || code}`, icon: 'success' });
loadData();
} catch (err) {
uni.showToast({ title: err.message || '绑定失败', icon: 'none' });
}
};
const handleFillAllCommission = () => {
const comm = Number(user.value.commission || 0);
if (comm <= 0) {