UIDefine.ts 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. import { UICachePolicy, UILayer } from '../framework/ui/UILayer';
  2. // viewId.StoreView
  3. export const UIViewID = {
  4. LoginView: 'LoginView',
  5. HomeView: 'HomeView',
  6. LoadingView: "LoadingView",
  7. Mail: "Mail",
  8. MailDetail: "MailDetail",
  9. StoreView: "StoreView",
  10. PlayHistory: "PlayHistory",
  11. GamePolicyView: "GamePolicyView",
  12. Register: "Register",
  13. ResetPsd: "ResetPsd",
  14. AutoLogin: "AutoLogin",
  15. LoginSuccess: "LoginSuccess",
  16. Support: "Support",
  17. OrderView: "OrderView",
  18. UIFirstPack: "UIFirstPack",
  19. RedeemView: "RedeemView",
  20. UIToast: "UIToast",
  21. UIDialog: "UIDialog",
  22. UserInfoView: "UserInfoView",
  23. UnbindAccount: "UnbindAccount",
  24. ChangeName: "ChangeName",
  25. ChangeAvatar: "ChangeAvatar",
  26. BindPhone: "BindPhone",
  27. BindEmail: "BindEmail",
  28. UIInvite: "UIInvite",
  29. UIInviteBind: "UIInviteBind",
  30. UIInviteSpin: "UIInviteSpin",
  31. ChangePhone: "ChangePhone",
  32. ChangeEmail: "ChangeEmail",
  33. SeasonPassView: "SeasonPassView",
  34. SeasonPassPurchase: "SeasonPassPurchase",
  35. ClubView: "ClubView",
  36. UIBirthdayGift: "UIBirthdayGift",
  37. UIClubRules: "UIClubRules",
  38. UIKYCVerify: "UIKYCVerify",
  39. UIPayoutConfrim: "UIPayoutConfrim",
  40. UIPayoutEditor: "UIPayoutEditor",
  41. UIPayoutResult: "UIPayoutResult",
  42. CheckInView: "CheckInView",
  43. RewardView: "RewardView",
  44. } as const;
  45. export type UIViewID = typeof UIViewID[keyof typeof UIViewID];
  46. export interface UIViewConfig {
  47. id: UIViewID;
  48. prefabPath: string;
  49. layer: UILayer;
  50. bundle?: string;
  51. cache?: UICachePolicy;
  52. mutexGroup?: string;
  53. /** true 时,打开该界面不自动显示 LoadingView,默认 false。 */
  54. ignoreLoading?: boolean;
  55. }
  56. /**
  57. * 项目全部 UIView 的静态配置。
  58. */
  59. export const UIViewConfigs: Record<string, UIViewConfig> = {
  60. [UIViewID.LoginView]: {
  61. id: UIViewID.LoginView,
  62. prefabPath: 'ui/login/LoginView',
  63. layer: UILayer.Page,
  64. },
  65. [UIViewID.HomeView]: {
  66. id: UIViewID.HomeView,
  67. prefabPath: 'ui/home/HomeView',
  68. layer: UILayer.Page,
  69. cache: UICachePolicy.Persist,
  70. },
  71. [UIViewID.LoadingView]: {
  72. id: UIViewID.LoadingView,
  73. prefabPath: 'ui/loading/LoadingView',
  74. layer: UILayer.Loading,
  75. cache: UICachePolicy.Persist,
  76. ignoreLoading: true,
  77. },
  78. [UIViewID.UIToast]: {
  79. id: UIViewID.UIToast,
  80. prefabPath: 'ui/toast/UIToast',
  81. layer: UILayer.Toast,
  82. cache: UICachePolicy.Persist,
  83. ignoreLoading: true,
  84. },
  85. [UIViewID.UIDialog]: {
  86. id: UIViewID.UIDialog,
  87. prefabPath: 'ui/dialog/UIDialog',
  88. ignoreLoading: true,
  89. layer: UILayer.System,
  90. cache: UICachePolicy.Persist,
  91. },
  92. [UIViewID.Mail]: {
  93. id: UIViewID.Mail,
  94. prefabPath: 'ui/mail/Mail',
  95. layer: UILayer.Popup,
  96. },
  97. [UIViewID.MailDetail]: {
  98. id: UIViewID.MailDetail,
  99. prefabPath: 'ui/mail/MailDetail',
  100. layer: UILayer.Popup,
  101. cache: UICachePolicy.Delayed,
  102. },
  103. [UIViewID.StoreView]: {
  104. id: UIViewID.StoreView,
  105. prefabPath: 'ui/store/StoreView',
  106. layer: UILayer.Page,
  107. },
  108. [UIViewID.OrderView]: {
  109. id: UIViewID.OrderView,
  110. prefabPath: 'ui/store/OrderView',
  111. layer: UILayer.Popup,
  112. },
  113. [UIViewID.UIFirstPack]: {
  114. id: UIViewID.UIFirstPack,
  115. prefabPath: 'ui/store/UIFirstPack',
  116. layer: UILayer.Popup
  117. },
  118. [UIViewID.PlayHistory]: {
  119. id: UIViewID.PlayHistory,
  120. prefabPath: 'ui/playHistory/PlayHistory',
  121. layer: UILayer.Popup,
  122. },
  123. [UIViewID.GamePolicyView]: {
  124. id: UIViewID.GamePolicyView,
  125. prefabPath: 'ui/policy/GamePolicyView',
  126. layer: UILayer.Popup,
  127. },
  128. [UIViewID.Register]: {
  129. id: UIViewID.Register,
  130. prefabPath: 'ui/register/Register',
  131. layer: UILayer.Popup
  132. },
  133. [UIViewID.ResetPsd]: {
  134. id: UIViewID.ResetPsd,
  135. prefabPath: 'ui/resetPsd/ResetPsd',
  136. layer: UILayer.Popup
  137. },
  138. [UIViewID.AutoLogin]: {
  139. id: UIViewID.AutoLogin,
  140. prefabPath: 'ui/login/AutoLogin',
  141. layer: UILayer.Popup
  142. },
  143. [UIViewID.LoginSuccess]: {
  144. id: UIViewID.LoginSuccess,
  145. prefabPath: 'ui/login/LoginSuccess',
  146. layer: UILayer.Popup
  147. },
  148. [UIViewID.Support]: {
  149. id: UIViewID.Support,
  150. prefabPath: 'ui/support/Support',
  151. layer: UILayer.Popup
  152. },
  153. [UIViewID.RedeemView]: {
  154. id: UIViewID.RedeemView,
  155. prefabPath: 'ui/redeem/RedeemView',
  156. layer: UILayer.Page
  157. },
  158. [UIViewID.UIPayoutConfrim]: {
  159. id: UIViewID.UIPayoutConfrim,
  160. prefabPath: 'ui/redeem/UIPayoutConfrim',
  161. layer: UILayer.Popup
  162. },
  163. [UIViewID.UIPayoutEditor]: {
  164. id: UIViewID.UIPayoutEditor,
  165. prefabPath: 'ui/redeem/UIPayoutEditor',
  166. layer: UILayer.Popup
  167. },
  168. [UIViewID.UIPayoutResult]: {
  169. id: UIViewID.UIPayoutResult,
  170. prefabPath: 'ui/redeem/UIPayoutResult',
  171. layer: UILayer.Popup
  172. },
  173. [UIViewID.UserInfoView]: {
  174. id: UIViewID.UserInfoView,
  175. prefabPath: 'ui/userInfo/UserInfoView',
  176. layer: UILayer.Page,
  177. cache: UICachePolicy.Delayed,
  178. },
  179. [UIViewID.UnbindAccount]: {
  180. id: UIViewID.UnbindAccount,
  181. prefabPath: 'ui/userInfo/UnbindAccount',
  182. layer: UILayer.Popup
  183. },
  184. [UIViewID.ChangeName]: {
  185. id: UIViewID.ChangeName,
  186. prefabPath: 'ui/userInfo/ChangeName',
  187. layer: UILayer.Popup
  188. },
  189. [UIViewID.ChangeAvatar]: {
  190. id: UIViewID.ChangeAvatar,
  191. prefabPath: 'ui/userInfo/ChangeAvatar',
  192. layer: UILayer.Popup
  193. },
  194. [UIViewID.BindPhone]: {
  195. id: UIViewID.BindPhone,
  196. prefabPath: 'ui/userInfo/BindPhone',
  197. layer: UILayer.Popup
  198. },
  199. [UIViewID.BindEmail]: {
  200. id: UIViewID.BindEmail,
  201. prefabPath: 'ui/userInfo/BindEmail',
  202. layer: UILayer.Popup
  203. },
  204. [UIViewID.UIInvite]: {
  205. id: UIViewID.UIInvite,
  206. prefabPath: 'ui/invite/UIInvite',
  207. layer: UILayer.Popup
  208. },
  209. [UIViewID.UIInviteBind]: {
  210. id: UIViewID.UIInviteBind,
  211. prefabPath: 'ui/invite/UIInviteBind',
  212. layer: UILayer.Popup
  213. },
  214. [UIViewID.UIInviteSpin]: {
  215. id: UIViewID.UIInviteSpin,
  216. prefabPath: 'ui/invite/UIInviteSpin',
  217. layer: UILayer.Popup
  218. },
  219. [UIViewID.ChangePhone]: {
  220. id: UIViewID.ChangePhone,
  221. prefabPath: 'ui/userInfo/ChangePhone',
  222. layer: UILayer.Popup
  223. },
  224. [UIViewID.ChangeEmail]: {
  225. id: UIViewID.ChangeEmail,
  226. prefabPath: 'ui/userInfo/ChangeEmail',
  227. layer: UILayer.Popup
  228. },
  229. [UIViewID.SeasonPassView]: {
  230. id: UIViewID.SeasonPassView,
  231. prefabPath: 'ui/seasonPass/SeasonPassView',
  232. layer: UILayer.Page,
  233. cache: UICachePolicy.Delayed,
  234. },
  235. [UIViewID.SeasonPassPurchase]: {
  236. id: UIViewID.SeasonPassPurchase,
  237. prefabPath: 'ui/seasonPass/SeasonPassPurchase',
  238. layer: UILayer.Popup
  239. },
  240. [UIViewID.ClubView]: {
  241. id: UIViewID.ClubView,
  242. prefabPath: 'ui/club/ClubView',
  243. layer: UILayer.Page
  244. },
  245. [UIViewID.UIBirthdayGift]: {
  246. id: UIViewID.UIBirthdayGift,
  247. prefabPath: 'ui/club/UIBirthdayGift',
  248. layer: UILayer.Popup
  249. },
  250. [UIViewID.UIClubRules]: {
  251. id: UIViewID.UIClubRules,
  252. prefabPath: 'ui/club/UIClubRules',
  253. layer: UILayer.Popup
  254. },
  255. [UIViewID.UIKYCVerify]: {
  256. id: UIViewID.UIKYCVerify,
  257. prefabPath: 'ui/club/UIKYCVerify',
  258. layer: UILayer.Popup
  259. },
  260. [UIViewID.RewardView]: {
  261. id: UIViewID.RewardView,
  262. prefabPath: 'ui/reward/RewardView',
  263. layer: UILayer.Popup,
  264. },
  265. [UIViewID.CheckInView]: {
  266. id: UIViewID.CheckInView,
  267. prefabPath: 'ui/checkIn/CheckInView',
  268. layer: UILayer.Page,
  269. cache: UICachePolicy.Delayed,
  270. },
  271. };
  272. export function getUIViewConfig(viewId: UIViewID): UIViewConfig {
  273. return UIViewConfigs[viewId];
  274. }