feat: init

This commit is contained in:
2025-09-05 15:18:10 +08:00
parent ddbee614e8
commit 85244a451e
126 changed files with 3020 additions and 10278 deletions

View File

@@ -15,7 +15,7 @@ interface PropsConfig {
handleAllAni: () => void;
}
const allAni = ["全部宠物", "丑丑", "胖胖", "可可"];
function Index(props: PropsConfig) {
function SearchCom(props: PropsConfig) {
const [aniName, setAniName] = useState<string>("全部宠物");
const animenuRef = useRef<DropdownRef>(null);
const handleAniSelect = (val: RadioValue) => {
@@ -84,4 +84,4 @@ function Index(props: PropsConfig) {
);
}
export default Index;
export default SearchCom;

View File

@@ -1,39 +1,41 @@
.home {
height: 100%;
overflow: hidden;
.adm-tabs {
display: flex;
flex-direction: column;
height: 100%;
}
.adm-tabs-content {
flex: 1;
overflow: hidden;
padding: 0px;
}
.adm-tabs-header {
border: 0 none;
position: sticky;
top: 0px;
background: #fff;
z-index: 99;
}
// .adm-tabs {
// display: flex;
// flex-direction: column;
// height: 100%;
// }
// .adm-tabs-content {
// flex: 1;
// overflow: hidden;
// padding: 0px;
// }
// .adm-tabs-header {
// border: 0 none;
// position: sticky;
// top: 0px;
// background: #fff;
// z-index: 99;
// }
.adm-tabs-tab {
font-size: 20px;
color: rgba(0, 0, 0, 0.25);
font-weight: 600;
&.adm-tabs-tab-active {
color: #000;
}
}
.adm-tabs-tab-line {
height: 0px;
}
// .adm-tabs-tab {
// font-size: 20px;
// color: rgba(0, 0, 0, 0.25);
// font-weight: 600;
// &.adm-tabs-tab-active {
// color: #000;
// }
// }
// .adm-tabs-tab-line {
// height: 0px;
// }
.translate-container {
display: flex;
flex-direction: column;
height: 100%;
.header {
}
}
}

View File

@@ -15,14 +15,18 @@ function Index() {
return (
<MainLayout>
<div className="home">
<Tabs stretch={false}>
<div className="header">
<h3></h3>
<div></div>
</div>
{/* <Tabs stretch={false}>
<Tabs.Tab title="宠物翻译" key="1">
<Translate />
</Tabs.Tab>
<Tabs.Tab title="宠物档案" key="2">
2
</Tabs.Tab>
</Tabs>
</Tabs> */}
</div>
</MainLayout>
);

View File

@@ -2,11 +2,7 @@ import { useCallback, useEffect, useState } from "react";
import { Image, Toast } from "antd-mobile";
import MessageCom from "./component/message";
import VoiceRecord from "./component/voice";
import {
XPopup,
FloatingMenu,
type FloatMenuItemConfig,
} from "@workspace/shared";
import { XPopup, FloatingMenu, type FloatMenuItemConfig } from "@workspace/shared";
import type { Message } from "./types";
import { mockTranslateAudio } from "@/utils/voice";
@@ -14,21 +10,14 @@ import dogSvg from "@/assets/translate/dog.svg";
import catSvg from "@/assets/translate/cat.svg";
import pigSvg from "@/assets/translate/pig.svg";
import { MoreTwo } from "@icon-park/react";
import SearchCom from "./component/search";
interface DefinedProps {}
const menuItems: FloatMenuItemConfig[] = [
{ icon: <Image src={dogSvg} />, type: "dog" },
{ icon: <Image src={catSvg} />, type: "cat" },
{ icon: <Image src={pigSvg} />, type: "pig" },
{
icon: (
<MoreTwo
theme="outline"
size="24"
fill="#666"
strokeWidth={3}
strokeLinecap="butt"
/>
),
icon: <MoreTwo theme="outline" size="24" fill="#666" strokeWidth={3} strokeLinecap="butt" />,
type: "add",
},
];
@@ -85,9 +74,7 @@ function Index(props: DefinedProps) {
setMessages((prev) =>
prev.map((msg) =>
msg.id === messageId
? { ...msg, translatedText, isTranslating: false }
: msg
msg.id === messageId ? { ...msg, translatedText, isTranslating: false } : msg
)
);
} catch (error) {
@@ -124,17 +111,17 @@ function Index(props: DefinedProps) {
return (
<div className="translate-container">
<div className="header">
<SearchCom handleAllAni={() => {}} />
</div>
<MessageCom data={messages} isRecording={isRecording}></MessageCom>
<VoiceRecord
onRecordingComplete={onRecordingComplete}
isRecording={isRecording}
onSetIsRecording={onSetIsRecording}
/>
<FloatingMenu
menuItems={menuItems}
value={currentLanguage}
onChange={onLanguage}
/>
<FloatingMenu menuItems={menuItems} value={currentLanguage} onChange={onLanguage} />
<XPopup
title="选择翻译语种"
visible={visible}

View File

@@ -1,13 +0,0 @@
import useI18n from "@/hooks/i18n.ts";
import MainLayout from "@/layout/main/mainLayout";
import { Button } from "antd-mobile";
import { useI18nStore } from "@/store/i18n.ts";
function Index() {
const t = useI18n();
const i18nStore = useI18nStore();
return <MainLayout>qq</MainLayout>;
}
export default Index;