| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- import { UICachePolicy, UILayer } from '../framework/ui/UILayer';
- // viewId.StoreView
- export const UIViewID = {
- LoginView: 'LoginView',
- HomeView: 'HomeView',
- LoadingView: "LoadingView",
- MailView: "MailView",
- StoreView: "StoreView",
- PlayHistory: "PlayHistory",
- GamePolicyView: "GamePolicyView",
- Register: "Register",
- ResetPsd: "ResetPsd",
- AutoLogin: "AutoLogin",
- RegisterSuccess: "RegisterSuccess",
- Support: "Support",
- OrderView: "OrderView",
- UIFirstPack: "UIFirstPack",
- UIWithdraw: "UIWithdraw",
- UIToast: "UIToast",
- UIDialog: "UIDialog",
- UserInfoView: "UserInfoView",
- AccountUnlink: "AccountUnlink",
- ChangeName: "ChangeName",
- ChangeAvatar: "ChangeAvatar",
- BindPhone: "BindPhone",
- BindEmail: "BindEmail",
- UIInvite: "UIInvite",
- } as const;
- export type UIViewID = typeof UIViewID[keyof typeof UIViewID];
- export interface UIViewConfig {
- id: UIViewID;
- prefabPath: string;
- layer: UILayer;
- bundle?: string;
- cache?: UICachePolicy;
- mutexGroup?: string;
- /** true 时,打开该界面不自动显示 LoadingView,默认 false。 */
- ignoreLoading?: boolean;
- }
- /**
- * 项目全部 UIView 的静态配置。
- */
- export const UIViewConfigs: Record<string, UIViewConfig> = {
- [UIViewID.LoginView]: {
- id: UIViewID.LoginView,
- prefabPath: 'ui/login/LoginView',
- layer: UILayer.Page,
- },
- [UIViewID.HomeView]: {
- id: UIViewID.HomeView,
- prefabPath: 'ui/home/HomeView',
- layer: UILayer.Page,
- cache: UICachePolicy.Persist,
- },
- [UIViewID.LoadingView]: {
- id: UIViewID.LoadingView,
- prefabPath: 'ui/loading/LoadingView',
- layer: UILayer.Loading,
- cache: UICachePolicy.Persist,
- ignoreLoading: true,
- },
- [UIViewID.UIToast]: {
- id: UIViewID.UIToast,
- prefabPath: 'ui/toast/UIToast',
- layer: UILayer.Toast,
- cache: UICachePolicy.Persist,
- ignoreLoading: true,
- },
- [UIViewID.UIDialog]: {
- id: UIViewID.UIDialog,
- prefabPath: 'ui/dialog/UIDialog',
- ignoreLoading: true,
- layer: UILayer.System,
- cache: UICachePolicy.Persist,
- },
- [UIViewID.MailView]: {
- id: UIViewID.MailView,
- prefabPath: 'ui/mail/MailView',
- layer: UILayer.Popup
- },
- [UIViewID.StoreView]: {
- id: UIViewID.StoreView,
- prefabPath: 'ui/store/StoreView',
- layer: UILayer.Page,
- },
- [UIViewID.OrderView]: {
- id: UIViewID.OrderView,
- prefabPath: 'ui/store/OrderView',
- layer: UILayer.Popup,
- },
- [UIViewID.UIFirstPack]: {
- id: UIViewID.UIFirstPack,
- prefabPath: 'ui/store/UIFirstPack',
- layer: UILayer.Popup
- },
- [UIViewID.PlayHistory]: {
- id: UIViewID.PlayHistory,
- prefabPath: 'ui/playHistory/PlayHistory',
- layer: UILayer.Popup,
- },
- [UIViewID.GamePolicyView]: {
- id: UIViewID.GamePolicyView,
- prefabPath: 'ui/policy/GamePolicyView',
- layer: UILayer.Popup,
- },
- [UIViewID.Register]: {
- id: UIViewID.Register,
- prefabPath: 'ui/register/Register',
- layer: UILayer.Popup
- },
- [UIViewID.ResetPsd]: {
- id: UIViewID.ResetPsd,
- prefabPath: 'ui/resetPsd/ResetPsd',
- layer: UILayer.Popup
- },
- [UIViewID.AutoLogin]: {
- id: UIViewID.AutoLogin,
- prefabPath: 'ui/login/AutoLogin',
- layer: UILayer.Popup
- },
- [UIViewID.RegisterSuccess]: {
- id: UIViewID.RegisterSuccess,
- prefabPath: 'ui/register/RegisterSuccess',
- layer: UILayer.Popup
- },
- [UIViewID.Support]: {
- id: UIViewID.Support,
- prefabPath: 'ui/support/Support',
- layer: UILayer.Popup
- },
- [UIViewID.UIWithdraw]: {
- id: UIViewID.UIWithdraw,
- prefabPath: 'ui/withdraw/UIWithdraw',
- layer: UILayer.Popup
- },
- [UIViewID.UserInfoView]: {
- id: UIViewID.UserInfoView,
- prefabPath: 'ui/userInfo/UserInfoView',
- layer: UILayer.Page
- },
- [UIViewID.AccountUnlink]: {
- id: UIViewID.AccountUnlink,
- prefabPath: 'ui/userInfo/AccountUnlink',
- layer: UILayer.Popup
- },
- [UIViewID.ChangeName]: {
- id: UIViewID.ChangeName,
- prefabPath: 'ui/userInfo/ChangeName',
- layer: UILayer.Popup
- },
- [UIViewID.ChangeAvatar]: {
- id: UIViewID.ChangeAvatar,
- prefabPath: 'ui/userInfo/ChangeAvatar',
- layer: UILayer.Popup
- },
- [UIViewID.BindPhone]: {
- id: UIViewID.BindPhone,
- prefabPath: 'ui/userInfo/BindPhone',
- layer: UILayer.Popup
- },
- [UIViewID.BindEmail]: {
- id: UIViewID.BindEmail,
- prefabPath: 'ui/userInfo/BindEmail',
- layer: UILayer.Popup
- },
- [UIViewID.UIInvite]: {
- id: UIViewID.UIInvite,
- prefabPath: 'ui/invite/UIInvite',
- layer: UILayer.Popup
- },
- };
- export function getUIViewConfig(viewId: UIViewID): UIViewConfig {
- return UIViewConfigs[viewId];
- }
|