启动页作为应用程序首次出现的页面,该页面提供一些预加载数据的提前获取,防止应用程序出现白屏等异常,如是否第一次访问应用程序并开启应用欢迎页;判断用户登录信息进行页面跳转;消息信息懒加载等。
常见启动页参数如下表所示:
常见启动页方法如下表所示:
方法 | 类型 | 描述 | 必填 |
---|---|---|---|
skip | void | 跳转方法 | Y |
封装启动页参数类代码如下所示:
export class Splash {
// 倒计时时长
timer: number;
// 显示Logo
isLogo?: boolean = false;
// 页面显示图片
backgroundImg?: ResourceStr;
// 企业名称
companyName?: string;
// 企业名称字体颜色
mFontColor?: ResourceColor;
constructor(timer: number, isLogo?: boolean, backgroundImg?: ResourceStr,
companyName?: string, mFontColor?: ResourceColor) {
this.timer = timer;
this.isLogo = isLogo;
this.backgroundImg = backgroundImg;
this.companyName = com