mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-09-20 20:02:02 +08:00
feat(distribution): 添加分销员状态检查与加载指示
- 在多个分销相关页面中引入分销员状态检查,确保用户在访问前具备有效分销资格。 - 增加加载指示器以改善用户体验,提示用户正在加载数据。 - 更新相关逻辑以处理分销员资格的不同状态,确保用户在不符合条件时获得适当反馈。
This commit is contained in:
@@ -136,6 +136,7 @@ import { distribution as fetchDistribution } from '@/api/distribution'
|
||||
import configs from '@/config/config'
|
||||
import storage from '@/utils/storage'
|
||||
import { tipsToLogin, setClipboard } from '@/utils/filters.js'
|
||||
import { DISTRIBUTION_RETREAT_MESSAGE, DISTRIBUTION_STATUS } from '@/utils/distributionStatus'
|
||||
|
||||
const sharingShow = ref(false)
|
||||
const sharingLink = ref('')
|
||||
@@ -194,18 +195,19 @@ function distribution() {
|
||||
if (!tipsToLogin('normal')) {
|
||||
return
|
||||
}
|
||||
// 入口按 distributionStatus 路由:有对象 ≠ 有效分销员。清退停住,不进 join / home。
|
||||
fetchDistribution().then((res) => {
|
||||
if (res.data.result) {
|
||||
const type = res.data.result.distributionStatus
|
||||
if (type == 'PASS') {
|
||||
if (type == DISTRIBUTION_STATUS.PASS) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mine/distribution/home',
|
||||
})
|
||||
} else if (type == 'REFUSE') {
|
||||
} else if (type == DISTRIBUTION_STATUS.REFUSE) {
|
||||
goRecruitJoin()
|
||||
} else if (type == 'RETREAT') {
|
||||
} else if (type == DISTRIBUTION_STATUS.RETREAT) {
|
||||
uni.showToast({
|
||||
title: '您的分销资格已被清退。请联系管理员!',
|
||||
title: DISTRIBUTION_RETREAT_MESSAGE,
|
||||
duration: 2000,
|
||||
icon: 'none',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user