diff --git a/src/pages/user/index.less b/src/pages/user/index.less new file mode 100644 index 0000000..9a48e1a --- /dev/null +++ b/src/pages/user/index.less @@ -0,0 +1,66 @@ +.wrap { + display: flex; + flex-direction: column; + .header { + position: relative; + z-index: 10; + padding-left: 30px; + padding-right: 30px; + display: flex; + align-items: center; + height: 42px; + background: #fff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + .logoArea { + display: contents; + width: 300px; + font-size: 18px; + color: #2f54eb; + .backBtn { + display: inline-block; + padding: 12px 10px; + margin-right: 22px; + cursor: pointer; + } + .logo { + display: flex; + overflow: hidden; + border-radius: 3px; + vertical-align: middle; + img { + width: 108px; + height: auto; + max-width: 100%; + max-height: 100%; + } + } + .logoText { + margin-left: 12px; + margin-top: 5px; + } + } + .operationBar { + margin-left: auto; + } + } +} +.contentWrap { + display: flex; +} +.codeWrap { + width: calc(100vw - 440px); + min-height: 560px; + height: 100%; +} +:global(.cm-s-material.CodeMirror) { + height: 100%; +} +.previewWrap { + margin: 0 30px; + margin-top: 30px; + width: 375px; + min-width: 375px; + overflow: auto; + border: 12px solid #000; + border-radius: 20px; +} diff --git a/src/pages/user/index.tsx b/src/pages/user/index.tsx new file mode 100644 index 0000000..10b315d --- /dev/null +++ b/src/pages/user/index.tsx @@ -0,0 +1,202 @@ +import React, { useMemo } from "react"; +import { Controlled } from "react-codemirror2"; +import { useState } from "react"; +import { Button, message } from "antd"; +import { saveAs } from "file-saver"; +import Logo from "@/assets/logo.png"; +import styles from "./index.less"; +import { isDev, useGetRect } from "utils/tool"; +import { SaveOutlined } from "@ant-design/icons"; +import { useHotkeys } from "react-hotkeys-hook"; +require("codemirror/mode/xml/xml"); +require("codemirror/mode/javascript/javascript"); + +const serverUrl = isDev ? "http://localhost:3000" : "http://localhost:3000"; + +let html = ` + +
+ + +
+ + (H5编辑器)H5-Dooring是一款功能强大,开源免费的H5可视化页面配置解决方案, + 致力于提供一套简单方便、专业可靠、无限可能的H5落地页最佳实践。 +
+