fix: 页面布局

master
xjs 2025-04-10 13:08:34 +08:00
parent efc56ca61f
commit 691c0c39ec
7 changed files with 4 additions and 472 deletions

View File

@ -1,129 +0,0 @@
/**
* Copyright 2025 Beijing Volcano Engine Technology Co., Ltd. All Rights Reserved.
* SPDX-license-identifier: BSD-3-Clause
*/
.wrapper {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
.placeholder {
font-size: 14px;
font-weight: 400;
line-height: 22px;
color: var(--text-color-text-3, rgba(115, 122, 135, 1));
}
.box {
margin-right: 16px;
}
.seeMore {
display: flex;
padding: 6px 12px;
justify-content: center;
align-items: center;
gap: var(--border-radius-small, 4px);
border-radius: 6px;
background: linear-gradient(96deg, rgba(22, 100, 255, 0.10) 0%, rgba(128, 64, 255, 0.10) 97.7%);
.seeMoreText {
font-family: "PingFang SC";
font-size: 13px;
font-style: normal;
font-weight: 500;
line-height: 22px; /* 169.231% */
letter-spacing: 0.039px;
background: var(--Linear, linear-gradient(90deg, #004FFF 38.86%, #9865FF 100%));
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
}
:global {
.ant-modal-content {
border-radius: 8px;
}
.ant-modal-footer {
border-top: 0px;
}
.ant-modal-body {
padding-top: 8px;
padding-bottom: 16px;
}
.ant-modal-header {
border-bottom: 0px;
border-radius: 8px;
}
}
.footer {
width: calc(100% - 12px);
display: flex;
flex-direction: row;
justify-content: flex-end;
align-items: center;
gap: 12px;
.cancel {
width: 88px;
height: 32px;
border-radius: 6px;
border: 1px solid var(--line-color-border-3, rgba(221, 226, 233, 1))
}
.confirm {
width: 88px;
height: 32px;
border-radius: 6px;
background: linear-gradient(95.87deg, #1664FF 0%, #8040FF 97.7%);
color: white !important;
}
.confirm:hover {
opacity: .8;
}
.confirm:active {
opacity: 1;
}
}
.modalInner {
width: 100%;
// max-height: 500px;
display: flex;
flex: row;
flex-wrap: wrap;
overflow: auto;
gap: 12px;
}
.modal {
// max-height: 650px;
overflow: hidden;
}
.modalInner::-webkit-scrollbar {
width: 8px;
height: 8px;
border-radius: 5px;
}
.modalInner::-webkit-scrollbar-thumb {
background: rgb(205, 204, 204);
border-radius: 0px;
border-radius: 5px;
}
.modalInner::-webkit-scrollbar-track {
background: rgb(255, 255, 255);
border-radius: 0px;
}

View File

@ -1,103 +0,0 @@
/**
* Copyright 2025 Beijing Volcano Engine Technology Co., Ltd. All Rights Reserved.
* SPDX-license-identifier: BSD-3-Clause
*/
import { useEffect, useMemo, useState, memo } from 'react';
import { Button, Drawer } from '@arco-design/web-react';
import CheckBox from '@/components/CheckBox';
import styles from './index.module.less';
import utils from '@/utils/utils';
export interface ICheckBoxItemProps {
icon?: string;
label: string;
description?: string;
key: string;
}
interface IProps {
data?: ICheckBoxItemProps[];
onChange?: (key: string) => void;
value?: string;
label?: string;
moreIcon?: string;
moreText?: string;
placeHolder?: string;
}
function CheckBoxSelector(props: IProps) {
const { placeHolder, label = '', data = [], value, onChange, moreIcon, moreText } = props;
const [visible, setVisible] = useState(false);
const [selected, setSelected] = useState<string>(value!);
const selectedOne = useMemo(() => data.find((item) => item.key === value), [data, value]);
const handleSeeMore = () => {
setVisible(true);
};
useEffect(() => {
setSelected(value!);
}, [visible]);
return (
<>
<div className={styles.wrapper}>
{selectedOne ? (
<CheckBox
className={styles.box}
icon={selectedOne?.icon}
label={selectedOne?.label || ''}
description={selectedOne?.description}
noStyle
/>
) : (
<div className={styles.placeholder}>{placeHolder}</div>
)}
<Button type="text" className={styles.seeMore} onClick={handleSeeMore}>
{moreIcon ? <img src={moreIcon} alt="moreIcon" /> : ''}
<span className={styles.seeMoreText}>{moreText || '查看更多'}</span>
</Button>
</div>
<Drawer
style={{
width: utils.isMobile() ? '100%' : '650px',
}}
closable={false}
className={styles.modal}
title={label}
visible={visible}
footer={
<div className={styles.footer}>
<Button className={styles.cancel} onClick={() => setVisible(false)}>
</Button>
<Button
className={styles.confirm}
onClick={() => {
onChange?.(selected);
setVisible(false);
}}
>
</Button>
</div>
}
>
<div className={styles.modalInner}>
{data.map((item) => (
<CheckBox
className={styles.box}
key={item.key}
icon={item.icon}
label={item.label}
description={item.description}
checked={item.key === selected}
onClick={() => setSelected(item.key)}
/>
))}
</div>
</Drawer>
</>
);
}
export default memo(CheckBoxSelector);

View File

@ -1,130 +0,0 @@
/**
* Copyright 2025 Beijing Volcano Engine Technology Co., Ltd. All Rights Reserved.
* SPDX-license-identifier: BSD-3-Clause
*/
.header {
height: 48px;
background: white;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
position: relative;
:global {
.arco-popover-content-top {
padding: 0px;
}
}
}
.header-logo {
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 24px;
:global {
img {
height: 24px;
}
.arco-popover-content {
padding: 0;
}
}
}
.menu-wrapper {
display: flex;
flex-direction: column;
align-items: center;
row-gap: 8px;
justify-content: space-between;
}
.header-logo-text {
background: linear-gradient(90deg, #004FFF 38.86%, #9865FF 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
font-size: 16px;
}
.header-right {
z-index: 2;
color: #fff;
display: flex;
align-items: center;
:global {
span {
height: 24px;
}
}
}
.header-setting-btn {
background-color: transparent;
border: none;
margin-right: 24px;
color: #000000;
font-size: 16px;
cursor: pointer;
}
.header-pop {
:global {
.ant-popover-arrow {
// display: none;
left: 16px;
.ant-popover-arrow-content {
&:before {
background-color: white;
}
}
}
.ant-popover-content {
margin-left: 12px;
}
.ant-popover-inner {
margin-right: 12px;
}
.ant-popover-inner-content {
padding: 0;
background-color: white;
position: relative;
width: 100px;
height: 100px;
display: flex;
align-items: center;
flex-direction: column;
justify-content: space-between;
padding-bottom: 7px;
padding-top: 7px;
cursor: pointer;
color: black;
div {
font-size: 13px;
font-weight: 400;
line-height: 20px;
&:hover {
color: #1664ff;
}
}
}
}
}
.divider {
margin-top: 2px;
margin-bottom: 2px;
min-width: 70%;
width: 70%;
}
.header-right-text {
color: #000000;
margin-right: 24px;
cursor: pointer;
}

View File

@ -1,102 +0,0 @@
/**
* Copyright 2025 Beijing Volcano Engine Technology Co., Ltd. All Rights Reserved.
* SPDX-license-identifier: BSD-3-Clause
*/
import { Button, Divider, Popover } from '@arco-design/web-react';
import { IconMenu } from '@arco-design/web-react/icon';
import NetworkIndicator from '@/components/NetworkIndicator';
import utils from '@/utils/utils';
import Logo from '@/assets/img/Logo.svg';
import styles from './index.module.less';
const Disclaimer = 'https://www.volcengine.com/docs/6348/68916';
const ReversoContext = 'https://www.volcengine.com/docs/6348/68918';
const UserAgreement = 'https://www.volcengine.com/docs/6348/128955';
interface HeaderProps {
children?: React.ReactNode;
hide?: boolean;
}
function Header(props: HeaderProps) {
const { children, hide } = props;
const MenuProps = [
{
name: '免责声明',
url: Disclaimer,
},
{
name: '隐私政策',
url: ReversoContext,
},
{
name: '用户协议',
url: UserAgreement,
},
];
return (
<div
className={styles.header}
style={{
display: hide ? 'none' : 'flex',
}}
>
<div className={styles['header-logo']}>
{utils.isMobile() ? null : (
<Popover
content={
<div className={styles['menu-wrapper']}>
{MenuProps.map((menuItem) => (
<Button
type="text"
key={menuItem.name}
onClick={() => {
window.open(menuItem.url, '_blank');
}}
>
{menuItem.name}
</Button>
))}
</div>
}
>
<IconMenu className={styles['header-setting-btn']} />
</Popover>
)}
<img src={Logo} alt="Logo" />
<Divider type="vertical" />
<span className={styles['header-logo-text']}> AI </span>
<NetworkIndicator />
</div>
{children}
{utils.isMobile() ? null : (
<div className={styles['header-right']}>
<div
className={styles['header-right-text']}
onClick={() =>
window.open('https://www.volcengine.com/product/veRTC/ConversationalAI', '_blank')
}
>
</div>
<div
className={styles['header-right-text']}
onClick={() =>
window.open(
'https://www.volcengine.com/contact/product?t=%E5%AF%B9%E8%AF%9D%E5%BC%8Fai&source=%E4%BA%A7%E5%93%81%E5%92%A8%E8%AF%A2',
'_blank'
)
}
>
</div>
</div>
)}
</div>
);
}
export default Header;

View File

@ -7,12 +7,11 @@
import Conversation from './Conversation';
import AudioController from './AudioController';
import utils from '@/utils/utils';
import style from './index.module.less';
function Room() {
return (
<div className={`${style.wrapper} ${utils.isMobile() ? style.mobile : ''}`}>
<div className={`${style.wrapper} ${style.mobile}`}>
<Conversation className={style.conversation} />
<AudioController className={style.controller} />
</div>

View File

@ -6,7 +6,7 @@
.main {
position: relative;
width: 100%;
height: 100%;
height: 100vh;
box-sizing: border-box;
.mainArea {

View File

@ -3,22 +3,19 @@
* SPDX-license-identifier: BSD-3-Clause
*/
import ResizeWrapper from '@/components/ResizeWrapper';
import utils from '@/utils/utils';
import MainArea from './MainArea';
import styles from './index.module.less';
export default function () {
return (
<ResizeWrapper className={styles.container}>
<div
className={styles.main}
>
<div className={`${styles.mainArea} ${utils.isMobile() ? styles.isMobile : ''}`}>
<div className={`${styles.mainArea} ${styles.isMobile}`}>
<MainArea />
</div>
</div>
</ResizeWrapper>
);
}