qinyan 1 year ago
parent
commit
84c0e8f58b

+ 37 - 30
src/modules/editor/components/CompUI/customUI/Cards/Card2/component.tsx

@@ -15,57 +15,64 @@ export const Component = createUIComp({
 
     return () => (
       <div class="relative">
-        <div class={upStyle}>
+        <div class="relative">
           <div class={style}>
             <Image.Component
               style={{
                 width: designToNaturalSize(750),
                 height: designToNaturalSize(464),
               }}
+              // class="h-5.3rem w-1/1"
               compId={children.bgImg}
             />
           </div>
-
-          <Image.Component
-            class="!absolute bottom-0 transform translate-x-1/4 translate-y-1/4 rounded-1/2 overflow-hidden"
+          <div
+            class="absolute bottom-0 w-1/1 pl-0.8rem pr-0.2rem flex items-end justify-between transform translate-y-1/3"
             style={{
-              width: designToNaturalSize(191),
               height: designToNaturalSize(191),
+              // marginBottom: designToNaturalSize(191 / 2),
             }}
-            compId={children.item1}
-          />
+          >
+            <Image.Component
+              class="rounded-1/2 overflow-hidden"
+              style={{
+                width: designToNaturalSize(191),
+                height: designToNaturalSize(191),
+                // marginTop: designToNaturalSize(191 / 3),
+              }}
+              compId={children.item1}
+            />
 
-          <Image.Component
-            class="!absolute transform rounded-1/2 overflow-hidden -translate-x-1/2 bottom-0 left-1/2"
-            style={{
-              width: designToNaturalSize(191),
-              height: designToNaturalSize(191),
-            }}
-            compId={children.item2}
-          />
+            <Image.Component
+              class="rounded-1/2 overflow-hidden"
+              style={{
+                width: designToNaturalSize(191),
+                height: designToNaturalSize(191),
+                marginBottom: designToNaturalSize(191 / 3),
+              }}
+              compId={children.item2}
+            />
 
-          <Image.Component
-            class="!absolute bottom-0 right-0 rounded-1/2 overflow-hidden transform -translate-x-24/100 -translate-y-1/3"
-            style={{
-              width: designToNaturalSize(191),
-              height: designToNaturalSize(191),
-            }}
-            compId={children.item3}
-          />
+            <Image.Component
+              class="rounded-1/2 overflow-hidden"
+              style={{
+                width: designToNaturalSize(191),
+                height: designToNaturalSize(191),
+                marginBottom: designToNaturalSize((191 / 3) * 2),
+              }}
+              compId={children.item3}
+            />
+          </div>
         </div>
-
-        <div class="absolute top-0 left-0">
+        <div class="absolute top-1rem left-0 z-1">
           <Text.Component compId={children.text1} />
         </div>
-
-        <Text.Component compId={children.text2} />
+        <Text.Component compId={children.text2} class="mt-0.3rem" />
       </div>
     );
   },
 });
-const upStyle = css`
-  position: relative;
-`;
+
 const style = css`
   background: gray;
   clip-path: polygon(0 0, 100% 0, 100% 57%, 0 100%);

+ 7 - 2
src/modules/editor/components/CompUI/customUI/Cards/Card2/index.tsx

@@ -16,8 +16,7 @@ export const options = {
 export const { createComp, useCompData } = createCompHooks({
   value: {},
   layout: {
-    padding: "0 0 0.2rem 0",
-    size: [750, 600],
+    size: [750, 550],
   },
   children: {
     bgImg: () =>
@@ -44,10 +43,16 @@ export const { createComp, useCompData } = createCompHooks({
     text1: () =>
       createCompId("Text", {
         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>`,
+        layout: {
+          size: [750, 200],
+        },
       }),
     text2: () =>
       createCompId("Text", {
         value: `<p style="text-align:right;"><span style="color:hsl(0, 0%, 0%);font-size:14px;">全新 &nbsp;| &nbsp;时尚 &nbsp;| &nbsp;简约 &nbsp;</span></p>`,
+        layout: {
+          size: [750, 40],
+        },
       }),
   },
 });

+ 7 - 1
src/modules/editor/components/CompUI/customUI/Covers/Cover2/index.ts

@@ -12,7 +12,7 @@ export const options = {
 export const { createComp, useCompData } = createCompHooks({
   value: {},
   layout: {
-    size: [750, 500],
+    size: [750, 1200],
   },
   children: {
     img1: () =>
@@ -55,10 +55,16 @@ export const { createComp, useCompData } = createCompHooks({
     text1: () =>
       createCompId("Text", {
         value: `<p><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>全新 &nbsp; &nbsp; 时尚 &nbsp; &nbsp;</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;"><span style="color:hsl(0, 0%, 0%);">2023新品</span></p>`,
+        layout: {
+          size: [380, 40],
+        },
       }),
   },
 });

+ 5 - 8
src/modules/editor/components/CompUI/customUI/index.ts

@@ -1,20 +1,17 @@
 // export * as Card from "./Cards/Card";
-export * as Card2 from "./Cards/Card2";
-export * as Card3 from "./Cards/Card3";
-export * as CardList from "./Cards/CardList";
-// export * as Card4 from "./Cards/Card4";
-export * as Card5 from "./Cards/Card5";
 export * as Cards11 from "./Cards/Card11";
 export * as Cards12 from "./Cards/Card12";
 export * as Cards13 from "./Cards/Card13";
 export * as Cards14 from "./Cards/Card14";
 export * as Cards15 from "./Cards/Card15";
-
+export * as Card2 from "./Cards/Card2";
+// export * as Card3 from "./Cards/Card3";
+// export * as Card4 from "./Cards/Card4";
+export * as Card5 from "./Cards/Card5";
+export * as CardList from "./Cards/CardList";
 export * as Cover from "./Covers/Cover";
 export * as Cover2 from "./Covers/Cover2";
-
 export * as Text1 from "./Texts/Text1";
-
 export * as Title1 from "./Titles/Title1";
 export * as Title2 from "./Titles/Title2";
 export * as Title3 from "./Titles/Title3";