|
@@ -1,16 +1,17 @@
|
|
|
import { useNavigate } from "react-router";
|
|
import { useNavigate } from "react-router";
|
|
|
import { useAuth } from "@/client/mobile/hooks/AuthProvider";
|
|
import { useAuth } from "@/client/mobile/hooks/AuthProvider";
|
|
|
import { UserType } from "@/server/modules/users/user.enum";
|
|
import { UserType } from "@/server/modules/users/user.enum";
|
|
|
|
|
+import { getGlobalConfig } from "@/client/utils/utils";
|
|
|
|
|
|
|
|
export default function StockHomePage() {
|
|
export default function StockHomePage() {
|
|
|
const { user } = useAuth();
|
|
const { user } = useAuth();
|
|
|
const navigate = useNavigate();
|
|
const navigate = useNavigate();
|
|
|
|
|
|
|
|
- const handleClassroomClick = () => {
|
|
|
|
|
|
|
+ const handleClassroomClick = (classId = '') => {
|
|
|
if (user?.userType === UserType.TEACHER) {
|
|
if (user?.userType === UserType.TEACHER) {
|
|
|
- navigate('/mobile/classroom/' + UserType.TEACHER);
|
|
|
|
|
|
|
+ navigate(`/mobile/classroom/${classId}/${UserType.TEACHER}`);
|
|
|
} else {
|
|
} else {
|
|
|
- navigate('/mobile/classroom/' + UserType.STUDENT);
|
|
|
|
|
|
|
+ navigate(`/mobile/classroom/${classId}/${UserType.STUDENT}`);
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -56,10 +57,16 @@ export default function StockHomePage() {
|
|
|
|
|
|
|
|
<div className="flex flex-col gap-4 max-w-md mx-auto">
|
|
<div className="flex flex-col gap-4 max-w-md mx-auto">
|
|
|
<button
|
|
<button
|
|
|
- onClick={handleClassroomClick}
|
|
|
|
|
|
|
+ onClick={() => handleClassroomClick(getGlobalConfig('PUBLIC_CHATROOM_ID'))}
|
|
|
className="bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-lg shadow-md transition-colors duration-200 text-center"
|
|
className="bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-lg shadow-md transition-colors duration-200 text-center"
|
|
|
>
|
|
>
|
|
|
- 解盘室
|
|
|
|
|
|
|
+ 公开解盘室
|
|
|
|
|
+ </button>
|
|
|
|
|
+ <button
|
|
|
|
|
+ onClick={() => handleClassroomClick(getGlobalConfig('PRIVATE_CHATROOM_ID'))}
|
|
|
|
|
+ className="bg-blue-600 hover:bg-blue-700 text-white font-medium py-3 px-6 rounded-lg shadow-md transition-colors duration-200 text-center"
|
|
|
|
|
+ >
|
|
|
|
|
+ 学员解盘室
|
|
|
</button>
|
|
</button>
|
|
|
<button
|
|
<button
|
|
|
onClick={() => navigate('/mobile/exam')}
|
|
onClick={() => navigate('/mobile/exam')}
|