Эх сурвалжийг харах

Merge branch 'dev' of http://124.70.149.18:10880/lianghj/queenshow into dev

liwei 1 жил өмнө
parent
commit
190490aba7

+ 2 - 2
src/modules/editor/components/CompUI/basicUI/View.tsx

@@ -86,7 +86,7 @@ export const Hudop = defineComponent({
     });
 
     return () => (
-      <div class="hudop" ref={opref}>
+      <div class="hudop shadow" ref={opref}>
         {store.streamCardIds.length > 1 && (
           <IconMove
             class="draganchor"
@@ -135,10 +135,10 @@ const viewStyle = css`
     width: 28px;
     align-items: center;
     border-radius: 4px;
+    z-index: 997;
     .inficon {
       padding: 8px;
     }
-    z-index: 999;
   }
 `;
 

+ 1 - 1
src/modules/editor/components/CompUI/customUI/Cards/Card11/index.ts

@@ -22,7 +22,7 @@ export const { createComp, useCompData, useCreateChild } = createCompHooks({
       createCompId("Text", {
         value: `<p><span style="color:hsl(0, 0%, 30%);font-size:12px;">皮中贵族,触及之处皆舒适,柔韧度高的细腻肌理皮革,触感柔润亲肤,透气</span></p><p><span style="color:hsl(0, 0%, 30%);font-size:12px;">质量经久耐磨,性价比高, 经典之作用不过时。 </span></p>`,
         layout: {
-          textAlign: "center",
+          size: [370, 300],
         },
       }),
     img1: () =>

+ 5 - 3
src/modules/editor/components/CompUI/customUI/Cards/Card13/component.tsx

@@ -18,9 +18,11 @@ export const Component = createUIComp({
             class="w-2.74rem h-2.56rem object-cover"
           />
         </div>
-        <div class="flex-1 mt-1rem py-0.58rem px-0.2rem mb-1.3rem border-2px border-black border-solid leading-loose">
-          <Text.Component compId={children.text} />
-        </div>
+
+        <Text.Component
+          class="flex-1 mt-1rem py-0.58rem mb-1.3rem border-2px border-black border-solid leading-loose"
+          compId={children.text}
+        />
         <div class="absolute bottom-0.1rem left-0.35rem">
           <Image.Component
             compId={children.imgShoe}

+ 1 - 1
src/modules/editor/components/CompUI/customUI/Cards/Card13/index.ts

@@ -19,7 +19,7 @@ export const { createComp, useCompData } = createCompHooks({
       createCompId("Text", {
         value: `<p style="text-align:center;">两面开边珠,无漆皮光亮&nbsp;</p><p style="text-align:center;">却比漆皮更耐用,不容易爆皮&nbsp;</p><p style="text-align:center;">逛着干看起来更加高档&nbsp;</p><p style="text-align:center;">丰富多彩的流行色水,增加无限魅力</p><p style="text-align:center;">既有复古的韵味更有时下的潮流元素</p>`,
         layout: {
-          textAlign: "center",
+          size: [390, 420],
         },
       }),
     img1: () =>

+ 7 - 4
src/modules/editor/components/CompUI/customUI/Cards/Card14/component.tsx

@@ -11,7 +11,7 @@ export const Component = createUIComp({
     const { children } = useCompData(props.compId);
 
     return () => (
-      <div class="pt-0.2rem px-0.35rem">
+      <div class="pt-0.2rem px-0.68rem pr-0.35rem">
         <div class="flex justify-end relative pb-0.22rem  z-10">
           <div class="absolute left-0 bottom-0 z-10">
             <Image.Component
@@ -24,9 +24,12 @@ export const Component = createUIComp({
             class="w-4rem h-3.3rem object-cover"
           />
         </div>
-        <div class="relative mr-0.24rem -mt-0.6rem border-2px border-solid border-dark-400 pt-1rem pb-0.5rem leading-loose">
-          <div class="absolute -right-5px top-0 w-10px h-1rem bg-white"></div>
-          <Text.Component compId={children.text} />
+        <div class="relative">
+          <div class="absolute right-7px top-0 w-10px h-1rem bg-white z-1"></div>
+          <Text.Component
+            compId={children.text}
+            class="-mt-0.6rem border-2px border-solid border-dark-400 pt-1rem pb-0.5rem leading-loose"
+          />
         </div>
       </div>
     );

+ 1 - 1
src/modules/editor/components/CompUI/customUI/Cards/Card14/index.ts

@@ -19,7 +19,7 @@ export const { createComp, useCompData } = createCompHooks({
       createCompId("Text", {
         value: `<p style="text-align:center;"><span style="color:hsl( 0, 0%, 40% );font-size:12px;">蓝色是个舒服的颜色,</span></p><p style="text-align:center;"><span style="color:hsl( 0, 0%, 40% );font-size:12px;">&nbsp;处处充满着生机和希望,</span></p><p style="text-align:center;"><span style="color:hsl( 0, 0%, 40% );font-size:12px;">&nbsp;其明净空旷往往让人迷失其中,&nbsp;</span></p><p style="text-align:center;"><span style="color:hsl( 0, 0%, 40% );font-size:12px;">给人无限的对未来的憧憬,&nbsp;</span></p><p style="text-align:center;"><span style="color:hsl( 0, 0%, 40% );font-size:12px;">不需要过多的言语,让心灵感到平和</span></p>`,
         layout: {
-          textAlign: "center",
+          size: [622, 360],
         },
       }),
     img1: () =>

+ 2 - 0
src/modules/editor/components/CompUI/customUI/Titles/Title1/index.ts

@@ -24,6 +24,7 @@ export const { createComp, useCompData } = createCompHooks({
         value: `<p style="text-align:center;"><span style="color:hsl(0, 0%, 0%);font-size:28px;">我的风格我选择</span></p>`,
         layout: {
           textAlign: "center",
+          size: [750, 100],
         },
       }),
     subTitle: () =>
@@ -32,6 +33,7 @@ export const { createComp, useCompData } = createCompHooks({
         layout: {
           textAlign: "center",
           margin: "0.1rem auto 0",
+          size: [260, 60],
         },
       }),
   },

+ 25 - 14
src/modules/editor/module/actions/edit.ts

@@ -16,26 +16,37 @@ export const editActions = EditorModule.action({
       this.store.currStreamCard.$el
     );
     const { currComp } = this.store;
-    let selCtrl = this.controls.selectCtrl
-    selCtrl.translate(this.helper.designSizeToPx(375 - (currComp.layout.size?.[0] || 750) / 2), cardPoints.y);
+    let selCtrl = this.controls.selectCtrl;
+    selCtrl.translate(
+      this.helper.designSizeToPx(375 - (currComp.layout.size?.[0] || 750) / 2),
+      cardPoints.y
+    );
     this.helper.extendStreamCard(this.store.currStreamCardId);
-
   },
   // 通过点击添加组件到画布
   async clickCompToDesign(compKey: ICompKeys, cb?: (comp: DesignComp) => void) {
-
     //点击默认都创建一个容器
     //创建容器
-    const isCreatCard =  compKey != "Text" && compKey != "Image" && compKey != "Video" && compKey != "Web3D";
+    const isCreatCard =
+      compKey != "Text" &&
+      compKey != "Image" &&
+      compKey != "Video" &&
+      compKey != "Web3D";
 
     let yOffset = 0;
-    if (this.store.currCompId != this.store.currStreamCardId && !isCreatCard) {
+    if (
+      this.store.currCompId != this.store.currStreamCardId &&
+      !isCreatCard &&
+      this.store.currCompId != "root"
+    ) {
       const bound = this.helper.getCardCompBound(this.store.currCompId);
-        yOffset = bound.y + bound.h
+      yOffset = bound.y + bound.h;
     }
 
-    if (isCreatCard) { //先创建卡片
-      const index = this.store.streamCardIds.indexOf(this.store.currStreamCardId) + 1;
+    if (isCreatCard) {
+      //先创建卡片
+      const index =
+        this.store.streamCardIds.indexOf(this.store.currStreamCardId) + 1;
       const compId = await this.store.insertDesignContent("Container", index);
       this.actions.pickComp(compId);
     }
@@ -45,7 +56,9 @@ export const editActions = EditorModule.action({
 
     //添加组件到当前选中的组件下面
     const selectCtrl = this.controls.selectCtrl;
-    let xOffset = this.helper.designSizeToPx(375 - (currComp.layout.size?.[0] || 750) / 2);
+    let xOffset = this.helper.designSizeToPx(
+      375 - (currComp.layout.size?.[0] || 750) / 2
+    );
     selectCtrl.translate(xOffset, yOffset);
     selectCtrl.selecteObjs([]);
 
@@ -53,8 +66,6 @@ export const editActions = EditorModule.action({
     this.helper.extendStreamCard(this.store.currStreamCardId);
   },
 
-  
-
   // 添加组件到画布
   async addCompToDesign(compKey: ICompKeys, index?: number) {
     if (!this.store.currStreamCardId) {
@@ -73,10 +84,10 @@ export const editActions = EditorModule.action({
       compKey,
       this.store.currStreamCard
     );
-    const addedComp = this.store.compMap[compId]
+    const addedComp = this.store.compMap[compId];
     this.actions.setCompPositionFloat(addedComp);
 
-    this.controls.selectCtrl.selecteObjs([new CompObject(addedComp)])
+    this.controls.selectCtrl.selecteObjs([new CompObject(addedComp)]);
   },
 
   // 切换当前组件