From c12c76f6f5e2251cba3c615baf8be5473fdd12e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=94=B0=E9=A6=99=E7=90=AA?= <624506849@qq.com>
Date: Wed, 9 Sep 2026 13:21:53 +0800
Subject: [PATCH] =?UTF-8?q?feat(distribution):=20=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E5=88=86=E9=94=80=E5=91=98=E7=8A=B6=E6=80=81=E6=A3=80=E6=9F=A5?=
=?UTF-8?q?=E4=B8=8E=E5=8A=A0=E8=BD=BD=E6=8C=87=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在多个分销相关页面中引入分销员状态检查,确保用户在访问前具备有效分销资格。
- 增加加载指示器以改善用户体验,提示用户正在加载数据。
- 更新相关逻辑以处理分销员资格的不同状态,确保用户在不符合条件时获得适当反馈。
---
pages/mine/distribution/achievement.vue | 15 +++-
pages/mine/distribution/bank-accounts.vue | 19 ++--
pages/mine/distribution/cash-history.vue | 10 ++-
pages/mine/distribution/customer-list.vue | 21 +++--
pages/mine/distribution/grade.vue | 30 ++++---
pages/mine/distribution/history.vue | 8 +-
pages/mine/distribution/home.vue | 57 ++++++++----
pages/mine/distribution/invite-friends.vue | 15 +++-
pages/mine/distribution/invite-list.vue | 15 +++-
pages/mine/distribution/invite.vue | 6 ++
pages/mine/distribution/join.vue | 51 ++++++++---
pages/mine/distribution/list.vue | 12 +++
pages/mine/distribution/order-detail.vue | 12 ++-
pages/mine/distribution/order-list.vue | 15 +++-
pages/mine/distribution/poster.vue | 6 ++
pages/mine/distribution/share.vue | 22 +++++
pages/mine/distribution/wallet-log.vue | 10 ++-
pages/mine/distribution/withdraw-apply.vue | 35 ++++++--
pages/mine/distribution/withdrawal.vue | 33 ++++---
pages/tabbar/user/utils/tool.vue | 10 ++-
utils/distributionStatus.js | 100 +++++++++++++++++++++
21 files changed, 419 insertions(+), 83 deletions(-)
create mode 100644 utils/distributionStatus.js
diff --git a/pages/mine/distribution/achievement.vue b/pages/mine/distribution/achievement.vue
index 9bf0664..252aba9 100644
--- a/pages/mine/distribution/achievement.vue
+++ b/pages/mine/distribution/achievement.vue
@@ -1,5 +1,9 @@
+
+ 加载中...
+
+
@@ -126,6 +130,7 @@
知道了
+
@@ -135,6 +140,7 @@ import { onShow, onLoad } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import { getDistributionPerformance } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
@@ -146,6 +152,7 @@ const rangeTabs = [
{ label: '近七日', value: 'LAST_7_DAYS' },
]
+const pageReady = ref(false)
const activeRange = ref('ALL')
const loading = ref(false)
const customVisible = ref(false)
@@ -176,7 +183,13 @@ onLoad((options: Record) => {
})
onShow(() => {
- loadPerformance()
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ pageReady.value = true
+ loadPerformance()
+ })
})
function formatMoney(val: number | string) {
diff --git a/pages/mine/distribution/bank-accounts.vue b/pages/mine/distribution/bank-accounts.vue
index 2ece322..6e095a4 100644
--- a/pages/mine/distribution/bank-accounts.vue
+++ b/pages/mine/distribution/bank-accounts.vue
@@ -7,7 +7,7 @@
-
+
-
+
暂无银行卡,请添加
-
+
+ 添加账户
@@ -102,6 +102,7 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import { getBankCards, addBankCard, deleteBankCard, setDefaultBankCard } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
@@ -113,7 +114,8 @@ const isSelectMode = ref(false)
const accounts = ref([])
const selectedId = ref('')
-const loading = ref(false)
+const pageReady = ref(false)
+const loading = ref(true)
const addPopupVisible = ref(false)
const saveLoading = ref(false)
const form = ref({ holderName: '', bankName: '', cardNo: '' })
@@ -127,7 +129,14 @@ onLoad((options: any) => {
})
onShow(() => {
- loadAccounts()
+ loading.value = true
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ pageReady.value = true
+ loadAccounts()
+ })
})
function loadAccounts() {
diff --git a/pages/mine/distribution/cash-history.vue b/pages/mine/distribution/cash-history.vue
index bac6ca7..c90c996 100644
--- a/pages/mine/distribution/cash-history.vue
+++ b/pages/mine/distribution/cash-history.vue
@@ -33,6 +33,7 @@ import { onLoad, onReachBottom } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import { cashLog } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
@@ -40,13 +41,18 @@ const themeStyle = computed(() => getThemeStyle(store.state.theme))
const cashList = ref([])
const cashPage = ref(1)
const cashTotal = ref(0)
-const cashLoading = ref(false)
+const cashLoading = ref(true)
const cashLoadingMore = ref(false)
const cashFinished = ref(false)
const PAGE_SIZE = 15
onLoad(() => {
- loadCashHistory(true)
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ loadCashHistory(true)
+ })
})
onReachBottom(() => {
diff --git a/pages/mine/distribution/customer-list.vue b/pages/mine/distribution/customer-list.vue
index 300b26f..0d94752 100644
--- a/pages/mine/distribution/customer-list.vue
+++ b/pages/mine/distribution/customer-list.vue
@@ -19,7 +19,10 @@
-
+
+ 加载中...
+
+
加载中...
@@ -62,7 +65,7 @@
-
+
getThemeStyle(store.state.theme))
@@ -207,6 +211,7 @@ const rangeTabs = [
const activeFilter = ref('ALL')
const activeRange = ref('ALL')
const keyword = ref('')
+const pageReady = ref(false)
const loading = ref(false)
const loadingMore = ref(false)
const finished = ref(false)
@@ -245,9 +250,15 @@ onShow(() => {
if (current?.options) {
applyRouteOptions(current.options)
}
- if (!detailId.value) {
- resetAndLoad()
- }
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ pageReady.value = true
+ if (!detailId.value) {
+ resetAndLoad()
+ }
+ })
})
onReachBottom(() => {
diff --git a/pages/mine/distribution/grade.vue b/pages/mine/distribution/grade.vue
index fae49f0..fe3dec2 100644
--- a/pages/mine/distribution/grade.vue
+++ b/pages/mine/distribution/grade.vue
@@ -119,7 +119,8 @@ import { onShow } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import config from '@/config/config'
-import { distribution, getDistributionGrades } from '@/api/distribution'
+import { getDistributionGrades } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
import { getUserInfo } from '@/api/members'
const store = useStore()
@@ -166,18 +167,21 @@ function refreshUserInfo() {
function loadPageData() {
loading.value = true
- Promise.all([fetchGrades(), fetchDistribution()]).finally(() => {
- loading.value = false
- })
-}
-
-function fetchDistribution() {
- return distribution().then((res) => {
- if (!res.data?.result) {
- return
- }
- distributionData.value = res.data.result
- })
+ let allowed = false
+ assertActiveDistributor()
+ .then((result) => {
+ if (!result) {
+ return
+ }
+ allowed = true
+ distributionData.value = result
+ return fetchGrades()
+ })
+ .finally(() => {
+ if (allowed) {
+ loading.value = false
+ }
+ })
}
function fetchGrades() {
diff --git a/pages/mine/distribution/history.vue b/pages/mine/distribution/history.vue
index be76a08..d91dbec 100644
--- a/pages/mine/distribution/history.vue
+++ b/pages/mine/distribution/history.vue
@@ -58,6 +58,7 @@ import { onLoad, onReachBottom } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { cashLog, getDistributionOrders } from '@/api/distribution'
import { unitPrice } from '@/utils/filters.js'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
@@ -79,7 +80,12 @@ onLoad((option) => {
uni.setNavigationBarTitle({
title: type === 0 ? '分销业绩' : '提现记录',
})
- type === 0 ? fetchAchievementList() : fetchWithdrawLog()
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ type === 0 ? fetchAchievementList() : fetchWithdrawLog()
+ })
})
onReachBottom(() => {
diff --git a/pages/mine/distribution/home.vue b/pages/mine/distribution/home.vue
index 623a47f..f38e6b4 100644
--- a/pages/mine/distribution/home.vue
+++ b/pages/mine/distribution/home.vue
@@ -10,6 +10,8 @@
+ 加载中...
+
+
@@ -209,7 +212,6 @@ import { useStore } from '@/store'
import config from '@/config/config'
import { getThemeStyle } from '@/utils/theme'
import {
- distribution,
getDistributionFeaturedGoods,
getDistributionGrades,
getDistributionCustomers,
@@ -218,6 +220,7 @@ import {
getDistributionPerformance,
} from '@/api/distribution'
import { getUserInfo } from '@/api/members'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
@@ -226,6 +229,8 @@ const statusBarHeight = ref(20)
const expanded = ref(false)
const distributionData = ref>({})
+const checking = ref(true)
+const centerReady = ref(false)
const gradeList = ref([])
const featuredGoods = ref([])
const todayOrderCount = ref(0)
@@ -288,25 +293,38 @@ function refreshUserInfo() {
}
function loadPageData() {
- Promise.all([
- fetchDistribution(),
- fetchGrades(),
- fetchTodayOrders(),
- fetchTodayEarnings(),
- fetchTodayCustomers(),
- fetchTodayInvites(),
- fetchFeaturedGoods(),
- ])
+ checking.value = true
+ centerReady.value = false
+ distributionData.value = {}
+ fetchDistribution()
+ .then((active) => {
+ if (!active) {
+ return
+ }
+ centerReady.value = true
+ Promise.all([
+ fetchGrades(),
+ fetchTodayOrders(),
+ fetchTodayEarnings(),
+ fetchTodayCustomers(),
+ fetchTodayInvites(),
+ fetchFeaturedGoods(),
+ ])
+ })
+ .finally(() => {
+ if (centerReady.value) {
+ checking.value = false
+ }
+ })
}
function fetchDistribution() {
- return distribution().then((res) => {
- if (!res.data?.result) {
- uni.showToast({ title: '您还不是分销员', icon: 'none' })
- setTimeout(() => goBack(), 1500)
- return
+ return assertActiveDistributor().then((result) => {
+ if (!result) {
+ return false
}
- distributionData.value = res.data.result
+ distributionData.value = result
+ return true
})
}
@@ -497,6 +515,13 @@ function goOrder() {
width: 72rpx;
}
+.center-pending {
+ padding: 120rpx 0;
+ color: #999;
+ font-size: 28rpx;
+ text-align: center;
+}
+
.header {
background: linear-gradient(180deg, #1f2228 0%, #2a2e36 100%);
padding: 24rpx 32rpx 40rpx;
diff --git a/pages/mine/distribution/invite-friends.vue b/pages/mine/distribution/invite-friends.vue
index 5994910..772f123 100644
--- a/pages/mine/distribution/invite-friends.vue
+++ b/pages/mine/distribution/invite-friends.vue
@@ -1,5 +1,9 @@
+
+ 加载中...
+
+
邀好友 赚奖励
@@ -54,6 +58,7 @@
查看我的邀请
+
@@ -65,6 +70,7 @@ import config from '@/config/config'
import { getThemeStyle } from '@/utils/theme'
import { getDistributionInvitees } from '@/api/distribution'
import { parseGoodsImageUrl } from '@/utils/filters.js'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
@@ -91,12 +97,19 @@ const flowSteps = [
},
]
+const pageReady = ref(false)
const loading = ref(false)
const inviteTotal = ref(0)
const inviteList = ref([])
onShow(() => {
- loadPreview()
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ pageReady.value = true
+ loadPreview()
+ })
})
function loadPreview() {
diff --git a/pages/mine/distribution/invite-list.vue b/pages/mine/distribution/invite-list.vue
index 6784a7e..b53f0fc 100644
--- a/pages/mine/distribution/invite-list.vue
+++ b/pages/mine/distribution/invite-list.vue
@@ -1,5 +1,9 @@
+
+ 加载中...
+
+
@@ -80,6 +84,7 @@
+
@@ -91,6 +96,7 @@ import config from '@/config/config'
import { getThemeStyle } from '@/utils/theme'
import { getDistributionInvitees } from '@/api/distribution'
import { parseGoodsImageUrl } from '@/utils/filters.js'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
@@ -104,6 +110,7 @@ const rangeTabs = [
]
const activeRange = ref('ALL')
+const pageReady = ref(false)
const loading = ref(false)
const loadingMore = ref(false)
const finished = ref(false)
@@ -138,7 +145,13 @@ onShow(() => {
if (current?.options) {
applyRouteOptions(current.options)
}
- resetAndLoad()
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ pageReady.value = true
+ resetAndLoad()
+ })
})
onReachBottom(() => {
diff --git a/pages/mine/distribution/invite.vue b/pages/mine/distribution/invite.vue
index 599a572..7ab06a5 100644
--- a/pages/mine/distribution/invite.vue
+++ b/pages/mine/distribution/invite.vue
@@ -58,6 +58,7 @@ import { onLoad, onReady, onShareAppMessage } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import { getInviteCard } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
import { getMpCode } from '@/api/goods'
import { parseGoodsImageUrl } from '@/utils/filters.js'
import {
@@ -282,6 +283,11 @@ async function loadInviteCardSetting() {
qrError.value = ''
composeError.value = ''
+ const distributor = await assertActiveDistributor()
+ if (!distributor) {
+ return
+ }
+
try {
const res = await getInviteCard()
if (!res.data?.success || !res.data?.result) {
diff --git a/pages/mine/distribution/join.vue b/pages/mine/distribution/join.vue
index 3e82b37..b7b3427 100644
--- a/pages/mine/distribution/join.vue
+++ b/pages/mine/distribution/join.vue
@@ -1,6 +1,13 @@
加载中...
+
+
+ !
+ 分销资格已清退
+ {{ DISTRIBUTION_RETREAT_MESSAGE }}
+
+
暂未开放线上招募
@@ -171,6 +178,7 @@ import config from '@/config/config'
import { parseGoodsImageUrl, tipsToLogin } from '@/utils/filters.js'
import { resolveRecruitDistributionIdFromScene } from '@/utils/distributionBind.js'
import { getRecruitPage, getRecruitProgress, getRecruitInviter, submitRecruitApplication } from '@/api/distribution'
+import { DISTRIBUTION_RETREAT_MESSAGE, DISTRIBUTION_STATUS } from '@/utils/distributionStatus'
const defaultAvatar = config.defaultUserPhoto
@@ -198,7 +206,12 @@ const fields = computed(() => pageInfo.value.fields || [])
const recruitGoods = computed(() => plan.value?.recruitGoods || [])
const agreementContent = computed(() => plan.value?.agreementContent || '')
+const distributionStatus = computed(() => pageInfo.value.distributionStatus || '')
+const currentApplication = computed(() => pageInfo.value.currentApplication || null)
+const isRetreated = computed(() => distributionStatus.value === DISTRIBUTION_STATUS.RETREAT)
+
const showPoster = computed(() => {
+ if (isRetreated.value) return false
const p = plan.value
if (!p) return false
if (p.posterEnabled === false) return false
@@ -211,45 +224,50 @@ const posterRuleText = computed(() => plan.value?.posterRuleText || '')
const posterContact = computed(() => plan.value?.posterContact || '')
const hasJoinCondition = computed(() => {
+ if (isRetreated.value) return false
const p = plan.value
if (!p || p.joinConditionType !== 'CONDITIONAL') return false
return !!(p.requireSelfPurchaseAmount || p.requireConsumeCount || p.requirePurchaseGoods)
})
const conditionsMet = computed(() => {
+ if (isRetreated.value) return false
if (!hasJoinCondition.value) return true
return !!progress.value?.satisfied
})
-const distributionStatus = computed(() => pageInfo.value.distributionStatus || '')
-const currentApplication = computed(() => pageInfo.value.currentApplication || null)
-
const isApplyApproved = computed(() => {
- if (distributionStatus.value === 'PASS') return true
+ if (isRetreated.value) return false
+ if (distributionStatus.value === DISTRIBUTION_STATUS.PASS) return true
if (submitApplicationStatus.value === 'APPROVED') return true
if (applySubmitted.value && submitAuditMode.value === 'AUTO_PASS') return true
- return currentApplication.value?.applicationStatus === 'APPROVED'
+ return false
})
const isApplyPending = computed(() => {
+ if (isRetreated.value) return false
if (isApplyApproved.value) return false
- if (distributionStatus.value === 'APPLY') return true
+ if (distributionStatus.value === DISTRIBUTION_STATUS.APPLY) return true
if (submitApplicationStatus.value === 'PENDING') return true
if (applySubmitted.value && submitAuditMode.value === 'MANUAL') return true
return currentApplication.value?.applicationStatus === 'PENDING'
})
-const showApplyResult = computed(() => isApplyApproved.value || isApplyPending.value)
+const showApplyResult = computed(() => {
+ if (isRetreated.value) return false
+ return isApplyApproved.value || isApplyPending.value
+})
const isManualApply = computed(() => {
return (plan.value?.applyMode || 'MANUAL') === 'MANUAL'
})
const showLoginFooter = computed(() => {
- return !!plan.value && !isUserLoggedIn.value && !loading.value
+ return !isRetreated.value && !!plan.value && !isUserLoggedIn.value && !loading.value
})
const showInviterHeader = computed(() => {
+ if (isRetreated.value) return false
if (!recruitToken.value) return false
const info = inviterInfo.value
return !!(info?.memberName || info?.memberAvatar)
@@ -259,15 +277,15 @@ const inviterName = computed(() => inviterInfo.value?.memberName || '分销员')
const inviterAvatar = computed(() => parseGoodsImageUrl(inviterInfo.value?.memberAvatar) || defaultAvatar)
const showManualApply = computed(() => {
- return isUserLoggedIn.value && !showApplyResult.value && conditionsMet.value && isManualApply.value
+ return !isRetreated.value && isUserLoggedIn.value && !showApplyResult.value && conditionsMet.value && isManualApply.value
})
const showAutoApplyTip = computed(() => {
- return isUserLoggedIn.value && !showApplyResult.value && conditionsMet.value && plan.value?.applyMode === 'AUTO'
+ return !isRetreated.value && isUserLoggedIn.value && !showApplyResult.value && conditionsMet.value && plan.value?.applyMode === 'AUTO'
})
const showApplyForm = computed(() => {
- return !!plan.value?.requireApplyInfo && fields.value.length > 0
+ return !isRetreated.value && !!plan.value?.requireApplyInfo && fields.value.length > 0
})
const canApply = computed(() => {
@@ -445,7 +463,7 @@ function handleApplySuccess(application: any) {
submitAuditMode.value = auditMode
submitApplicationStatus.value = status
if (auditMode === 'AUTO_PASS' || status === 'APPROVED') {
- pageInfo.value.distributionStatus = 'PASS'
+ pageInfo.value.distributionStatus = DISTRIBUTION_STATUS.PASS
if (pageInfo.value.currentApplication) {
pageInfo.value.currentApplication.applicationStatus = 'APPROVED'
}
@@ -458,6 +476,10 @@ function submit() {
if (!tipsToLogin('normal')) {
return
}
+ if (isRetreated.value) {
+ uni.showToast({ title: DISTRIBUTION_RETREAT_MESSAGE, icon: 'none' })
+ return
+ }
if (!showManualApply.value) {
return
}
@@ -738,6 +760,11 @@ function submit() {
color: #fa8c16;
}
+.result-icon.retreated {
+ background: #fff2f0;
+ color: #ff4d4f;
+}
+
.result-title {
font-size: 36rpx;
font-weight: 600;
diff --git a/pages/mine/distribution/list.vue b/pages/mine/distribution/list.vue
index ce589b4..c0b21a0 100644
--- a/pages/mine/distribution/list.vue
+++ b/pages/mine/distribution/list.vue
@@ -1,5 +1,9 @@
+
+ 加载中...
+
+
@@ -81,6 +85,7 @@
{{ finished ? '没有更多了' : (loadingMore ? '加载中...' : '上拉加载更多') }}
+
@@ -88,6 +93,7 @@
import { ref, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { distributionGoods, getDistributionGoodsSetting } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const DEFAULT_SORT_MAP: Record = {
HIGHEST_COMMISSION: { field: 'COMMISSION', order: 'DESC' },
@@ -103,6 +109,7 @@ const sortTabs = [
{ field: 'PRICE', label: '价格' },
]
+const pageReady = ref(false)
const routeQuery = ref>({})
const keyword = ref('')
const sortField = ref('COMMISSION')
@@ -128,6 +135,11 @@ onLoad((options) => {
})
async function initPage() {
+ const distributor = await assertActiveDistributor()
+ if (!distributor) {
+ return
+ }
+ pageReady.value = true
await loadGoodsSetting()
resetAndFetch()
}
diff --git a/pages/mine/distribution/order-detail.vue b/pages/mine/distribution/order-detail.vue
index d8f1351..9befff1 100644
--- a/pages/mine/distribution/order-detail.vue
+++ b/pages/mine/distribution/order-detail.vue
@@ -9,7 +9,7 @@
-
+
{{ detail.settlementStatusText || '待结算' }}
分销订单详情
@@ -109,11 +109,12 @@ import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import { getDistributionOrderDetail } from '@/api/distribution'
import { parseGoodsImageUrl, formatGoodsSpecs } from '@/utils/filters.js'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
const statusBarHeight = ref(20)
-const loading = ref(false)
+const loading = ref(true)
const detail = ref>({})
const orderItemSn = ref('')
const orderType = ref('PROMOTION')
@@ -122,7 +123,12 @@ onLoad((options) => {
statusBarHeight.value = uni.getWindowInfo?.()?.statusBarHeight || 20
orderItemSn.value = options?.orderItemSn || ''
orderType.value = options?.orderType || 'PROMOTION'
- loadDetail()
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ loadDetail()
+ })
})
const totalGoodsNum = computed(() => Number(detail.value.totalGoodsNum || detail.value.num || 0))
diff --git a/pages/mine/distribution/order-list.vue b/pages/mine/distribution/order-list.vue
index 1ed5197..5d98b2d 100644
--- a/pages/mine/distribution/order-list.vue
+++ b/pages/mine/distribution/order-list.vue
@@ -1,5 +1,9 @@
+
+ 加载中...
+
+
@@ -132,6 +136,7 @@
+
@@ -142,6 +147,7 @@ import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import { getDistributionOrders } from '@/api/distribution'
import { parseGoodsImageUrl, formatGoodsSpecs } from '@/utils/filters.js'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
@@ -161,6 +167,7 @@ const rangeTabs = [
const activeTab = ref('PROMOTION')
const activeRange = ref('ALL')
const keyword = ref('')
+const pageReady = ref(false)
const loading = ref(false)
const loadingMore = ref(false)
const finished = ref(false)
@@ -202,7 +209,13 @@ onShow(() => {
if (current?.options) {
applyRouteOptions(current.options)
}
- resetAndLoad()
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ pageReady.value = true
+ resetAndLoad()
+ })
})
onReachBottom(() => {
diff --git a/pages/mine/distribution/poster.vue b/pages/mine/distribution/poster.vue
index dcaabc5..7a4189a 100644
--- a/pages/mine/distribution/poster.vue
+++ b/pages/mine/distribution/poster.vue
@@ -50,6 +50,7 @@ import { onLoad, onReady, onShareAppMessage } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import { getPromotionPoster } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
import { getMpCode } from '@/api/goods'
import { parseGoodsImageUrl } from '@/utils/filters.js'
import {
@@ -269,6 +270,11 @@ async function loadPosterSetting() {
qrError.value = ''
composeError.value = ''
+ const distributor = await assertActiveDistributor()
+ if (!distributor) {
+ return
+ }
+
try {
const res = await getPromotionPoster()
if (!res.data?.success || !res.data?.result) {
diff --git a/pages/mine/distribution/share.vue b/pages/mine/distribution/share.vue
index b8891f2..425146d 100644
--- a/pages/mine/distribution/share.vue
+++ b/pages/mine/distribution/share.vue
@@ -1,6 +1,10 @@
+
+ 加载中...
+
>({})
+const pageReady = ref(false)
onLoad((options) => {
query.value = (options || {}) as Record
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ pageReady.value = true
+ })
})
@@ -25,4 +37,14 @@ onLoad((options) => {
min-height: 100vh;
background: #fff;
}
+
+.state-wrap {
+ padding: 120rpx 0;
+ text-align: center;
+}
+
+.state-text {
+ color: #999;
+ font-size: 26rpx;
+}
diff --git a/pages/mine/distribution/wallet-log.vue b/pages/mine/distribution/wallet-log.vue
index 97fd5cc..6e9dca1 100644
--- a/pages/mine/distribution/wallet-log.vue
+++ b/pages/mine/distribution/wallet-log.vue
@@ -32,6 +32,7 @@ import { onLoad, onReachBottom } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import { getWalletLog } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
@@ -39,13 +40,18 @@ const themeStyle = computed(() => getThemeStyle(store.state.theme))
const walletList = ref([])
const walletPage = ref(1)
const walletTotal = ref(0)
-const walletLoading = ref(false)
+const walletLoading = ref(true)
const walletLoadingMore = ref(false)
const walletFinished = ref(false)
const PAGE_SIZE = 15
onLoad(() => {
- loadWalletLog(true)
+ assertActiveDistributor().then((d) => {
+ if (!d) {
+ return
+ }
+ loadWalletLog(true)
+ })
})
onReachBottom(() => {
diff --git a/pages/mine/distribution/withdraw-apply.vue b/pages/mine/distribution/withdraw-apply.vue
index fabbbb8..5caa80b 100644
--- a/pages/mine/distribution/withdraw-apply.vue
+++ b/pages/mine/distribution/withdraw-apply.vue
@@ -1,6 +1,9 @@
-
+
+ 加载中...
+
+
@@ -139,11 +142,13 @@ import { ref, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
-import { distribution, cash, getBankCards, addBankCard } from '@/api/distribution'
+import { cash, getBankCards, addBankCard } from '@/api/distribution'
+import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
+const pageReady = ref(false)
const canRebate = ref(0)
const amount = ref('')
const submitLoading = ref(false)
@@ -161,14 +166,17 @@ const saveLoading = ref(false)
const form = ref({ holderName: '', bankName: '', cardNo: '' })
function loadInfo() {
- distribution().then((res: any) => {
- const d = res?.data?.result || {}
+ return assertActiveDistributor().then((d) => {
+ if (!d) {
+ return null
+ }
canRebate.value = Number(d.canRebate || 0)
if (!inited.value) {
const prefill = Math.min(canRebate.value, 9999)
amount.value = prefill > 0 ? prefill.toFixed(2) : ''
inited.value = true
}
+ return d
})
}
@@ -188,8 +196,13 @@ function loadCards() {
}
onLoad(() => {
- loadInfo()
- loadCards()
+ loadInfo().then((d) => {
+ if (!d) {
+ return
+ }
+ pageReady.value = true
+ loadCards()
+ })
})
function openAccountDrawer() {
@@ -304,6 +317,16 @@ function maskCard(cardNo: string) {
.content { padding: 24rpx; }
+.state-wrap {
+ padding: 120rpx 0;
+ text-align: center;
+}
+
+.state-text {
+ color: #999;
+ font-size: 26rpx;
+}
+
.section-card {
background: #fff;
border-radius: 20rpx;
diff --git a/pages/mine/distribution/withdrawal.vue b/pages/mine/distribution/withdrawal.vue
index 651ff01..2a6daa6 100644
--- a/pages/mine/distribution/withdrawal.vue
+++ b/pages/mine/distribution/withdrawal.vue
@@ -1,5 +1,9 @@
+
+ 加载中...
+
+
提现金额
@@ -23,13 +27,15 @@
提现
+