UIDefine.ts 8.3 KB

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