UIDefine.ts 7.4 KB

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