config.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
  2. /** 拼团属性 */
  3. export interface PromotionCombinationProperty {
  4. // 布局类型:单列 | 三列
  5. layoutType: 'oneCol' | 'threeCol'
  6. // 商品字段
  7. fields: {
  8. // 商品名称
  9. name: PromotionCombinationFieldProperty
  10. // 商品价格
  11. price: PromotionCombinationFieldProperty
  12. }
  13. // 角标
  14. badge: {
  15. // 是否显示
  16. show: boolean
  17. // 角标图片
  18. imgUrl: string
  19. }
  20. // 上圆角
  21. borderRadiusTop: number
  22. // 下圆角
  23. borderRadiusBottom: number
  24. // 间距
  25. space: number
  26. // 拼团活动编号
  27. activityId: number
  28. // 组件样式
  29. style: ComponentStyle
  30. }
  31. // 商品字段
  32. export interface PromotionCombinationFieldProperty {
  33. // 是否显示
  34. show: boolean
  35. // 颜色
  36. color: string
  37. }
  38. // 定义组件
  39. export const component = {
  40. id: 'PromotionCombination',
  41. name: '拼团',
  42. icon: 'mdi:account-group',
  43. property: {
  44. layoutType: 'oneCol',
  45. fields: {
  46. name: { show: true, color: '#000' },
  47. price: { show: true, color: '#ff3000' }
  48. },
  49. badge: { show: false, imgUrl: '' },
  50. borderRadiusTop: 8,
  51. borderRadiusBottom: 8,
  52. space: 8,
  53. style: {
  54. bgType: 'color',
  55. bgColor: '',
  56. marginLeft: 8,
  57. marginRight: 8,
  58. marginBottom: 8
  59. } as ComponentStyle
  60. }
  61. } as DiyComponent<PromotionCombinationProperty>