Files
ZYZ/shared/domain/activityField/popNotice.ts
2022-08-04 19:33:49 +08:00

45 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { ActivityModelType } from "../../db/Activity";
import { ActivityBase } from "./activityField";
interface PopNoticeInDb {
bg: string; // 背景图片
canClose: boolean; // 是否可以选择今天不再弹出
sort: number; // 活动的排序,越大的越前
skip: string; // 前往
sysType: number; // dic_zyz_systemOpenTime的id功能开启
timePosition: string; // 控制公告持续时间的显示位置'&'表示不显示持续时间
btnPosition: string; // 按钮位置
time: string; // 公告持续时间
}
/**
* 打脸公告
*/
export class PopNoticeData extends ActivityBase {
bg: string; // 背景图片
canClose: boolean; // 是否可以选择今天不再弹出
sort: number; // 活动的排序,越大的越前
skip: string; // 前往
sysType: number; // dic_zyz_systemOpenTime的id功能开启
timePosition: string; // 控制公告持续时间的显示位置'&'表示不显示持续时间
btnPosition: string; // 按钮位置
time: string; // 公告持续时间
constructor(activityData: ActivityModelType, createTime: number, serverTime: number) {
super(activityData, createTime, serverTime)
this.initData(activityData.data)
}
public initData(data: string) {
let dataObj: PopNoticeInDb = JSON.parse(data);
this.bg = dataObj.bg;
this.canClose = dataObj.canClose;
this.sort = dataObj.sort;
this.sysType = dataObj.sysType;
this.skip = dataObj.skip;
this.timePosition = dataObj.timePosition;
this.btnPosition = dataObj.btnPosition;
this.time = dataObj.time;
}
}