UIDefine.ts 8.1 KB

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