import { BlogInfo } from '../focus/type'; import { BasicProps, BasicState, EditSetting } from '../type' export class Props extends BasicProps { public editSetting: EditSetting = { key: 'gaea-template-activity-container', name: '模板活动-容器', isContainer: true, isAutoHeight: true, defaultPosition: { top: '0', left: '0' }, editors: [ { field: 'activityId', text: '活动ID', type: 'string', }, { field: 'backgroundImage', type: 'image', text: '背景图片' }, ] }; public isAutoHeight: boolean = true; public activityId: string; public backgroundImage: { url: string } public style: React.CSSProperties = { width: '10rem', backgroundSize: '100%', backgroundPosition: '0% 0%', backgroundRepeat: 'no-repeat', height: '10rem' }; } export class State extends BasicState { contextValue: { activityInfo: ActivityInfoData | undefined; isLoading: boolean; getActivityInfo: () => Promise; } = { activityInfo: undefined, isLoading: true, getActivityInfo: undefined } } /** * 活动总信息 * @author 祝娜 * @createTime 2021.03.15 10:15:12 */ export interface ActEventInfoVO { /** 活动英文名称 */ activityId: string; /** 开始时间 */ startTime: number; /** 结束时间 */ endTime: number; signupConfig?: SignupConfig; postsConfig?: PostsShowConfig[]; status: ActivityStatus; /** 活动中文名 */ cname: string; /** 报名配置id 数据库主键 */ eventId: number; /** 活动关联的tag */ tags: string; /** 活动规则页面 */ ruleLink: string; /** 活动对外推广链接 */ actLink: string; livesConfig: ActEventLiveRoomVO[]; } /** * @author 白植超 * @createTime 2021.10.26 19:36:49 */ export interface ActEventLiveRoomVO { /** 配置记录id */ id: number; /** 活动id */ activityId: string; anchor: number; /** 直播间id */ roomId: number; /** 标题 */ title: string; /** 封面 */ imageUrl: string; /** 直播开始时间 */ liveTime: number; /** 是否支持订阅 */ canSubs: boolean; /** push文案 */ pushText: string; /** 简单展示模式 */ simpleLayout: boolean; description: string; } /** */ export type ActivityStatus = 0 | 1 | 2 | -1 | -99 /** * auto 自动生成 * file 物料导入 */ export type PostsGenType = 'auto' | 'file' /** * day 日榜 * week 周榜 * month 月榜 * new 最新 */ export type PostsRankType = 'day' | 'week' | 'month' | 'new' /** * 作品展示模块配置 * @author 祝娜 * @createTime 2021.03.24 17:10:54 */ export interface PostsShowConfig { /** 列表名称(中文) */ cname: string; /** 列表说明 */ intro: string; /** 作品展示数量 */ showLimit: number; /** 需要展示的发文tag(模块) */ showTag: string; postsGenType: PostsGenType; autoType?: PostsRankType; /** 物料文件nos地址 */ fileUrl?: string; /** 模块id,(不同模块不能重复) */ id: number; /** 关联的活动名称 */ activityId: string; }; /** * radio 单选 * checkbox 多选 * input 文本 * textarea 文本 */ export type QuestionFormType = 'radio' | 'checkbox' | 'input' | 'textarea' /** * 问卷题目信息 * @author 祝娜 * @createTime 2021.03.23 17:43:21 */ export interface QuestionItem { type: QuestionFormType; /** true必填 */ required?: boolean; /** 限制字数,只有文本类型支持 */ limit?: number; /** 表单项名称 */ name: string; /** 选项列表,单选或复选类型支持 */ options?: string[]; /** 文本类型预占字符 */ placeholder?: string; status: QuestionItemStatus; }; /** */ export type QuestionItemStatus = 1 | 0 /** * 问卷总信息 * @author 祝娜 * @createTime 2021.03.23 17:50:40 */ export interface QuetionNaire { questionItems: QuestionItem[]; /** 问卷标题(题目字数限制50字以内) */ name: string; /** 问卷描述 */ intro: string; }; /** * 报名模块总配置 * @author 祝娜 * @createTime 2021.03.23 17:12:50 */ export interface SignupConfig { signupType: SignupType; quesitonNaire?: QuetionNaire; /** 配置主键 */ id: number; /** 活动英文名(与活动表对应) */ activityId: string; /** 失败文案 */ failTip?: string; /** 设备限制1(唯一设备) */ deviceLimit: number; /** 手机号限制1(唯一手机号(登录手机号)) */ phoneLimit: number; /** 粉丝数要求 */ fansNum: number; /** 发文数要求 */ publishNum: number; /** 发文总体热度要求 */ hotNum: number; /** 注册时间要求(注册时间需早于该时间才能报名成功) */ cursorTime: number; }; /** * button 按钮类型 * questionnaire 问卷类型 */ export type SignupType = 'button' | 'questionnaire' export interface SimpleBlogInfo { isVerify: boolean; blogNickName: string; bigAvaImg: string; blogId: number; isAuth: boolean; signAuth: boolean; authName: string; blogName: string; }; /** * h5-活动信息获取 * @link https://nei.hz.netease.com/interface/detail/?pid=53622&id=343246 * @author 祝娜 * @createTime 2021.03.15 10:17:45 */ // 响应参数 export interface ActivityInfoResponseData { code: number; msg: string; data: { actEventInfo: ActEventInfoVO; actUserInfo?: { /** true 已经报名 */ signup: boolean; canSign: boolean; msg: string; blogInfo: SimpleBlogInfo }; /** true已登录 */ hasLogin: boolean; lives: LiveStatus[]; }; } export interface LiveStatus { roomId: number; roomUrl: string; liveStatus: number; // 0未开播,1正在直播,2已结束 subscribed: boolean; subEnds: boolean; // 后来加的字段,表示是否还能预约,其实是根据当前时间是否在设置开播时间前10分钟之前 blogInfo: BlogInfo } export type ActivityInfoData = ActivityInfoResponseData['data']