agencyAccountUtils.js 775 B

123456789101112131415161718192021222324252627
  1. import { isAfterJuly28 } from './dateUtils';
  2. /**
  3. * 检查是否应该显示AgencyAccount
  4. * @returns {boolean} 如果应该显示返回true,否则返回false
  5. */
  6. export function shouldShowAgencyAccount() {
  7. return !isAfterJuly28();
  8. }
  9. /**
  10. * 获取AgencyAccount的显示文本
  11. * @param {Function} t - i18n翻译函数
  12. * @returns {string} 显示文本
  13. */
  14. export function getAgencyAccountText(t) {
  15. return shouldShowAgencyAccount() ? t('AccountType.AgencyAccount') : '--';
  16. }
  17. /**
  18. * 检查账户类型是否为AgencyAccount且应该隐藏
  19. * @param {number} accountType - 账户类型
  20. * @returns {boolean} 如果是AgencyAccount且应该隐藏返回true
  21. */
  22. export function isAgencyAccountAndShouldHide(accountType) {
  23. return accountType === 3 && isAfterJuly28();
  24. }