:fixed: 调整pc/h5切换按钮位置 优化拖拽区域(PC)

This commit is contained in:
xujiang 2020-09-29 00:09:33 +08:00
parent b9219c9ebc
commit 2e07ec1414
7 changed files with 162 additions and 35 deletions

View File

@ -15,9 +15,7 @@ export default defineConfig({
base: '/',
publicPath: './',
outputPath: 'dist',
esbuild: {},
routes: [
{
exact: false,

View File

@ -24,6 +24,7 @@
"start": "umi dev",
"build": "umi build",
"server": "node server.js",
"test-demo": "http-server dist",
"postinstall": "umi generate tmp",
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
"test": "umi-test",
@ -62,6 +63,7 @@
"chatbot-antd": "^0.6.0",
"codemirror": "^5.57.0",
"file-saver": "^2.0.2",
"http-server": "^0.12.3",
"qrcode.react": "^1.0.0",
"react": "^16.12.0",
"react-codemirror2": "^7.2.1",

View File

@ -11,7 +11,7 @@ const content = (
export default memo(function ZanPao() {
return (
<div className={styles.takeCat}>
<div className={styles.takeCat} style={{ display: 'inline-block' }}>
<Popover placement="top" title={null} content={content} trigger="hover">
<Button type="primary" danger>

View File

@ -16,6 +16,7 @@ library.push(
<div>
<a href="https://github.com/MrXujiang">@徐小夕</a>
<a href="https://github.com/yehuozhili">@yehuozhili</a>
<a href="https://github.com/zhangjinlongll">@zhangjinlongll</a>
</div>
),
useReg: /(.*?)作者是谁(.*?)/,
@ -54,9 +55,32 @@ export default function Layout({ children }: IRouteComponentProps) {
onOk: () => setModalOpen(false),
onCancel: () => setModalOpen(false),
title: 'h5-Dooring机器人客服',
width: 400,
},
{},
<div>welcome!使h5-Dooring</div>,
<div>
welcome!使h5-Dooring
<div style={{ paddingTop: '10px', marginTop: '10px', borderTop: '1px solid #f0f0f0' }}>
<div>dooring指南</div>
<div>
<div>
&nbsp;&nbsp;1.{' '}
<a href="https://github.com/MrXujiang/h5-Dooring" target="_blank">
H5-Dooring源码地址
</a>
</div>
<div>
&nbsp;&nbsp;2.{' '}
<a href="https://github.com/MrXujiang/h5-Dooring/graphs/contributors" target="_blank">
</a>
</div>
<div style={{ fontSize: '12px' }}>
&nbsp;&nbsp;3. dooring开源交流群(Mr_xuxiaoxi)
</div>
</div>
</div>
</div>,
);
const [state, setState] = useState<dooringContextType>('h5');

View File

@ -234,7 +234,7 @@ const SourceBox = memo((props: SourceBoxProps) => {
<div className={styles.canvasBox2}>
<div
style={{
transform: `scale(${scaleNum - 0.2})`,
transform: `scale(${scaleNum - 0.35})`,
position: 'relative',
width: '100%',
height: '100%',
@ -248,22 +248,62 @@ const SourceBox = memo((props: SourceBoxProps) => {
}}
ref={drop}
>
<Tooltip placement="right" title="鼠标按住此处拖拽画布" visible={isShowTip}>
<div
className="js_box"
style={{
width: '10px',
height: '100%',
position: 'absolute',
borderRadius: '0 6px 6px 0',
backgroundColor: '#2f54eb',
right: '-10px',
top: '0',
color: '#fff',
cursor: 'move',
}}
/>
</Tooltip>
<div
className="js_box"
style={{
width: '100%',
height: '10px',
position: 'absolute',
borderRadius: '6px 6px 0 0',
backgroundColor: '#f0f0f0',
boxShadow: '3px 0 6px rgba(0,0,0,.1)',
top: '-10px',
color: '#fff',
cursor: 'move',
}}
/>
<div
className="js_box"
style={{
width: '100%',
height: '10px',
position: 'absolute',
borderRadius: '0 0 6px 6px',
backgroundColor: '#f0f0f0',
boxShadow: '3px 0 6px rgba(0,0,0,.1)',
bottom: '-10px',
color: '#fff',
cursor: 'move',
}}
/>
<div
className="js_box"
style={{
width: '10px',
height: '100%',
position: 'absolute',
borderRadius: '0 6px 6px 0',
backgroundColor: '#f0f0f0',
boxShadow: '3px 0 6px rgba(0,0,0,.1)',
right: '-10px',
color: '#fff',
cursor: 'move',
}}
/>
<div
className="js_box"
style={{
width: '10px',
height: '100%',
position: 'absolute',
borderRadius: '6px 0 0 6px',
backgroundColor: '#f0f0f0',
boxShadow: '0 0 6px rgba(0,0,0,.1)',
left: '-10px',
color: '#fff',
cursor: 'move',
}}
/>
{cpointData.length > 0 ? (
<GridLayout

View File

@ -212,17 +212,17 @@ const HeaderComponent = memo((props: HeaderComponentProps) => {
</Button>
</div>
<Select
defaultValue="h5"
style={{ width: 120 }}
onChange={e => {
setTheme(e);
}}
>
<Select.Option value="h5">h5模式</Select.Option>
<Select.Option value="pc">pc模式</Select.Option>
</Select>
<div className={styles.btnArea}>
<Select
defaultValue="h5"
style={{ width: 120, marginRight: 20 }}
onChange={e => {
setTheme(e);
}}
>
<Select.Option value="h5">h5模式</Select.Option>
<Select.Option value="pc">pc模式</Select.Option>
</Select>
<Zan />
</div>
</div>

View File

@ -3851,6 +3851,11 @@ base@^0.11.1:
mixin-deep "^1.2.0"
pascalcase "^0.1.1"
basic-auth@^1.0.3:
version "1.1.0"
resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-1.1.0.tgz#45221ee429f7ee1e5035be3f51533f1cdfd29884"
integrity sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=
bcrypt-pbkdf@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e"
@ -4617,6 +4622,11 @@ colors@1.0.3:
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
integrity sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=
colors@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
combined-stream@^1.0.6, combined-stream@~1.0.6:
version "1.0.8"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
@ -4867,6 +4877,11 @@ core-util-is@1.0.2, core-util-is@~1.0.0:
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
corser@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/corser/-/corser-2.0.1.tgz#8eda252ecaab5840dcd975ceb90d9370c819ff87"
integrity sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=
cosmiconfig@^5.0.0, cosmiconfig@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.2.1.tgz#040f726809c591e77a17c0a3626ca45b4f168b1a"
@ -5679,6 +5694,16 @@ ecc-jsbn@~0.1.1:
jsbn "~0.1.0"
safer-buffer "^2.1.0"
ecstatic@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/ecstatic/-/ecstatic-3.3.2.tgz#6d1dd49814d00594682c652adb66076a69d46c48"
integrity sha512-fLf9l1hnwrHI2xn9mEDT7KIi22UDqA2jaCwyCbSUJh9a1V+LEUSL/JO/6TIz/QyuBURWUHrFL5Kg2TtO1bkkog==
dependencies:
he "^1.1.1"
mime "^1.6.0"
minimist "^1.1.0"
url-join "^2.0.5"
ee-first@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
@ -7099,6 +7124,11 @@ hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7:
inherits "^2.0.3"
minimalistic-assert "^1.0.1"
he@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
hex-color-regex@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
@ -7286,7 +7316,7 @@ http-proxy-middleware@1.0.5:
lodash "^4.17.19"
micromatch "^4.0.2"
http-proxy@^1.18.1:
http-proxy@^1.18.0, http-proxy@^1.18.1:
version "1.18.1"
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
@ -7295,6 +7325,22 @@ http-proxy@^1.18.1:
follow-redirects "^1.0.0"
requires-port "^1.0.0"
http-server@^0.12.3:
version "0.12.3"
resolved "https://registry.yarnpkg.com/http-server/-/http-server-0.12.3.tgz#ba0471d0ecc425886616cb35c4faf279140a0d37"
integrity sha512-be0dKG6pni92bRjq0kvExtj/NrrAd28/8fCXkaI/4piTwQMSDSLMhWyW0NI1V+DBI3aa1HMlQu46/HjVLfmugA==
dependencies:
basic-auth "^1.0.3"
colors "^1.4.0"
corser "^2.0.1"
ecstatic "^3.3.2"
http-proxy "^1.18.0"
minimist "^1.2.5"
opener "^1.5.1"
portfinder "^1.0.25"
secure-compare "3.0.1"
union "~0.5.0"
http-signature@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
@ -9356,7 +9402,7 @@ mime-types@^2.1.12, mime-types@^2.1.18, mime-types@^2.1.26, mime-types@~2.1.19,
dependencies:
mime-db "1.44.0"
mime@1.6.0, mime@^1.4.1:
mime@1.6.0, mime@^1.4.1, mime@^1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1"
integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==
@ -9416,7 +9462,7 @@ minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"
minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5:
minimist@^1.1.0, minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
@ -10348,7 +10394,7 @@ portfinder@1.0.26:
debug "^3.1.1"
mkdirp "^0.5.1"
portfinder@1.0.28:
portfinder@1.0.28, portfinder@^1.0.25:
version "1.0.28"
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==
@ -12754,6 +12800,11 @@ seamless-immutable@^7.1.3:
resolved "https://registry.yarnpkg.com/seamless-immutable/-/seamless-immutable-7.1.4.tgz#6e9536def083ddc4dea0207d722e0e80d0f372f8"
integrity sha512-XiUO1QP4ki4E2PHegiGAlu6r82o5A+6tRh7IkGGTVg/h+UoeX4nFBeCGPOhb4CYjvkqsfm/TUtvOMYC1xmV30A==
secure-compare@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/secure-compare/-/secure-compare-3.0.1.tgz#f1a0329b308b221fae37b9974f3d578d0ca999e3"
integrity sha1-8aAymzCLIh+uN7mXTz1XjQypmeM=
select-hose@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
@ -14071,6 +14122,13 @@ union-value@^1.0.0:
is-extendable "^0.1.1"
set-value "^2.0.1"
union@~0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/union/-/union-0.5.0.tgz#b2c11be84f60538537b846edb9ba266ba0090075"
integrity sha512-N6uOhuW6zO95P3Mel2I2zMsbsanvvtgn6jVqJv4vbVcz/JN0OkL9suomjQGmWtxJQXOCqUJvquc1sMeNz/IwlA==
dependencies:
qs "^6.4.0"
uniq@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff"
@ -14140,6 +14198,11 @@ urix@^0.1.0:
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=
url-join@^2.0.5:
version "2.0.5"
resolved "https://registry.yarnpkg.com/url-join/-/url-join-2.0.5.tgz#5af22f18c052a000a48d7b82c5e9c2e2feeda728"
integrity sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=
url-loader@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/url-loader/-/url-loader-4.1.0.tgz#c7d6b0d6b0fccd51ab3ffc58a78d32b8d89a7be2"