nahida 1 anno fa
parent
commit
5f3e30e72a
4 ha cambiato i file con 17 aggiunte e 13 eliminazioni
  1. 7 10
      src/pages/detail/index.tsx
  2. 2 2
      src/pages/tonghua/index.tsx
  3. 2 1
      tsconfig.app.json
  4. 6 0
      vite.config.ts

+ 7 - 10
src/pages/detail/index.tsx

@@ -1,11 +1,14 @@
-import { Link, useSearchParams } from "react-router-dom";
+import {Link, useNavigate, useSearchParams} from "react-router-dom";
 import { useEffect, useState } from "react";
 import { Button } from "antd";
 
 function Index() {
   const [searchParams] = useSearchParams();
-  const [value, setValue] = useState<string>('')
-  console.log(searchParams);
+  const [value, setValue] = useState<string>('');
+  const navigate = useNavigate();
+  const toCall = ()=>{
+    navigate('/tonghua');
+  }
   useEffect(() => {
     setValue(searchParams.get('value') as string)
   }, []);
@@ -19,15 +22,9 @@ function Index() {
       </div>
       <img className={'h-900px w-1500px'} alt={'图片'} src={'/流程.png'} />
       <div>
-        <Button type={'primary'} className={'float-end'}>
+        <Button type={'primary'} className={'float-end mr-100px'} onClick={toCall}>
           在线呼叫
         </Button>
-        <Link
-          to={`/tonghua`}
-          className=""
-        >
-          <span className="">11223</span>
-        </Link>
       </div>
     </>
   );

+ 2 - 2
src/pages/tonghua/index.tsx

@@ -44,8 +44,8 @@ export default function ServiceGuide() {
 	const call = async () => {
 		await TUICallKitServer.call({
 			userID: calleeUserID,
-			type: TUICallType.AUDIO_CALL,//只有语音通话
-			// type: TUICallType.VIDEO_CALL,//语音加视频通话
+			// type: TUICallType.AUDIO_CALL,//只有语音通话
+			type: TUICallType.VIDEO_CALL,//语音加视频通话
 		});
 	};
 	return (

+ 2 - 1
tsconfig.app.json

@@ -20,7 +20,8 @@
     "noUnusedLocals": true,
     "noUnusedParameters": true,
     "noFallthroughCasesInSwitch": true,
-    "noUncheckedSideEffectImports": true
+    "noUncheckedSideEffectImports": true,
+    "allowJs": true
   },
   "include": ["src"]
 }

+ 6 - 0
vite.config.ts

@@ -1,8 +1,14 @@
 import { defineConfig } from 'vite'
 import react from '@vitejs/plugin-react-swc'
 import UnoCSS from 'unocss/vite'
+import * as path from "node:path";
 
 // https://vite.dev/config/
 export default defineConfig({
   plugins: [react(),UnoCSS(),],
+  resolve: {
+    alias: {
+      '@': path.resolve(__dirname, 'src'), // 将 '@' 别名指向 'src' 目录
+    },
+  },
 })