feat(后台): 批量邮件

This commit is contained in:
luying
2023-06-03 20:02:24 +08:00
parent 6e5a8affe9
commit ac877d9561
12 changed files with 435 additions and 308 deletions

View File

@@ -20,14 +20,14 @@ export class UpdateMailParams {
content: string;
sendName: string;
mailType: GM_MAIL_TYPE; // 收件人类型
receivers: {env: string; serverId: number; roleId: string; roleName: string; }[];
receivers: {env: string; serverId: number; roleId: string; roleName: string; rewards: {id: number; count: number}[] }[];
reason: string; // 原因
isSp: boolean = false; // 特殊邮件
isSingle: boolean;
constructor(obj: UpdateMailParams) {
this.goods = obj.goods;
this.hasGoods = obj.goods?.length > 0;
if(obj.goods && obj.goods?.length > 0) this.hasGoods = true;
this.timeType = obj.timeType;
this.expire = obj.expire;
this.startTime = obj.startTime;
@@ -44,6 +44,12 @@ export class UpdateMailParams {
this.mailType = GM_MAIL_TYPE.SERVER;
}
this.receivers = obj.receivers;
if(obj.receivers && obj.receivers.length > 0) {
for(let { rewards } of obj.receivers) {
console.log('#### rewards', rewards)
if(rewards && rewards.length > 0) this.hasGoods = true;
}
}
this.reason = obj.reason;
this.isSp = obj.isSp;
}