🆕 新增登录页入口, 调整预览框宽度, 添加在线编程入口

This commit is contained in:
xujiang 2020-10-09 19:44:52 +08:00
parent 99faabf228
commit 9dd415c930
4 changed files with 27 additions and 9 deletions

View File

@ -52,8 +52,8 @@ const Image = memo((props: IImageConfig) => {
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
marginLeft: translate[0],
marginTop: translate[1],
marginLeft: translate && translate[0],
marginTop: translate && translate[1],
textAlign: align,
}}
>

View File

@ -21,6 +21,7 @@
display: inline-block;
width: 50px;
height: 50px;
border-radius: 3px;
overflow: hidden;
background: url(../../../../assets/logo.png) no-repeat;
background-size: contain;
@ -32,7 +33,8 @@
text-align: center;
}
.btnArea {
width: 320px;
text-align: left;
width: 390px;
margin-left: 20px;
text-align: right;
}
}

View File

@ -9,11 +9,12 @@ import {
UndoOutlined,
RedoOutlined,
FileAddOutlined,
CodeOutlined,
SketchOutlined,
} from '@ant-design/icons';
import { history } from 'umi';
import QRCode from 'qrcode.react';
import { saveAs } from 'file-saver';
import Zan from 'components/Zan';
import req from '@/utils/req';
import Code from '@/assets/code.png';
import styles from './index.less';
@ -47,6 +48,14 @@ const HeaderComponent = memo((props: HeaderComponentProps) => {
}, 600);
};
const toOnlineCoding = () => {
window.open('/ide');
};
const toVipLogin = () => {
window.open('/login');
};
const content = () => {
const { tid } = location.query || '';
return (
@ -213,7 +222,7 @@ const HeaderComponent = memo((props: HeaderComponentProps) => {
<div className={styles.btnArea}>
<Select
defaultValue="h5"
style={{ width: 120, marginRight: 20 }}
style={{ width: 100, marginRight: 20 }}
onChange={e => {
setTheme(e);
}}
@ -221,7 +230,14 @@ const HeaderComponent = memo((props: HeaderComponentProps) => {
<Select.Option value="h5">h5模式</Select.Option>
<Select.Option value="pc">pc模式</Select.Option>
</Select>
<Zan />
<Button type="primary" ghost onClick={toOnlineCoding} style={{ marginRight: '12px' }}>
<CodeOutlined />
线
</Button>
<Button type="primary" ghost onClick={toVipLogin} style={{ marginRight: '12px' }}>
<SketchOutlined />
</Button>
</div>
</div>
);

View File

@ -60,7 +60,7 @@ const PreviewPage = memo((props: PreviewPageProps) => {
height: '684px',
overflow: 'auto',
position: 'relative',
transform: 'scale(0.6) translateY(-80px)',
transform: 'scale(0.7) translateY(-80px)',
};
}, [width]);
@ -93,7 +93,7 @@ const PreviewPage = memo((props: PreviewPageProps) => {
height: '840px',
width: '419px', //375+22+22
left: '50%',
transform: 'translate(-50%,-80px) scale(0.6)',
transform: 'translate(-50%,-80px) scale(0.7)',
boxShadow: '0 4px 30px 0 rgba(4, 59, 85, 0.1)',
borderRadius: '60px',
pointerEvents: 'none',