后台:跑马灯

This commit is contained in:
luying
2021-07-07 16:43:06 +08:00
parent a1aabfdd42
commit f45dd06621
6 changed files with 80 additions and 35 deletions

View File

@@ -397,6 +397,8 @@ export const STATUS = {
GM_ACTIVITY_GROUP_NOT_FOUND: { code: 60019, simStr: '未找到该活动组' },
GM_ACTIVITY_GROUP_TYPE_NOT_FOUND: { code: 60020, simStr: '未找到活动组类型' },
GM_ACTIVITY_NOT_FIT_GROUP_TYPE: { code: 60021, simStr: '该活动不满足该活动组类型' },
GM_MARQUEE_ERR: { code: 60022, simStr: '跑马灯定时设置错误' },
GM_MARQUEE_CANCEL_ERR: { code: 60023, simStr: '取消失败' },
// 支付相关状态 70000 - 79999
NO_PRODUCT_ID: { code: 70001, simStr: '无效商品' },
NO_PAY_TYPE: { code: 70002, simStr: '无效支付类型' },

View File

@@ -29,6 +29,9 @@ export default class Marquee extends BaseModel {
@prop({ required: true })
content: string; // 广播内容
@prop({ required: true })
isRunning: boolean; // 当前正在发布
/**
* 创建跑马灯
* @param params 参数
@@ -75,10 +78,7 @@ export default class Marquee extends BaseModel {
private static getSearchObj(form: { type?: number, current?: boolean, content?: string }) {
let searchObj = {};
if(form['type']) searchObj['type'] = form.type;
if(form['current']) {
searchObj['startTime'] = { $lte: new Date };
searchObj['endTime'] = { $gte: new Date };
}
if(form['current']) searchObj['isRunning'] = form.current
if(form['content']) searchObj['content'] = { $regex: new RegExp(form.content.toString(), 'i') };
return searchObj
}