From 43bf0773bc3e2b40a4d8f4cc3bf48e6e8b6ec586 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=94=B0=E9=A6=99=E7=90=AA?= <624506849@qq.com>
Date: Fri, 11 Sep 2026 18:48:04 +0800
Subject: [PATCH] =?UTF-8?q?feat(distribution):=20=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E4=B8=8A=E7=BA=A7=E5=88=86=E9=94=80=E5=91=98=E4=BF=A1=E6=81=AF?=
=?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=B8=8E=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 新增上级分销员信息的显示,确保在满足条件时可见。
- 引入获取上级分销员信息的API,优化数据加载流程。
- 更新样式以提升上级信息的可读性和用户体验。
---
pages/mine/distribution/home.vue | 41 ++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/pages/mine/distribution/home.vue b/pages/mine/distribution/home.vue
index f7fb72d..a9aed15 100644
--- a/pages/mine/distribution/home.vue
+++ b/pages/mine/distribution/home.vue
@@ -25,6 +25,9 @@
+
+ 上级:{{ parentLabel }}
+
@@ -217,6 +220,7 @@ import {
getDistributionCustomers,
getDistributionInvitees,
getDistributionOrders,
+ getDistributionParent,
getDistributionPerformance,
} from '@/api/distribution'
import { getUserInfo } from '@/api/members'
@@ -237,6 +241,8 @@ const todayOrderCount = ref(0)
const todayEarnings = ref(0)
const todayCustomerCount = ref(0)
const todayInviteCount = ref(0)
+const parentDistributorVisible = ref(undefined)
+const parentNickname = ref('')
const userInfo = computed(() => store.state.userInfo || {})
const displayName = computed(() => userInfo.value.nickName || distributionData.value.memberName || '分销员')
@@ -265,6 +271,11 @@ const nextGrade = computed(() => {
const gradeVisible = computed(() => gradeList.value.length > 0)
+const parentLabel = computed(() => {
+ const name = (parentNickname.value || '').trim()
+ return name || '暂无'
+})
+
const upgradeTip = computed(() => {
if (!nextGrade.value) {
return '当前已是最高等级,继续保持优秀业绩'
@@ -292,10 +303,16 @@ function refreshUserInfo() {
})
}
+function resetParentState() {
+ parentDistributorVisible.value = undefined
+ parentNickname.value = ''
+}
+
function loadPageData() {
checking.value = true
centerReady.value = false
distributionData.value = {}
+ resetParentState()
fetchDistribution()
.then((active) => {
if (!active) {
@@ -309,6 +326,7 @@ function loadPageData() {
fetchTodayCustomers(),
fetchTodayInvites(),
fetchFeaturedGoods(),
+ fetchParent(),
])
})
.finally(() => {
@@ -381,6 +399,19 @@ function fetchFeaturedGoods() {
})
}
+function fetchParent() {
+ resetParentState()
+ return getDistributionParent()
+ .then((res) => {
+ const result = res.data?.result
+ parentDistributorVisible.value = result?.parentDistributorVisible
+ parentNickname.value = result?.parentNickname || ''
+ })
+ .catch(() => {
+ resetParentState()
+ })
+}
+
function formatMoney(val: number | string) {
const num = Number(val || 0)
return num.toFixed(2)
@@ -580,6 +611,16 @@ function goOrder() {
line-height: 1.6;
}
+.parent-row {
+ margin-top: 16rpx;
+}
+
+.parent-text {
+ color: rgba(255, 255, 255, 0.72);
+ font-size: 24rpx;
+ line-height: 1.6;
+}
+
.level-bar {
margin: -24rpx 24rpx 0;
position: relative;