import { BasicProps, EditSetting } from '../type' export class Props extends BasicProps { public editSetting: EditSetting = { key: 'gaea-shareButton', name: '分享配置模块(元气故事)', type: 'business', // 一个按钮,单次主动调用分享小窗口(njb_share) // 由于此次活动是展示分享当前已报名用户的个人主页,有高度的业务性,后续可以把报名状态的判断逻辑删除 isContainer: true, editors: [ { field: 'docTitle', type: 'string', text: '页面标题', placeholder: '不设置会取分享标题' }, { field: 'title', type: 'string', text: '分享标题', placeholder: '默认为页面标题' }, { field: 'description', type: 'string', text: '分享摘要' }, { field: 'picurl', type: 'image', text: '分享图片' }, { field: 'lofterPic', type: 'image', text: 'LOFTER站内分享' }, { field: 'link', type: 'string', text: '分享链接(这次需求是个人主页)', placeholder: '不设置会取页面当前链接' }, ] }; docTitle: string title: string description: string activityId: string picurl?: { url: string } lofterPic?: { url: string } text: string link: string public btnBackgroundImage: { url: string; width: number; height: number; }; } /** * 活动总信息 * @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; }; /** */ 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' | 'total' /** * 作品展示模块配置 * @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' /** * @author 龚叶峰 * @createTime 2021.07.29 20:55:27 */ 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/res/?pid=53622&id=343246 * @author 祝娜 * @createTime 2021.03.15 10:17:45 */ // 请求参数 export interface SpreadCommonGetInfoRequestData { /** 活动名称(唯一) */ name: string; } // 响应参数 export interface SpreadCommonGetInfoResponseData { code: number; msg: string; data: { actEventInfo: ActEventInfoVO; actUserInfo?: { /** true 已经报名 */ signup: boolean; /** true 用户有报名资格 */ canSign: boolean; /** canSign false时提示 */ msg: string; blogInfo: SimpleBlogInfo; }; /** true已登录 */ hasLogin: boolean; }; } export class State { contextValue: { activityInfo: ActivityInfoData | undefined; isLoading: boolean; getActivityInfo: () => Promise; } = { activityInfo: undefined, isLoading: true, getActivityInfo: undefined } } export type ActivityInfoData = SpreadCommonGetInfoResponseData['data']