UIDefine.ts 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. 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. CheckInView: "CheckInView",
  41. RewardView: "RewardView",
  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. cache: UICachePolicy.Delayed,
  100. },
  101. [UIViewID.StoreView]: {
  102. id: UIViewID.StoreView,
  103. prefabPath: 'ui/store/StoreView',
  104. layer: UILayer.Page,
  105. },
  106. [UIViewID.OrderView]: {
  107. id: UIViewID.OrderView,
  108. prefabPath: 'ui/store/OrderView',
  109. layer: UILayer.Popup,
  110. },
  111. [UIViewID.UIFirstPack]: {
  112. id: UIViewID.UIFirstPack,
  113. prefabPath: 'ui/store/UIFirstPack',
  114. layer: UILayer.Popup
  115. },
  116. [UIViewID.PlayHistory]: {
  117. id: UIViewID.PlayHistory,
  118. prefabPath: 'ui/playHistory/PlayHistory',
  119. layer: UILayer.Popup,
  120. },
  121. [UIViewID.GamePolicyView]: {
  122. id: UIViewID.GamePolicyView,
  123. prefabPath: 'ui/policy/GamePolicyView',
  124. layer: UILayer.Popup,
  125. },
  126. [UIViewID.Register]: {
  127. id: UIViewID.Register,
  128. prefabPath: 'ui/register/Register',
  129. layer: UILayer.Popup
  130. },
  131. [UIViewID.ResetPsd]: {
  132. id: UIViewID.ResetPsd,
  133. prefabPath: 'ui/resetPsd/ResetPsd',
  134. layer: UILayer.Popup
  135. },
  136. [UIViewID.AutoLogin]: {
  137. id: UIViewID.AutoLogin,
  138. prefabPath: 'ui/login/AutoLogin',
  139. layer: UILayer.Popup
  140. },
  141. [UIViewID.LoginSuccess]: {
  142. id: UIViewID.LoginSuccess,
  143. prefabPath: 'ui/login/LoginSuccess',
  144. layer: UILayer.Popup
  145. },
  146. [UIViewID.Support]: {
  147. id: UIViewID.Support,
  148. prefabPath: 'ui/support/Support',
  149. layer: UILayer.Popup
  150. },
  151. [UIViewID.RedeemView]: {
  152. id: UIViewID.RedeemView,
  153. prefabPath: 'ui/redeem/RedeemView',
  154. layer: UILayer.Page
  155. },
  156. [UIViewID.UIPayoutConfrim]: {
  157. id: UIViewID.UIPayoutConfrim,
  158. prefabPath: 'ui/redeem/UIPayoutConfrim',
  159. layer: UILayer.Popup
  160. },
  161. [UIViewID.UIPayoutEditor]: {
  162. id: UIViewID.UIPayoutEditor,
  163. prefabPath: 'ui/redeem/UIPayoutEditor',
  164. layer: UILayer.Popup
  165. },
  166. [UIViewID.UIPayoutResult]: {
  167. id: UIViewID.UIPayoutResult,
  168. prefabPath: 'ui/redeem/UIPayoutResult',
  169. layer: UILayer.Popup
  170. },
  171. [UIViewID.UserInfoView]: {
  172. id: UIViewID.UserInfoView,
  173. prefabPath: 'ui/userInfo/UserInfoView',
  174. layer: UILayer.Page,
  175. cache: UICachePolicy.Delayed,
  176. },
  177. [UIViewID.UnbindAccount]: {
  178. id: UIViewID.UnbindAccount,
  179. prefabPath: 'ui/userInfo/UnbindAccount',
  180. layer: UILayer.Popup
  181. },
  182. [UIViewID.ChangeName]: {
  183. id: UIViewID.ChangeName,
  184. prefabPath: 'ui/userInfo/ChangeName',
  185. layer: UILayer.Popup
  186. },
  187. [UIViewID.ChangeAvatar]: {
  188. id: UIViewID.ChangeAvatar,
  189. prefabPath: 'ui/userInfo/ChangeAvatar',
  190. layer: UILayer.Popup
  191. },
  192. [UIViewID.BindPhone]: {
  193. id: UIViewID.BindPhone,
  194. prefabPath: 'ui/userInfo/BindPhone',
  195. layer: UILayer.Popup
  196. },
  197. [UIViewID.BindEmail]: {
  198. id: UIViewID.BindEmail,
  199. prefabPath: 'ui/userInfo/BindEmail',
  200. layer: UILayer.Popup
  201. },
  202. [UIViewID.UIInvite]: {
  203. id: UIViewID.UIInvite,
  204. prefabPath: 'ui/invite/UIInvite',
  205. layer: UILayer.Popup
  206. },
  207. [UIViewID.ChangePhone]: {
  208. id: UIViewID.ChangePhone,
  209. prefabPath: 'ui/userInfo/ChangePhone',
  210. layer: UILayer.Popup
  211. },
  212. [UIViewID.ChangeEmail]: {
  213. id: UIViewID.ChangeEmail,
  214. prefabPath: 'ui/userInfo/ChangeEmail',
  215. layer: UILayer.Popup
  216. },
  217. [UIViewID.SeasonPassView]: {
  218. id: UIViewID.SeasonPassView,
  219. prefabPath: 'ui/seasonPass/SeasonPassView',
  220. layer: UILayer.Page
  221. },
  222. [UIViewID.SeasonPassPurchase]: {
  223. id: UIViewID.SeasonPassPurchase,
  224. prefabPath: 'ui/seasonPass/SeasonPassPurchase',
  225. layer: UILayer.Popup
  226. },
  227. [UIViewID.ClubView]: {
  228. id: UIViewID.ClubView,
  229. prefabPath: 'ui/club/ClubView',
  230. layer: UILayer.Page
  231. },
  232. [UIViewID.UIBirthdayGift]: {
  233. id: UIViewID.UIBirthdayGift,
  234. prefabPath: 'ui/club/UIBirthdayGift',
  235. layer: UILayer.Popup
  236. },
  237. [UIViewID.UIClubRules]: {
  238. id: UIViewID.UIClubRules,
  239. prefabPath: 'ui/club/UIClubRules',
  240. layer: UILayer.Popup
  241. },
  242. [UIViewID.UIKYCVerify]: {
  243. id: UIViewID.UIKYCVerify,
  244. prefabPath: 'ui/club/UIKYCVerify',
  245. layer: UILayer.Popup
  246. },
  247. [UIViewID.CheckInView]: {
  248. id: UIViewID.CheckInView,
  249. prefabPath: 'ui/checkIn/CheckInView',
  250. layer: UILayer.Page,
  251. cache: UICachePolicy.Delayed,
  252. },
  253. [UIViewID.RewardView]: {
  254. id: UIViewID.RewardView,
  255. prefabPath: 'ui/reward/RewardView',
  256. layer: UILayer.Page,
  257. }
  258. };
  259. export function getUIViewConfig(viewId: UIViewID): UIViewConfig {
  260. return UIViewConfigs[viewId];
  261. }