feat(distribution): 增强分销入口检查与用户反馈

- 引入自助招募入口检查逻辑,确保用户在访问前获得明确的状态反馈。
- 在分销相关页面中添加分销功能关闭和线上招募关闭的提示信息。
- 优化页面逻辑,确保在不同状态下用户体验的一致性与流畅性。
This commit is contained in:
田香琪
2026-09-13 16:29:06 +08:00
parent 43bf0773bc
commit ba4e9126e8
4 changed files with 137 additions and 14 deletions

View File

@@ -136,7 +136,13 @@ 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'
import {
checkSelfRecruitEntry,
DISTRIBUTION_CLOSE_MESSAGE,
DISTRIBUTION_ONLINE_ENTRY_CLOSED_MESSAGE,
DISTRIBUTION_RETREAT_MESSAGE,
DISTRIBUTION_STATUS,
} from '@/utils/distributionStatus'
const sharingShow = ref(false)
const sharingLink = ref('')
@@ -191,6 +197,28 @@ function goRecruitJoin() {
})
}
function enterSelfRecruitOrToast() {
checkSelfRecruitEntry().then((gate) => {
if (gate === 'distribution_closed') {
uni.showToast({
title: DISTRIBUTION_CLOSE_MESSAGE,
duration: 2000,
icon: 'none',
})
return
}
if (gate === 'entry_closed') {
uni.showToast({
title: DISTRIBUTION_ONLINE_ENTRY_CLOSED_MESSAGE,
duration: 2000,
icon: 'none',
})
return
}
goRecruitJoin()
})
}
function distribution() {
if (!tipsToLogin('normal')) {
return
@@ -204,7 +232,7 @@ function distribution() {
url: '/pages/mine/distribution/home',
})
} else if (type == DISTRIBUTION_STATUS.REFUSE) {
goRecruitJoin()
enterSelfRecruitOrToast()
} else if (type == DISTRIBUTION_STATUS.RETREAT) {
uni.showToast({
title: DISTRIBUTION_RETREAT_MESSAGE,
@@ -225,7 +253,7 @@ function distribution() {
icon: 'none',
})
} else {
goRecruitJoin()
enterSelfRecruitOrToast()
}
})
}