mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-09-21 20:32:01 +08:00
feat(distribution): 添加分销员状态检查与加载指示
- 在多个分销相关页面中引入分销员状态检查,确保用户在访问前具备有效分销资格。 - 增加加载指示器以改善用户体验,提示用户正在加载数据。 - 更新相关逻辑以处理分销员资格的不同状态,确保用户在不符合条件时获得适当反馈。
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view v-if="!pageReady" class="state-wrap">
|
||||
<text class="state-text">加载中...</text>
|
||||
</view>
|
||||
<template v-else>
|
||||
<view class="search-bar">
|
||||
<view class="search-inner">
|
||||
<u-icon name="search" color="#bbb" size="18" />
|
||||
@@ -81,6 +85,7 @@
|
||||
<text>{{ finished ? '没有更多了' : (loadingMore ? '加载中...' : '上拉加载更多') }}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -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<string, { field: string; order: string }> = {
|
||||
HIGHEST_COMMISSION: { field: 'COMMISSION', order: 'DESC' },
|
||||
@@ -103,6 +109,7 @@ const sortTabs = [
|
||||
{ field: 'PRICE', label: '价格' },
|
||||
]
|
||||
|
||||
const pageReady = ref(false)
|
||||
const routeQuery = ref<Record<string, string>>({})
|
||||
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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user