UIDefine.ts 8.7 KB

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