|
@@ -1,6 +1,8 @@
|
|
|
+import { DesignCompObj } from "@/modules/editor/objects/DesignTemp/DesignComp";
|
|
|
import { createAttrsForm } from "../../../defines/createAttrsForm";
|
|
|
-import { createCompHooks } from "../../../defines/createCompHooks";
|
|
|
-import { createCompId } from "../../../defines/createCompId";
|
|
|
+import { RxValue } from "@/modules/editor/controllers/ReactCtrl/rxValue";
|
|
|
+import { CompImageObj } from "../../../basicUI/Image2";
|
|
|
+import { CompTextObj } from "../../../basicUI/Text";
|
|
|
|
|
|
export { Component } from "./component";
|
|
|
|
|
@@ -9,64 +11,80 @@ export const options = {
|
|
|
thumbnail: require("@/assets/comps/Cover2/thumbnail.jpg"),
|
|
|
};
|
|
|
|
|
|
-export const { createComp, useCompData } = createCompHooks({
|
|
|
- value: {},
|
|
|
- layout: {
|
|
|
- size: [750, 1200],
|
|
|
- },
|
|
|
- children: {
|
|
|
- img1: () =>
|
|
|
- createCompId("Image", {
|
|
|
- value: {
|
|
|
- url: require("@/assets/comps/Cover2/img_1.png"),
|
|
|
- x: 0,
|
|
|
- y: 0,
|
|
|
- s: 1,
|
|
|
- },
|
|
|
- layout: {
|
|
|
- size: [451, 1022],
|
|
|
- },
|
|
|
- }),
|
|
|
- img2: () =>
|
|
|
- createCompId("Image", {
|
|
|
- value: {
|
|
|
- url: require("@/assets/comps/Cover2/img_2.jpg"),
|
|
|
- },
|
|
|
- layout: {
|
|
|
- size: [167, 306],
|
|
|
- },
|
|
|
- }),
|
|
|
- img3: () =>
|
|
|
- createCompId("Image", {
|
|
|
- value: {
|
|
|
- url: require("@/assets/comps/Cover2/img_3.jpg"),
|
|
|
- },
|
|
|
- layout: {
|
|
|
- size: [167, 208],
|
|
|
- },
|
|
|
- }),
|
|
|
- title: () =>
|
|
|
- createCompId("Text", {
|
|
|
- value: `<p style="text-align:center;line-height:1.5;"><span style="color:hsl(0,0%,60%);font-size:42px;">NEW </span><span style="font-size:42px;"> FASHION</span></p>`,
|
|
|
- layout: {
|
|
|
- size: [750, 126],
|
|
|
- },
|
|
|
- }),
|
|
|
- text1: () =>
|
|
|
- createCompId("Text", {
|
|
|
- value: `<p style="line-height:1.5;"><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;"><strong>全新 时尚 </strong></span><span style="color:hsl(0,0%,0%);font-size:20px;"><strong>简约</strong></span></p>`,
|
|
|
- layout: {
|
|
|
- size: [380, 200],
|
|
|
- },
|
|
|
- }),
|
|
|
- text2: () =>
|
|
|
- createCompId("Text", {
|
|
|
- value: `<p style="text-align:right;line-height:1.5;"><span style="color:hsl(0, 0%, 0%);">2023新品</span></p>`,
|
|
|
- layout: {
|
|
|
- size: [380, 40],
|
|
|
- },
|
|
|
- }),
|
|
|
- },
|
|
|
-});
|
|
|
+const Cover2Value = {}
|
|
|
+
|
|
|
+export class CompCover2Obj extends DesignCompObj<typeof Cover2Value> {
|
|
|
+ value = RxValue.create({
|
|
|
+ ...Cover2Value
|
|
|
+ })
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ this.compKey = "Cover2";
|
|
|
+ this.layout.size = [750, 1200]
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export function createComp() {
|
|
|
+ const out = new CompCover2Obj();
|
|
|
+
|
|
|
+
|
|
|
+ const img1 = new CompImageObj();
|
|
|
+ img1.value.url = require("@/assets/comps/Cover2/img_1.png");
|
|
|
+ img1.layout.size = [451, 1022];
|
|
|
+
|
|
|
+
|
|
|
+ const img2 = new CompImageObj();
|
|
|
+ img2.value.url = require("@/assets/comps/Cover2/img_2.jpg")
|
|
|
+ img2.layout.size = [167, 306];
|
|
|
+
|
|
|
+ const img3 = new CompImageObj();
|
|
|
+ img3.value.url = require("@/assets/comps/Cover2/img_3.jpg")
|
|
|
+ img3.layout.size = [167, 208];
|
|
|
+
|
|
|
+ const tile = new CompTextObj();
|
|
|
+ tile.value.text = `<p style="text-align:center;line-height:1.5;"><span style="color:hsl(0,0%,60%);font-size:42px;">NEW </span><span style="font-size:42px;"> FASHION</span></p>`;
|
|
|
+ tile.layout.size = [750, 126];
|
|
|
+
|
|
|
+ //@ts-ignore
|
|
|
+ out.children.objs = [img1, img2, img3, tile];
|
|
|
+ //@ts-ignore
|
|
|
+ out.children.default = out.children.objs.map(item=>item.id);
|
|
|
+ return out;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const createCompCover2 = createComp;
|
|
|
+
|
|
|
+export {createCompCover2}
|
|
|
+
|
|
|
+// export const { createComp, useCompData } = createCompHooks({
|
|
|
+// value: {},
|
|
|
+// layout: {
|
|
|
+// size: [750, 1200],
|
|
|
+// },
|
|
|
+// children: {
|
|
|
+// title: () =>
|
|
|
+// createCompId("Text", {
|
|
|
+// value: `<p style="text-align:center;line-height:1.5;"><span style="color:hsl(0,0%,60%);font-size:42px;">NEW </span><span style="font-size:42px;"> FASHION</span></p>`,
|
|
|
+// layout: {
|
|
|
+// size: [750, 126],
|
|
|
+// },
|
|
|
+// }),
|
|
|
+// text1: () =>
|
|
|
+// createCompId("Text", {
|
|
|
+// value: `<p style="line-height:1.5;"><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;"><strong>全新 时尚 </strong></span><span style="color:hsl(0,0%,0%);font-size:20px;"><strong>简约</strong></span></p>`,
|
|
|
+// layout: {
|
|
|
+// size: [380, 200],
|
|
|
+// },
|
|
|
+// }),
|
|
|
+// text2: () =>
|
|
|
+// createCompId("Text", {
|
|
|
+// value: `<p style="text-align:right;line-height:1.5;"><span style="color:hsl(0, 0%, 0%);">2023新品</span></p>`,
|
|
|
+// layout: {
|
|
|
+// size: [380, 40],
|
|
|
+// },
|
|
|
+// }),
|
|
|
+// },
|
|
|
+// });
|
|
|
|
|
|
export const Form = createAttrsForm([]);
|