index.tsx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { createAttrsForm } from "../../../defines/createAttrsForm";
  2. import { createCompHooks } from "../../../defines/createCompHooks";
  3. import { createCompId } from "../../../defines/createCompId";
  4. import { GroupNumber } from "../../../formItems/GroupNumber";
  5. const thumbnail =
  6. "https://sku3d-test.obs.cn-east-3.myhuaweicloud.com/queenshow/1685507733441_uVjZuw_thumbnail.png";
  7. export { Component } from "./component";
  8. export const options = {
  9. name: "卡片2",
  10. thumbnail,
  11. };
  12. export const { createComp, useCompData } = createCompHooks({
  13. value: {},
  14. layout: {
  15. padding: "0 0 0.2rem 0",
  16. size: [750, 600],
  17. },
  18. children: {
  19. bgImg: () =>
  20. createCompId("Image", {
  21. value: {
  22. url: "https://sku3d-test.obs.cn-east-3.myhuaweicloud.com/queenshow/1685527709350_MHQZdg_bg.png",
  23. x: 0,
  24. y: 0,
  25. s: 1,
  26. },
  27. }),
  28. item1: () =>
  29. createCompId("Image", {
  30. value: { url: thumbnail, x: 26.5, y: -23.0, s: 4.05 },
  31. }),
  32. item2: () =>
  33. createCompId("Image", {
  34. value: { url: thumbnail, x: -4.0, y: -13.5, s: 3.9 },
  35. }),
  36. item3: () =>
  37. createCompId("Image", {
  38. value: { url: thumbnail, x: -34.0, y: -3.5, s: 4.0 },
  39. }),
  40. text1: () =>
  41. createCompId("Text", {
  42. value: `<p><span style="font-size:42px;"><strong>&nbsp; </strong></span><span style="color:hsl(0, 0%, 100%);font-size:42px;"><strong>P190</strong></span></p><p><span style="color:hsl(0, 0%, 100%);font-size:20px;">&nbsp; &nbsp; &nbsp;可注塑</span></p>`,
  43. }),
  44. text2: () =>
  45. createCompId("Text", {
  46. value: `<p style="text-align:right;"><span style="color:hsl(0, 0%, 0%);font-size:14px;">全新 &nbsp;| &nbsp;时尚 &nbsp;| &nbsp;简约 &nbsp;</span></p>`,
  47. }),
  48. },
  49. });
  50. export const Form = createAttrsForm([
  51. {
  52. label: "图片尺寸",
  53. dataIndex: "value.imgSize",
  54. component: GroupNumber,
  55. props: {
  56. labels: ["宽", "高"],
  57. },
  58. },
  59. ]);