fix(invitation): 线下提号接入邀请返利并补发历史漏发,返利比例文案改读配置
- 线下提号(admin_pickups)不走订单结账流程,此前完全不发邀请返利;现于 Complete() 内按号主利润对半基数发放卖家侧返利 - 迁移 000086:invitation_rebate_ledgers 增加 source 列,唯一键调整为 (source, order_id, trade_role),支持提号来源且保持幂等 - 新增 cmd/rebate-backfill 幂等补发脚本:默认预演,加 -apply 才写库 - 返利阶段文案不再写死 60%/30%/15%,改为按本次实际生效比例生成(钱包流水备注同步修正) - 前台邀请页阶段标签/横幅/空态文案、移动端个人中心入口文案均改读接口配置,并修掉合法 0% 比例被 || 覆盖成 60% 的问题 - 新增单测:提号返利发放与幂等、cycleLabel 跟随后台配置
This commit is contained in:
@@ -17,6 +17,7 @@ import { formatDateMinute } from '@/shared/utils/time'
|
||||
import { uploadFile } from '@/shared/api/files'
|
||||
import { formatCent } from '@/shared/utils/money'
|
||||
import { setPassword } from '@/features/auth/api/auth'
|
||||
import { fetchUserInvitationSummary } from '@/features/invitation/api/invitation'
|
||||
|
||||
import { useDistributionSiteStore } from '@/stores/distributionSite'
|
||||
|
||||
@@ -24,6 +25,9 @@ const session = useSessionStore()
|
||||
const siteStore = useDistributionSiteStore()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
/** 邀请返利入口右侧比例文案,取自后台返利配置。 */
|
||||
const inviteRateText = ref('')
|
||||
const { unreadCount: notificationUnreadCount, unreadLabel: notificationUnreadLabel } =
|
||||
useNotificationUnreadCount(route)
|
||||
|
||||
@@ -117,6 +121,7 @@ onMounted(async () => {
|
||||
// 保留本地会话展示,避免个人中心因网络短暂异常整页不可用。
|
||||
}
|
||||
void loadBalance()
|
||||
void loadInviteRate()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -129,6 +134,17 @@ async function loadBalance() {
|
||||
}
|
||||
}
|
||||
|
||||
// 邀请返利入口右侧文案取后台实时配置的首月比例,不能写死。
|
||||
async function loadInviteRate() {
|
||||
try {
|
||||
const summary = await fetchUserInvitationSummary()
|
||||
inviteRateText.value = `首月 ${Math.round(summary.first_month_rate * 100)}% 收益`
|
||||
} catch {
|
||||
// 取不到配置时不展示数字,避免与后台实际比例不一致。
|
||||
inviteRateText.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
async function openLedgers() {
|
||||
showLedgers.value = true
|
||||
loadingLedgers.value = true
|
||||
@@ -472,7 +488,7 @@ function resolveAvatarURL(url: string | undefined | null) {
|
||||
icon="gold-coin-o"
|
||||
is-link
|
||||
to="/m/invitations"
|
||||
value="首月60%收益"
|
||||
:value="inviteRateText || '阶梯返利'"
|
||||
/>
|
||||
<van-cell title="租后须知" icon="info-o" is-link @click="openPostRentalNotice" />
|
||||
<van-cell title="系统设置" icon="setting-o" is-link @click="showSettings = true" />
|
||||
|
||||
Reference in New Issue
Block a user