index.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import * as Study from "./study";
  2. import * as User from "./user";
  3. import * as News from "./news";
  4. import * as Transfer from "./transfer";
  5. import * as System from './system';
  6. import * as Major from "./major";
  7. import * as Career from "./career";
  8. import * as Tree from "./tree";
  9. import { VipCardInfo } from "./user";
  10. import { EnumExamMode, EnumExamType, EnumReviewMode } from "@/common/enum";
  11. /// 接口响应
  12. export interface ApiResponse<T> {
  13. code: number;
  14. msg: string;
  15. data: T;
  16. card?: VipCardInfo;
  17. // 以下是注册登录才有的
  18. token?: string;
  19. user?: User.UserInfo;
  20. isDefaultModifyPwd?: boolean;
  21. isPasswordExpired?: boolean;
  22. // 以下是机构信息
  23. org?: {
  24. contactPhone: string;
  25. logo: string;
  26. orgName: string;
  27. }
  28. }
  29. export interface ApiCaptchaResponse {
  30. code: number;
  31. msg: string;
  32. img: string;
  33. uuid: string;
  34. }
  35. export interface ApiResponseList<T> {
  36. code: number;
  37. msg: string;
  38. rows: T[];
  39. total: number;
  40. }
  41. export interface TableConfig {
  42. border?: boolean;
  43. stripe?: boolean;
  44. emptyText?: string;
  45. loading?: boolean;
  46. rowKey?: string;
  47. }
  48. export interface TableColumnConfig {
  49. prop: string;
  50. label: string;
  51. flex?: number;
  52. slot?: string;
  53. type?: string;
  54. headerAlign?: 'left' | 'center' | 'right';
  55. align?: 'left' | 'center' | 'right';
  56. }
  57. /**
  58. * 应用 store
  59. */
  60. export interface AppStoreState {
  61. isInitialized: boolean;
  62. activeTabbar: number;
  63. statusBarHeight: number;
  64. systemInfo: UniApp.GetSystemInfoResult | null;
  65. appConfig: ConfigItem[];
  66. platform: string;
  67. }
  68. export interface DictStoreState {
  69. dicts: Record<string, DictItem[]>;
  70. }
  71. export interface UserStoreState {
  72. accessToken: string | null;
  73. user: User.UserInfo | null;
  74. isDefaultModifyPwd?: boolean;
  75. isPasswordExpired?: boolean;
  76. card: VipCardInfo | null;
  77. isExamGuideShow: boolean;
  78. tempInfo?: {
  79. location: string;
  80. examType?: EnumExamType;
  81. };
  82. org: {
  83. contactPhone: string;
  84. logo: string;
  85. orgName: string;
  86. };
  87. rememberPwd: boolean;
  88. cardPassword: string;
  89. cardNo: string;
  90. directedSchoolList: Study.DirectedSchool[];
  91. practiceSettings: Study.PracticeSettings;
  92. }
  93. /**
  94. * 字典项
  95. */
  96. export interface DictItem {
  97. dictLabel: string;
  98. dictValue: string;
  99. }
  100. export interface PickerItem {
  101. label: string;
  102. value: string | number;
  103. }
  104. export interface ConfigItem {
  105. configKey: string;
  106. configValue: string;
  107. configType: string;
  108. configName: string;
  109. configId: number;
  110. }
  111. export interface SwiperTabItem {
  112. name: string;
  113. value?: string;
  114. slot?: string;
  115. params?: any;
  116. }
  117. export { Study, User, News, Transfer, System, Major, Career, Tree };