req.ts 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. export interface ElementType {
  2. elementType: 'TOP_IMAGE' | 'TOP_SLIDER' | 'TOP_VIDEO' | 'IMAGE' | 'SLIDER' | 'VIDEO' | 'TEXT' | 'APP_DOWNLOAD' | 'WEAPP' | 'GH' | 'ENTERPRISE_WX' | 'FLOAT_BUTTON' | 'IMAGE_TEXT',
  3. comptActive?: boolean
  4. }
  5. /**边距 */
  6. export interface Padding {
  7. paddingTop: number,//边距 顶部轮播不存在
  8. paddingBottom: number,//边距 顶部轮播不存在
  9. }
  10. /**文本 */
  11. export interface Text extends ElementType, Padding {
  12. text: string,
  13. fontSize: 14 | 15 | 16 | 18 | 20 | 24 | 36,
  14. fontColor: string,
  15. textAlignment: 0 | 1 | 2, // 取值 0: left, 1: middle, 2: right. 默认 0
  16. fontStyle: 0 | 1, // 0: 常规, 1: 加粗. 默认 0
  17. }
  18. /**公众号按钮*/
  19. export interface GhButton extends ElementType, Padding {
  20. fastFollow: 0 | 1// 是否开启一键关注,取值 0: 关闭, 1: 开启. 默认 1
  21. btnTitle: string, // use_icon 为 0 时,长度限制 1-10 ;use_icon 为 1 时,长度限制 1-8 ; 默认:关注公众号
  22. fontColor: string, // 按钮文案颜色 默认#FFFFFF
  23. btnBgColorTheme: string, // 按钮填充色 默认#07C160
  24. btnBorderColorTheme: string, // 边框色,#000000-#FFFFFF,默认#FFFFFF
  25. btnFontType: 0 | 1, // 按钮文案配置 取值 0: 常规, 1: 加粗. 默认 0
  26. useIcon: 0 | 1, // 是否使用图标 取值 0: 不使用图标, 1: 使用图标. 默认 0
  27. }
  28. /**添加商家微信按钮*/
  29. export interface WxAutoButton extends Padding, ElementType {
  30. cropId?: string, // 绑定的企业 id
  31. groupId?: number, // 客服组 id
  32. btnTitle: string, // 按钮文案,
  33. fontColor: string, // 按钮文案颜色,#000000-#FFFFFF,默认#FFFFFF
  34. btnBgColorTheme: string, // 按钮填充色,#000000-#FFFFFF,默认#07C160
  35. btnBorderColorTheme: string, // 边框色,#000000-#FFFFFF,默认#FFFFFF
  36. btnFontType: 0 | 1, // 字体粗细 0常用 1加粗
  37. useIcon: 0 | 1, // 图标开启关闭 取值 0: 不使用图标, 1: 使用图标. 默认 0
  38. }
  39. /**img */
  40. export interface Img extends ElementType, Padding {
  41. imageUrl: string,
  42. width: number,
  43. height: number,
  44. }
  45. /**top_img */
  46. export interface TopImg extends ElementType {
  47. imageUrl: string,
  48. width: number,
  49. height: number,
  50. adLocation: 'sns' | 'gzh', // sns 代表朋友圈, gzh 代表公众号
  51. outerStyle?: 0 | 1, //ad_location 为 sns 时必填. 取值 0: 常规广告, 1: 卡片广告
  52. }
  53. /**top_Video */
  54. export interface TopVideo extends ElementType {
  55. videoUrl: string,
  56. width: number,
  57. height: number,
  58. adLocation: 'sns' | 'gzh',
  59. outerStyle?: 0 | 1 | 2, //为 sns 时必填 0: 常规广告, 1: 基础卡片广告, 2: 全幅卡片广告
  60. usedForOuter?: 0 | 1, //0:顶部素材用于广告外层, 1:顶部素材不用于广告外层. 默认 0. 仅微信平台账号有效. outer_style=1 时选填
  61. }
  62. /** 悬浮组件 */
  63. export interface Floatbutton {
  64. elementType: 'FLOAT_BUTTON',
  65. styleType: 0 | 1 | 2, // 取值 0: 图片+title+desc,1: title+desc, 2: title
  66. imageUrl?: string, // style_type=0 时必填. 悬浮组件图片 id. 图片尺寸 96x96
  67. title: string, // 悬浮组件标题
  68. titleColor?: string, //悬浮组件标题颜色 "#171717",
  69. desc?: string, // 描述
  70. descColor?: string, //悬浮组件描述颜色. 默认#4C4C4C
  71. appearType?: 0 | 1, //出现方式 取值 0. 进入页面时出现, 1. 滑动页面时出现. 默认 0 如果 page_specs_list 只有一页必须为 0
  72. disappearType?: 0 | 1, //消失方式 取值 0.不消失, 1.滑至页面底部时消失, 默认 0 如果 page_specs_list 只有一页必须为 0
  73. forbidPageList?: number[], // 悬浮按钮不出现的页面数组. [1,2]代表第 1,2 页不出现悬浮按钮, 依次类推.
  74. componentItem: Omit<GhButton, 'btnBorderColorTheme' | 'useIcon' | 'paddingTop' | 'paddingBottom'> | Omit<WxAutoButton, 'btnBorderColorTheme' | 'useIcon' | 'paddingTop' | 'paddingBottom'>
  75. }
  76. /**top_slider 顶部轮播*/
  77. export interface TopSlider extends ElementType {
  78. imageUrlList: string[],
  79. width: number,
  80. height: number,
  81. activeIndex?: number
  82. }
  83. /** 图文复合组件New 相关 开始======= */
  84. export interface ITItemGhSpec extends Padding {
  85. fastFollow: 0 | 1 // 是否开启一键关注,取值 0: 关闭, 1: 开启. 默认 1
  86. btnTitle: string, // use_icon 为 0 时,长度限制 1-10 ;use_icon 为 1 时,长度限制 1-8 ; 默认:关注公众号
  87. fontColor: string, // 按钮文案颜色 默认#FFFFFF
  88. btnBgColorTheme: string, // 按钮填充色 默认#07C160
  89. btnBorderColorTheme: string, // 边框色,#000000-#FFFFFF,默认#FFFFFF
  90. btnFontType: 0 | 1, // 按钮文案配置 取值 0: 常规, 1: 加粗. 默认 0
  91. useIcon: 0 | 1, // 是否使用图标 取值 0: 不使用图标, 1: 使用图标. 默认 0
  92. }
  93. export interface ITItemEnterpriseWxSpec extends Padding {
  94. cropId?: string, // 绑定的企业 id
  95. groupId?: number, // 客服组 id
  96. btnTitle: string, // 按钮文案,
  97. fontColor: string, // 按钮文案颜色,#000000-#FFFFFF,默认#FFFFFF
  98. btnBgColorTheme: string, // 按钮填充色,#000000-#FFFFFF,默认#07C160
  99. btnBorderColorTheme: string, // 边框色,#000000-#FFFFFF,默认#FFFFFF
  100. btnFontType: 0 | 1, // 字体粗细 0常用 1加粗
  101. useIcon: 0 | 1, // 图标开启关闭 取值 0: 不使用图标, 1: 使用图标. 默认 0
  102. }
  103. export interface ImageTextItem {
  104. borderColor: string, // 边框色,#000000-#FFFFFF,默认#e5e5e5
  105. titleColor: string, // 标题颜色,#000000-#FFFFFF. 默认#353535
  106. descColor: string, // 描述颜色,#000000-#FFFFFF. 默认#b2b2b2
  107. bgColor: string, // 背景颜色,#000000-#FFFFFF. 默认#ffffff
  108. jumpMode: 'btn_jump' | 'total_jump', //图文复合组件跳转方式,默认为 btn_jump(按钮跳转) total_jump(全局跳转)
  109. imageUrl: string, // 图片链接 对标 material_id
  110. title: string, // 标题,长度限制 1-8 ; 字段长度最小 1 字节,长度最大 10 字节
  111. desc: string, // 描述,长度限制 1-10 ;字段长度最小 1 字节,长度最大 10 字节
  112. subElemType: 'GH' | 'ENTERPRISE_WX', // 图文复合组件转化类型,
  113. content: ITItemGhSpec | ITItemEnterpriseWxSpec
  114. }
  115. export interface ImageText extends ElementType, Padding {
  116. alignMode: 0 | 1, // 0 左对齐,1 居中对齐,只有选一行 2 个的时候才生效. 默认值 0
  117. imageTextItem: ImageTextItem[]
  118. }
  119. /** 图文复合组件New 相关 结束======= */