UIDefine.ts 7.1 KB

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