| | |
| | | |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | /** 活动模板类型 */ |
| | | export const ACTIVITY_TYPE = { |
| | | /** 纯通知:只推一条文本,无表单 */ |
| | | TEXT: 1, |
| | | /** 单条消息:推一张可点击卡片 */ |
| | | MESSAGE: 2, |
| | | /** 图片通知:上传图片后推送图片消息 */ |
| | | IMAGE: 3, |
| | | /** 附件通知:上传文件后推送文件消息 */ |
| | | FILE: 4, |
| | | /** 数据采集/评价:报名页 + 自定义字段 + 评价 */ |
| | | FORM: 5, |
| | | } as const; |
| | | |
| | | export namespace WxCpActivityApi { |
| | | /** 活动状态:0草稿 1已发布 2已结束 3已取消 */ |
| | | export const ACTIVITY_STATUS = { |
| | |
| | | USER: 2, |
| | | } as const; |
| | | |
| | | /** 采集字段 */ |
| | | export interface Field { |
| | | id?: number; |
| | | fieldLabel?: string; |
| | | /** text / textarea / number / date / select / radio / checkbox / rating */ |
| | | fieldType?: string; |
| | | /** 多个选项用英文逗号分隔 */ |
| | | fieldOptions?: string; |
| | | required?: boolean; |
| | | placeholder?: string; |
| | | sortNo?: number; |
| | | } |
| | | |
| | | /** 活动 */ |
| | | export interface Activity { |
| | | id?: number; |
| | | title?: string; |
| | | /** 模板类型,见 ACTIVITY_TYPE */ |
| | | activityType?: number; |
| | | activityTypeName?: string; |
| | | content?: string; |
| | | /** 卡片按钮文案 */ |
| | | buttonText?: string; |
| | | /** 是否开启评价(数据采集模板) */ |
| | | ratingEnabled?: boolean; |
| | | ratingTitle?: string; |
| | | ratingMax?: number; |
| | | /** 图片通知的图片 blobId */ |
| | | imageBlobIds?: number[]; |
| | | imageAttachmentList?: SignupAttachment[]; |
| | | /** 附件通知的附件 blobId */ |
| | | fileBlobIds?: number[]; |
| | | fileAttachmentList?: SignupAttachment[]; |
| | | /** 数据采集模板的自定义字段 */ |
| | | fieldList?: Field[]; |
| | | /** |
| | | * 封面图文件编号(最多 1 张) |
| | | * |
| | |
| | | blobIds?: number[]; |
| | | /** 封面图附件列表(后端返回,最多 1 张) */ |
| | | attachmentList?: SignupAttachment[]; |
| | | /** |
| | | * 详情图片文件编号(最多 5 张) |
| | | * |
| | | * 与封面同样走附件中间表,但 recordType 是 wxcp_activity_detail。 |
| | | * 报名页在「活动详情」文字下方按原图比例完整展示(不裁剪), |
| | | * 二维码/海报这类被裁就失效的图要放这里,不要放封面。 |
| | | */ |
| | | detailBlobIds?: number[]; |
| | | /** 详情图片附件列表(后端返回,最多 5 张) */ |
| | | detailAttachmentList?: SignupAttachment[]; |
| | | location?: string; |
| | | startTime?: string; |
| | | endTime?: string; |
| | |
| | | mobile?: string; |
| | | deptName?: string; |
| | | content?: string; |
| | | /** 评价星级 */ |
| | | ratingScore?: number; |
| | | /** 自定义采集字段值 */ |
| | | fieldValues?: { fieldId?: number; fieldLabel?: string; fieldType?: string; fieldValue?: string }[]; |
| | | /** 状态:0已报名 1已取消 2已签到 */ |
| | | status?: number; |
| | | statusName?: string; |