Sfoglia il codice sorgente

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

bianjiang 1 anno fa
parent
commit
7e55658c31

+ 1 - 1
package.json

@@ -26,7 +26,7 @@
     "@ckeditor/ckeditor5-theme-lark": "^38.0.0",
     "@ckeditor/ckeditor5-vue": "^5.1.0",
     "@linaria/core": "^4.1.1",
-    "@queenjs-modules/auth": "^0.0.18",
+    "@queenjs-modules/auth": "^0.0.19",
     "@queenjs-modules/queditor": "0.0.13",
     "@queenjs-modules/queentree": "^0.0.10",
     "@queenjs-modules/queentree-explorer": "^0.0.6",

+ 4 - 4
src/modules/editor/components/CompUI/basicUI/Transfer/select.tsx

@@ -97,7 +97,7 @@ export const SelectTransfer = defineComponent({
             <>
               
               {
-                !isTextEdit &&  <div
+                <div
                   class={[resizeStyle, scaleBottomRightStyle]}
                   style={{ transform: transferStyle.matrixInvert }}
                   id="scaleBottomright"
@@ -105,7 +105,7 @@ export const SelectTransfer = defineComponent({
               }
 
                 {
-                  !isTextEdit &&   <div
+                    <div
                     class={[resizeStyle, scaleBottomLeftStyle]}
                     style={{ transform: transferStyle.matrixInvert }}
                     id="scaleBottomleft"
@@ -113,14 +113,14 @@ export const SelectTransfer = defineComponent({
                 }
 
               {
-                  !isTextEdit &&<div
+                  <div
                   class={[resizeStyle, scaleTopLeftStyle]}
                   style={{ transform: transferStyle.matrixInvert }}
                   id="scaleTopleft"
                 />
               }
               {
-                  !isTextEdit && <div
+                <div
                   class={[resizeStyle, scaleTopRightStyle]}
                   style={{ transform: transferStyle.matrixInvert }}
                   id="scaleTopright"

+ 30 - 10
src/modules/editor/controllers/SelectCtrl/index.ts

@@ -15,8 +15,8 @@ import { indexOf } from "lodash";
 const MODE_SEL_RECT = 1;
 const MODE_MOVING = 2;
 const MODE_ROTATE = 3;
-const MODE_SCALE = 4;
-
+const MODE_SCALE_WIDTH = 4;
+const MODE_SCALE_SCALE = 5;
 const MODE_NONE = 0;
 
 export class SelectCtrl extends ModuleControl<EditorModule> {
@@ -190,7 +190,13 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
     } else if (this._mouseDownFlag.indexOf("move") > -1) {
       this._state = MODE_MOVING;
     } else if (this._mouseDownFlag.indexOf("scale") > -1) {
-      this._state = MODE_SCALE;
+      this._state = MODE_SCALE_WIDTH;
+      if (this.store.selected.length == 1 && this.store.currComp.compKey == "Text") {//拖拽的是文本
+          const scaleFlags = ["scaleBottomright", "scaleBottomleft", "scaleTopleft", "scaleTopright"]
+          if (scaleFlags.indexOf(this._mouseDownFlag) > -1 ) {
+            this._state = MODE_SCALE_SCALE;
+          }
+      }
     }
 
     this._movePreClientX = this._downClientX;
@@ -356,7 +362,8 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
       case MODE_ROTATE:
         this.rotateMousemove(e);
         break;
-      case MODE_SCALE:
+      case MODE_SCALE_WIDTH:
+      case MODE_SCALE_SCALE:
         this.scaleMousemove(e);
     }
 
@@ -403,7 +410,7 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
 
     if (this._state == MODE_ROTATE) {
       this.rotateMouseUp(e);
-    } else if (this._state == MODE_SCALE) {
+    } else if (this._state == MODE_SCALE_WIDTH || this._state == MODE_SCALE_SCALE) {
       this.scaleMouseUp(e);
     } else if (this._state == MODE_MOVING) {
       this.moveMouseUp(e, isClick);
@@ -829,8 +836,12 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
       if (i == -1) {
         this.lastScale.x = dtaScale * this.initScale.x;
         this.lastScale.y = dtaScale * this.initScale.y;
-        // objContainer.scale(this.lastScale.x, this.lastScale.y);
-        objContainer.scaleSize(this.lastScale.x, this.lastScale.y);
+
+        if (this._state == MODE_SCALE_SCALE) {
+          objContainer.scale(this.lastScale.x, this.lastScale.y);
+        } else {
+          objContainer.scaleSize(this.lastScale.x, this.lastScale.y);
+        }
       } else if (i == 0 || i == 1) {
         this.lastScale.x = dtaScale * this.initScale.x;
         // objContainer.scaleX(this.lastScale.x);
@@ -854,13 +865,18 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
 
       const history = this.controls.historyCtrl.history;
       this.objContainer?.setPivot(0);
+      const scaleMode = this._state;
 
       history.record({
         undo: () => {
           console.log("undo ");
-
+         
           this.objContainer?.setPivot(scaleIndex);
-          this.objContainer?.scaleSize(preScale.x, preScale.y);
+          if (scaleMode == MODE_SCALE_WIDTH) {
+            this.objContainer?.scaleSize(preScale.x, preScale.y);
+          } else {
+            this.objContainer?.scale(preScale.x, preScale.y);
+          }
           this.objContainer?.setPivot(0);
           this.objContainer?.updateCompState();
 
@@ -870,7 +886,11 @@ export class SelectCtrl extends ModuleControl<EditorModule> {
         redo: () => {
           console.log("redo ");
           this.objContainer?.setPivot(scaleIndex);
-          this.objContainer?.scaleSize(lastScale.x, lastScale.y);
+          if (scaleMode == MODE_SCALE_WIDTH) {
+            this.objContainer?.scaleSize(lastScale.x, lastScale.y);
+          } else {
+            this.objContainer?.scale(lastScale.x, lastScale.y);
+          }
           this.objContainer?.setPivot(0);
           this.objContainer?.updateCompState();
           this.upgateGizmoStyle();

+ 3 - 3
src/pages/website/Promotion2/components/PromotionItem.tsx

@@ -1,7 +1,7 @@
 import { css, cx } from "@linaria/core";
 import { IconMore } from "@queenjs/icons";
 import { Image, View } from "@queenjs/ui";
-import { Dropdown, Menu } from "ant-design-vue";
+import { Divider, Dropdown, Menu } from "ant-design-vue";
 import dayjs from "dayjs";
 import { defineUI } from "queenjs";
 import { any } from "vue-types";
@@ -79,8 +79,8 @@ export default defineUI({
               <div class="flex items-center text-opacity-60 text-white text-12px mt-5px">
                 {dayjs(record.updateTime).format("YYYY.MM.DD")}
                 {/* 发布 */}
-                {/* <Divider type="vertical"></Divider>
-                0次浏览 */}
+                <Divider type="vertical"></Divider>
+                 {record.views || 0 } 次浏览
               </div>
             </div>
             <Dropdown

+ 3 - 1
src/pages/website/Promotion2/controller.tsx

@@ -39,7 +39,9 @@ export function createPromotinController(
     resource.showModal(
       <ShareModal record={record} controller={ctrl}>
         {{
-          preview: () => <editor.components.Preview />,
+          preview: () => (
+            <editor.components.Preview class="pointer-events-none" />
+          ),
         }}
       </ShareModal>,
       {

+ 0 - 112
src/pages/website/Settings/ResetForm.tsx

@@ -1,112 +0,0 @@
-import { useAuth } from "@queenjs-modules/auth";
-import { CaptchaInput } from "@queenjs-modules/auth/components/components/captcha";
-import { Button, Form, Input } from "ant-design-vue";
-import { queenApi } from "queenjs";
-import { defineComponent, reactive } from "vue";
-
-const layout = {
-  wrapperCol: { span: 24 },
-};
-const tailLayout = {
-  wrapperCol: { span: 24 },
-};
-
-export default defineComponent({
-  emits: ["success"],
-  setup(props, { emit }) {
-    const auth = useAuth();
-
-    const state = reactive({
-      loading: false,
-    });
-
-    const formState = reactive({
-      phone: "",
-      code: "",
-      password: "",
-      rePwd: "",
-    });
-
-    const rules = reactive({
-      phone: [{ required: true, message: "手机号不能为空", trigger: "change" }],
-      code: [{ required: true, message: "验证码不能为空", trigger: "change" }],
-      password: [
-        { required: true, message: "密码不能为空", trigger: "change" },
-      ],
-      rePwd: [{ required: true, message: "请确认密码", trigger: "change" }],
-    });
-
-    const { validate, validateInfos } = Form.useForm(formState, rules);
-
-    const submit = async () => {
-      try {
-        state.loading = true;
-        const { rePwd, ...formData } = await validate();
-        if (rePwd !== formData.password) {
-          queenApi.messageError("输入密码不一致!");
-          return;
-        }
-        await auth.actions.resetPassword(formData);
-        emit("success");
-      } finally {
-        state.loading = false;
-      }
-    };
-
-    function getCodeByClick() {
-      return auth.actions.getSmsCode({
-        phone: formState.phone,
-        use: "resetPasswd",
-      });
-    }
-
-    return () => (
-      <Form {...layout} name="basic">
-        <Form.Item name="phone" {...validateInfos.phone}>
-          <Input
-            placeholder="请输入手机号码"
-            v-model={[formState.phone, "value"]}
-            maxlength={30}
-          />
-        </Form.Item>
-        <Form.Item name="code" {...validateInfos.code}>
-          <CaptchaInput
-            disabled={!/^1[3456789]\d{9}$/.test(formState.phone)}
-            value={formState.code}
-            onChange={(v) => (formState.code = v)}
-            onGetCode={getCodeByClick}
-          />
-        </Form.Item>
-        <Form.Item name="password" {...validateInfos.password}>
-          <Input
-            type="password"
-            placeholder="请设置密码"
-            v-model={[formState.password, "value"]}
-            maxlength={12}
-          />
-        </Form.Item>
-        <Form.Item name="rePwd" {...validateInfos.rePwd}>
-          <Input
-            type="password"
-            placeholder="再次确认密码"
-            v-model={[formState.rePwd, "value"]}
-            maxlength={12}
-          />
-        </Form.Item>
-        <Form.Item {...tailLayout}>
-          <Button
-            htmlType="submit"
-            block
-            type="primary"
-            size="large"
-            shape="round"
-            loading={state.loading}
-            onClick={submit}
-          >
-            修改密码
-          </Button>
-        </Form.Item>
-      </Form>
-    );
-  },
-});

+ 0 - 22
src/pages/website/Settings/ResetPassModal.tsx

@@ -1,22 +0,0 @@
-import { useModal } from "queenjs";
-import { defineComponent } from "vue";
-import ResetForm from "./ResetForm";
-import { useAuth } from "@queenjs-modules/auth";
-
-export default defineComponent({
-  setup() {
-    const modal = useModal();
-    const auth = useAuth();
-
-    return () => {
-      return (
-        <ResetForm
-          onSuccess={() => {
-            modal.cancel();
-            auth.actions.logout();
-          }}
-        />
-      );
-    };
-  },
-});

+ 16 - 6
src/pages/website/Settings/index.tsx

@@ -1,20 +1,30 @@
+import { useAuth } from "@queenjs-modules/auth";
+import ResetForm from "@queenjs-modules/auth/components/components/ResetForm";
 import { IconLock } from "@queenjs/icons";
 import { Button, Tabs } from "ant-design-vue";
 import { queenApi } from "queenjs";
+import Modal from "queenjs/adapter/vue/components/modal";
 import { defineComponent } from "vue";
-import ResetPassModal from "./ResetPassModal";
 
 const options = ["账户与安全"];
 
 export default defineComponent({
   setup() {
-    // const modal = useModal();
+    const auth = useAuth();
 
     const showModal = () => {
-      queenApi.dialog(<ResetPassModal />, {
-        width: "400px",
-        title: "修改密码",
-      });
+      queenApi.dialog(
+        <ResetForm
+          onSuccess={() => {
+            Modal.clear();
+            auth.actions.logout();
+          }}
+        />,
+        {
+          width: "400px",
+          title: "修改密码",
+        }
+      );
     };
 
     return () => (

+ 2 - 1
src/pages/website/components/layout/LeftContent.tsx

@@ -12,6 +12,7 @@ import { defineComponent } from "vue";
 import { array, object } from "vue-types";
 import Logo from "./Logo";
 import { UserController } from "./UserController";
+import dayjs from "dayjs";
 
 export default defineUI({
   props: {
@@ -64,7 +65,7 @@ export default defineUI({
             <div class="ml-20px flex-1">
               <p class="mb-10px text-16px font-bold">{userInfo.name}</p>
               <div class="text-12px text-gray" style={{color:"#E88B00"}}>
-                { "免费版(限3个推广)" }
+                {userInfo.saas? "VIP 到期时间:" + dayjs(userInfo.saas.Exp).format("YYYY.MM.DD") :  "免费版(限3个推广)" }
               </div>
             </div>
           </div>

+ 4 - 4
yarn.lock

@@ -1736,10 +1736,10 @@
   resolved "http://124.70.149.18:4873/@polka%2furl/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1"
   integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==
 
-"@queenjs-modules/auth@^0.0.18":
-  version "0.0.18"
-  resolved "http://124.70.149.18:4873/@queenjs-modules%2fauth/-/auth-0.0.18.tgz#48a7abd1023cee213cbfdd1b822e52041a070818"
-  integrity sha512-zQGPz1GUR2QE3qCkfpdQ3vDkNNuFRhvrD+ErCynnlDP/QQNgvOoHizPEO5OE4VzdBu+/psGWymQs+9zONGuO3A==
+"@queenjs-modules/auth@^0.0.19":
+  version "0.0.19"
+  resolved "http://124.70.149.18:4873/@queenjs-modules%2fauth/-/auth-0.0.19.tgz#2235626d3a628e3a359ef56c3b003b2cb8f3f9c2"
+  integrity sha512-4t7YAhDqy2JRrUMhUbV1PTGZvZjOcUp2dUFZcVHKT/+1l04qkzn4qOnINGxxGr2Dejmcuz9piEXYkQ/gWDPj3Q==
 
 "@queenjs-modules/queditor@0.0.13":
   version "0.0.13"