feat(distribution): 添加分销员状态检查与加载指示

- 在多个分销相关页面中引入分销员状态检查,确保用户在访问前具备有效分销资格。
- 增加加载指示器以改善用户体验,提示用户正在加载数据。
- 更新相关逻辑以处理分销员资格的不同状态,确保用户在不符合条件时获得适当反馈。
This commit is contained in:
田香琪
2026-09-09 13:21:53 +08:00
parent 4fdd266dec
commit c12c76f6f5
21 changed files with 419 additions and 83 deletions

View File

@@ -19,7 +19,10 @@
</view>
</view>
<template v-if="detailId">
<view v-if="!pageReady" class="state-wrap">
<text class="state-text">加载中...</text>
</view>
<template v-else-if="detailId">
<view v-if="detailLoading" class="state-wrap">
<text class="state-text">加载中...</text>
</view>
@@ -62,7 +65,7 @@
</view>
</template>
<template v-else>
<template v-else-if="pageReady">
<view class="main-tabs">
<view
v-for="item in mainTabs"
@@ -184,6 +187,7 @@ import {
updateDistributionCustomerStarred,
} from '@/api/distribution'
import { parseGoodsImageUrl } from '@/utils/filters.js'
import { assertActiveDistributor } from '@/utils/distributionStatus'
const store = useStore()
const themeStyle = computed(() => 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(() => {